Welcome back! In this instructable I will be guiding you in making your own digital thermometer with a momentary backlight. This instructable uses parts from the Intel Edison IoT Dev Kit, which was very generously given to me from Intel and Instructables. Specifically, the parts used are as follows:
- Intel Edison w/ Arduino Breakout
- Grove Base Shield v2
- Grove RGB Backlight LCD
- Grove Temperature module
- Grove Push-button module
- 3D printed mount (optional)
Before going any farther, I want to thank Intel and Instructables for
being awesome by selecting me along with 249 others to receive a Dev Kit. That was very surprising to me, and I am very grateful for it. Thank you!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Wire It All Up
First, plug the Grove shield into the Edison, making sure it is facing the correct direction (it will not go in the other way.) Next, plug in the following using Grove cables:
- LCD to any "I2C" port (note 1 in Image 1)
- Temperature module to analog 0 ("A0")
- Button module to digital 2 ("D2")
If you want, and have the ability to do so, you may print a mount for the 3 modules. I'm attaching my design, which holds the display in the center with the temperature and button modules beside it. I printed mine with 0.3 mm layer height, no raft and 10% infill in ABS with a Makerbot Replicator Dual.
Make sure the switch on the Grove shield is facing toward the "5v" label above it, as this will power all devices connected with 5v as opposed to 3v3.
Step 2: Code the Code
Now for the fun part: coding. Coding is my favorite part of making, hence why I am going to be majoring in computer science when I get into college. There are some parts in this program which are customizable, from the delay in the backlight to the color of the backlight. Let's get started, shall we?
I'm new to GitHub, so please bear with my lacking skill in it. (If you have any pointers or tips, I very much appreciate them!) The only file you should need is the Arduino sketch file, .ino. You will need the Wire, rgb_lcd and math libraries.
Here is what you can customize (in format of "line # : what it changes):
- 9: analog pin the thermometer is connected to.
- 14: digital pin the pushbutton is connected to.
- 17-19: the color of the screen when you press the button. 255,255,255 is white; 255,0,0 is red; etc.
- 36: The text displayed on the first line.
- 51: The 5000 is the delay in milliseconds (i.e. 5 seconds) after the button is pressed. You may change that as you wish.
- 61: Same as 51, this is the time in milliseconds, only this one between temperature updates.
- 65: The position of the temperature text.
And of course, you may change variable names around as you feel fit.
Step 3: Possible Future Updates
With programming comes constant updates. Like in tinkering with DIY machines, programs continue to become better and better (sometimes worse) as time progresses. Some possible changes to this code include:
- More accurate temperature:
- Perhaps a mean temperature, of the past 10 readings.
- Maybe a mean temperature, only this of 10 readings between each output. That would yield the most accurate-to-the-time temperatures.
If you have any ideas, post a comment or edit the git (I don't know how that works.)
Step 4: Upload and Enjoy!
To upload, you should only need 1 micro USB cable plugged into the inner port (the one closer to the switch.) Now you can place this module anywhere (with a power outlet) and have a real-time digital thermometer! Just a note, the temperature can deviate up/down 1.5ºC, or near 3ºF both ways!
Thanks for listening! I'll see you next Instructable!