5

I'm making a simple Infrared detector using a thermopile. I have a few extra capacitors than what that schematic says. I'm currently following another, but this is the gist.

Schematic and Breadboard- Breadboard and Schematic

I can add breadboard picture if needed. I don't have 10 points in this Stack so I can't post more than 2.

I'm using a 9V battery through a 24v - 5v regulator (had one around) to power my op amp and schematic. The signal from the OPAMP will be between 0-5V so voltage hasn't damaged the Arduino Uno. The final project will be something like: output > A then power green, A < output < B power yellow, B < output red.

The issue is that I'm getting an oscillating value from my Serial Monitor that goes from 0 to 1023 (or I have a conversion to change it back to output voltage. So 0V to 5V. See code).

It does this oscillation when I have the board connected to any of the AX pins (X=0-5) or nothing plugged in at all (I understand it will output weird numbers with the pin floating).

I had a picture of the serial monitor but I don't have 10 points to add more than 2 pictures. Please see image below

I know that the output from the OPAMP works because when I use a VoltMeter to read the output, it works fine. 0.3XXV when no flame, 5V when flame is directly on top of my theromopile. Serial Monitor and VM

Would anyone happen to have a suggestion to why the Arduino is acting this way? The volt meter reading is directly out of the Op amp pin 1. no more than 2 links. AD822 op amp

Here's my code before adding if statements for the LED's. It was incorrect.

int TP=A2; // Assign Thermopile to pin A2
int val; // Declare readValue Variable
float Voltage; // Declare real world voltage variable - Float = in between variable
int ledG = 11;
int ledY = 12;
int ledR = 13;

void setup() {
 pinMode(TP,INPUT); // Declare Thermopile pin as input
 pinMode(ledG, OUTPUT);
 pinMode(ledR, OUTPUT);
 pinMode(ledY, OUTPUT);
 Serial.begin(9600); // Start your Serial Port
}

void loop() {
  val = analogRead(TP); // Read Thermopile pin and place value into readValue

  Voltage = (5./1023.)*val; // To do "floating point math" have a "." //after the number. If not, it will return real number (5/1023 = 0) according to Arduino


Serial.println(Voltage); // Print readValue to Serial Monitor
  delay(100); // Delayed output to 1/4 a second  
}
7
  • You can still workaround the limitation about pictures by combining them with some photo editing SW ;-) Commented Sep 23, 2015 at 20:32
  • To improve the precision of the calculation, I'd do Voltage = val * 5. / 1023; Commented Sep 23, 2015 at 20:36
  • Good idea about combining images..... Updated the question.
    – Luke
    Commented Sep 23, 2015 at 20:38
  • LED in the bread board aren't expected to work.
    – Luke
    Commented Sep 23, 2015 at 20:39
  • 1
    Have you connected your circuit ground to the Arduino ground?
    – Majenko
    Commented Sep 23, 2015 at 21:54

1 Answer 1

3

It seems you haven't connected the circuit ground to the Arduino ground. This is essential to complete the circuit between your breadboard and the Arduino. Without the ground connection the electrons that you send to the Arduino have no way of getting back again.

Here's a couple of diagrams that I drew for another question which deals with the Arduino driving a remote device, but the theory holds true no matter which way around it is.

enter image description here

In that diagram the red arrows (not the aerial display team I hasten to add) represent the connection between your breadboard circuit and the Arduino. Without the ground connection there is no circuit, and a circuit is always needed for current to flow (and hence your signal). With the ground connection the red arrows become a loop which allows the current to flow and transfer your signal.

1
  • Perfect! Thank you for the extra description! It made understanding what I was missing a lot more clearer.
    – Luke
    Commented Sep 24, 2015 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.