Please help, Temperatur sensing coaster -> LEDS don't light up.

Hey Everybody,

I’m a second semester Digital Media student from Germany, and am working on my first “Tech basics” Project. I am building a temperature sensing coffee coaster (first time i’m ever building something) that represents the temperature visually through RGB LEDS.

My problem is, that I essentially have no idea what I’m doing, my project doesn’t work, and i
desperately need some help fixing it.

I basically rebuilding this instructable:
Hot Beverage Monitor

Attached are pictures of my current Breadboard, and the .ino file of the code.

Thanks in advance!

How my breadboard is looking right now:

I’m Using a

  • DS18S20 temp sensor
  • 4.7k Ohm Resistor
  • 3.7V 2600mAh Battery
  • Arduino Genuino Nano
  • 4 RGB LEDS

When I press the button, the Arduino turns on, so that works. And when I plug the Arduino in my computer, it also displays something in coherence with the code:

Temperature for the device 1 (index 0) is: 28.06
Requesting temperatures…DONE
Temperature for the device 1 (index 0) is: 28.06
Requesting temperatures…DONE
Temperature for the device 1 (index 0) is: 28.06

… you get the point.

So it seems to be doing it’s thing, but the LEDS won’t turn on, nor switch color when I place my finger directly on the sensor.
I already tried switching out the LEDS, since I killed my sensor last night (bought a new one today), but the new LEDS wouldn’t turn on either, so the old ones can’t be dead.

The code:

I got the code from the same Instructable:

Hot Beverage Monitor

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

void setup(void)
pinMode(3, OUTPUT); //red
pinMode(4, OUTPUT); //green
pinMode(5, OUTPUT); //blue
// start serial port
Serial.println(“Dallas Temperature IC Control Library Demo”);

// Start up the library

void loop(void)
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print(“Requesting temperatures…”);
sensors.requestTemperatures(); // Send the command to get temperatures

Serial.print("Temperature for the device 1 (index 0) is: ");

if (sensors.getTempCByIndex(0) >= 55 && sensors.getTempCByIndex(0) <= 100)
digitalWrite (3, LOW);
digitalWrite (3, HIGH);

if (sensors.getTempCByIndex(0) >= 1 && sensors.getTempCByIndex(0) <= 54.99)
digitalWrite (4, LOW);
digitalWrite (4, HIGH);

if (sensors.getTempCByIndex(0) >= -128 && sensors.getTempCByIndex(0) <= 1)
digitalWrite (5, LOW);
digitalWrite (5, HIGH);


Have the LEDs ever turned on during your testing? Have you tried to reverse the "HIGH" and "LOW" just to see if the LED will turn on period?

Ive had similar issues before and it was just something simple that was over looked.

I would try to just turn on the LED outside of the conditions to insure that you have them wired up correctly.

Never trust Instructables.
Not good to power RGB LEDs from the 3.3volt pin, especially nano clones.
Not good to power a Nano from a LiPo battery on V-in. The Nano will only get ~2.5-3volt.
Bad/dangerous to have a LiPo battery on V-in while running the Nano from USB power.
The onboard regulator is not made for a reverse charge current, and the battery could catch fire from overcharging (unless you use a protected cell).

Use the Nano only on USB supply (forget about the battery).
Don't connect the LED common anodes to the 3.3volt pin.
Connect the common anodes via a 220ohm resistor to the 5volt pin.
(If you look closely at the Instructables diagram, you can see the resistor).