I tried the Love-O-Meter example given in the Startup kit of Arduino. The example is available here. The temperature sensor is the TMP36 given with the kit.

If the three LEDs are off (e.g. when writing LOW in the code, comment the corresponding lines or unplug them), there is no problem: the real temperature in the room is given and the sensor gives a value around 150.

However, if one or more LEDs are on, then the temperature increases to around 10°C for each LED (the sensor gives 215 when the three LEDS are on).

The conversion from the sensor value to the temperature works well. Also, I measure a correct voltage by using a multimeter.

Any idea?


Run a separate ground connection for the temperature sensor.

The way it is shown in the picture of the link, The LEDs are sharing the ground connection, and this is causing a slight ground reference shift (voltage drop), which is causing the output voltage to be shifted with respect to the A2D ground reference.

| improve this answer | |
  • \$\begingroup\$ Gah, you were 7 seconds faster. :D \$\endgroup\$ – Richard the Spacecat Aug 13 '19 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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