Today we build a low power Arduino thermometer using a DS18B20 temperature sensor and a Nokia 5110 LCD display. But this project is different. It can last on batteries for almost 1.5 years! Yes! Using the Arduino low power library, we can have this project running for a long time. Watch the tutorial to find out more

Intro to the Low Power Arduino Thermometer

In this project, we use a DS18B20 temperature sensor in order to measure temperature, a Nokia 5110 LCD display in order to display the temperature, a photoresistor in order to detect night, and disable the LCD display to conserve power, and of course an ATMEGA 328 microcontroller with Arduino Uno bootloader. The power consumption is reduced to minimal by putting Arduino to sleep when it is not measuring the temperature, and by disabling the LCD display at night. Also, the Nokia 5110 LCD display is ideal because with the backlight off it needs around 0.2 mA of current! Arduino spends more than 99 percent of its time sleeping and only wakes up for a few ms every two minutes. That’s why we can achieve such a long battery life. Let’s now measure the actual current draw and calculate the battery life of this project. As you can see when Arduino is sleeping it only needs around 0.26 mA of current. As you saw, Arduino woke up for a few ms and went back to sleep. The current draw went up to 11-12 mA and now it’s back to 0.28 mA. If I cover the LDR in order to emulate night, the LCD goes off and as you can see Arduino is sleeping and the power consumption the current draw is 0.07 mA!

The parts needed for this project are these: An ATMEGA328 chip with Arduino Uno bootloader. 2 22pF capacitors, A 16MHz crystal a DS18B20 sensor module, a photoresistor a 10K resistor, and of course a Nokia 5110 LCD display. The cost of the project is very low, less than 10 euros. 3 euros for the ATMEGA328 chip, 2.5 euros for the Nokia 5110 LCD display, around 2 euros for the DS18B20 temperature module, and a few cents for the other parts.

——————–
WHERE TO BUY
——————–

1. ATMEGA328P: https://educ8s.tv/part/ATMEGA328P

2. Nokia 5110 LCD: https://educ8s.tv/part/NOKIA5110

3. DS18B20: https://educ8s.tv/part/DS18B20

4. Photoresistor: https://educ8s.tv/part/Photoresistors

5. Capacitors: https://educ8s.tv/part/ElectrolyticCapacitors

6. 16MHz crystal: https://educ8s.tv/part/Crystal16

7. Resistors: https://educ8s.tv/part/Resistors

8. Multimeter Mastech 8268: https://educ8s.tv/part/Multimeter

9. Large Breadboard: https://educ8s.tv/part/LargeBreadboard

10. Wires: https://educ8s.tv/part/Wires

11.AA Battery holder: https://educ8s.tv/part/BatteryHolderAA

12. Batteries: http://amzn.to/2b3Fh88

Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!

[adsense]

Let’s now see how to connect or these parts together. First, we build our own Arduino. Please check our detail tutorial on how to build your own Arduino Uno on a breadboard. Then we connect the temperature sensor. Minus goes to Ground, Plus goes to Vcc and output goes to digital pin 7 on our Arduino. Then we connect the photoresistor. We connect this leg to the Ground, the other one via the resistor goes to digital pin 6 because this is the pin that is going to power on LDR, only at specific times, and we connect the other pin to analog pin 0 in order to measure light. Then we connect the Nokia 5110 LCD display and we are ready to go, let’s try it.

As you can see although that I have powered on Arduino via this power bank the LCD display is off and it seems that is not working. What’s going on? look what happens if we remove the capacitors from The Breadboard. The circuit works fine. But why is this happening? Breadboard pins have their own capacitance. They act as small capacitors themselves! So we add more total capacitance to the crystal so it does not work correctly. The breadboard pins capacitance depends on the breadboard I think, so try your own circuit with or without the 22pF capacitors to see what works for your project. Now in order to see how to program the ATMEGA238 chip check our previous tutorial, but I have found another easy way to program the chip. Let’s see. If you have a standard Arduino board you can remove the ATMEGA chip from here and use it to your breadboard Arduino project. So you can use your Arduino Uno as a programming environment for your bare Arduino projects. For example, we can enter our ATMEGA chip here, plug it into our computer and program it with our software. Then we can easily remove it, and add it to our breadboard. It’s that easy! Be careful, the Reset pin goes this way down. In the breadboard, we put it the other way. So it is so easy.

Power Consumption

In order to quickly calculate the battery life of the project, I have prepared an Excel file. As you can see we enter the data from the multimeter here we can then change the parameters in Green, and we have the battery life in days calculated in this cell here. So, if we use a battery pack with a capacity of 2.500 mAhs like the one I use, if we measure the temperature every two minutes and if the display is off at night for around 8 hours we can achieve a battery life of 518 days! Impressive isn’t it? We can change the parameters and see how they affect the battery life. If for example, we measure the temperature every minute instead of every two minutes we have 11 days less battery life. So with this tool, we can easily make the project to fit our needs about power consumption and interval of measurements. Of course, these calculations are only theoretical. In practice, the battery life of the project will be less because batteries discharge even when they are not used! The Eneloop Pro batteries that I use claim that they only lose 25% of their power after one-year of no use. Cheaper batteries have of course worse self-discharge rate. So the use of good batteries is crucial in order to achieve long battery life to your project. Now let’s see how to connect all the parts together in order to build this project.

——————–
LIBRARIES
——————–

Low Power Library: http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/

Nokia 5110 Library: http://www.rinkydinkelectronics.com/library.php?id=47

he code of the project is simple and easy to understand. We are using the low power library, the DS18B20 library and of course the Nokia 5110 LCD display library. Please check our previous videos in order to see more details about how to use those libraries. if you need your project to display degrees F instead degrees C, change this c here into an f. At first, we initialize the sensor and the display. Then in the loop we first power on the LDR. In order to further decrease the power consumption of the project, we don’t provide power to the LDR all the time, only when we want to measure light. Every two minutes for 10 ms. So we read the value from the LDR if there is enough light we measure temperature we display it on the screen and we go to sleep for two minutes. Else if it is the night with disable the LCD display and we go immediately to sleep without measuring the temperature.

That’s the code of the project, please post any comments or questions about it in the comments section below. That’s today’s project. We finally achieved to make an Arduino project that can run on batteries for over a year! now we can move on to a more advanced project that can run on batteries for a long period of time. The weather station project will be the first one to benefit so stay tuned! Please feel free to post any questions or ideas to the comments section below, press the like button if you like the project and subscribe to our channel in order to watch our future videos.

——————–
CODE
——————–

 

 

 

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv