The Love-O-Meter LEDS not lighting up

for some reason the LEDS wont light up. i’ve quadruple checked all the connections/power/resistors/etc as well as the code but i cant figure it out. im getting readings but no no light. i’ve lowered the basline temp from 20 to 10 but it didn’t help

const int sensorPin = A0;
const float baselineTemp = 10;
void setup(){
  Serial.begin(9600) // bits per second/ open serial port
  ;for(int pinNumber = 2; pinNumber<5; pinNumber++){
  pinMode(pinNumber, OUTPUT);
  digitalWrite(pinNumber, LOW);
  }
  }
  void loop(){
  int sensorval = analogRead(sensorPin); 
  Serial.print (" Sensor Value");
  Serial.print ( sensorval);
   float voltage = (sensorval/1024.0)*5.0;
   Serial.print("Volts");
   Serial.print(voltage);
   Serial.print("Degrees C"); // convert voltage to temp C
   float temperature = (voltage - 5) * 100;
   Serial.println(temperature);
   if(temperature < baselineTemp){
     digitalWrite(2, LOW);
     digitalWrite(3, LOW);
     digitalWrite(4, LOW);
   }else if (temperature >=baselineTemp +2 && temperature > baselineTemp+4){
     digitalWrite(2, HIGH);
     digitalWrite(3, LOW);
     digitalWrite(4, LOW);
   }else if (temperature >= baselineTemp +4 && temperature < baselineTemp +6){
   digitalWrite(2, HIGH);
   digitalWrite(3, HIGH);
   digitalWrite(4, LOW);
   }else if (temperature >= baselineTemp +6){
   digitalWrite(2, HIGH);
   digitalWrite(3, HIGH);
   digitalWrite(4, HIGH);
   }
   delay(1);
   }

Are we supposed to know how your circuit is wired and every component and value ?
Try posting a schematic and photo of your setup. Have you tried running a led test program that only drives the leds first ?

trying to upload pics...made a photobucket account to upload to but pictures wont go up...

UPDATE when i connect power the last LED lights up for a couple seconds and the temp sensor gets really hot.
I'm still trying to upload a picture somehow.

and the temp sensor gets really hot.

That should NOT be happening. We are going to need the wiring connection list . I don't see any info on the sensor . Why are you
not telling us that ?

Hi forerunner,

Hit Reply and then click "Additional Options..." under the box where you type your reply. Then hit "Browse" and select your pic.

Paul

the pictures show ground not connected, but i did in fact connect ground and it didn’t work

const int sensorPin = A0;

This tells us nothing about the sensor . Upload the datasheet.

I can't see anything wrong with your connections. Might you have wired it up incorrectly earlier? Maybe you damaged the temp sensor. Do you have a pot (potentiometer)? You could wire that up in its place to test.

What are those resistors? Code looks like red-red-purple, which would be too high. But that might just be the camera. Red-Red-Brown (220R) would be fine.

Paul

hey paul

When i hook up the potentiometer, all the lights come on. when i remove it, all the lights are still on. the resistors im using are red-red-brown. i tried a new temp sensor, but it's the same result. all the lights come on for a couple secs, then got off. And the sensor heats up like a stove.

What voltage do you have connected to the +V of the breadboard ?

i've tried both 5v and 3.3v. i actually solved the issue of it being to hot to touch by making the right pin of the sensor go to ground and the left to power. it's positioned with the round side facing away from arduino. What i've noticed is putting my fingers on the sensor doesn't increase the temperature. When i give it power, the temperature rapidly falls until 34.47C then doesn't go up if i press my fingers around it.

Did you read the datasheet before you hooked it up?

I, too, am on the third (Love-O-Meter) project.

My temperature sensor gives me readings but the readings are obviously incorrect. When I open COM 3, I see:

Sensor Value: 341
Volts: 1.67
Degrees C: 116.50

I used the coding provided with the kit for that project but I know the room temperature is not 116.5 degrees.

Any suggestions?

  ;for(int pinNumber = 2; pinNumber<5; pinNumber++){

why is there a semicolon at the beginning of this statement ?

Hi, looking at the picture of your project, you have all the led and sensor gnds connected together but not connected to the arduino gnd.
That will fix quite a few problems.

Tom.... :slight_smile:

I can see the red +5V wire but I can't see a ground wire connected to the arduino. Where is it ?
Also, I ran your code and I am measuring the temperature just fine. (after I made some changes).
I'd like to know how you can read the temperature with no delays after your print statements at 9600 bps .

forerunner:
the pictures show ground not connected, but i did in fact connect ground and it didn't work

All, the OP already explained the missing ground connection.

Hi, you supplied the sensor data sheet, NOW which sensor is it?
Have you tried a 0.1uF Cap between the output pin of the sensor and it gnd pin, the device could be oscillating.

Tom… :slight_smile:
Can you just write a simple sketch that turns the LEDs on and off, forget the sensor remove it.
See if the LEDs are working reliably, also when you refit the sensor , move it to another part of the protoboard incase you have a short under the board.