Introduction: Arduino Thermostat
The idea is simple, use an Arduino and a few simple components along with a small LCD screen to create a functioning thermostat.
But can it be done?
Read on and find out!
Step 1: Materials
1 x breadboard. I ended up using 2 smaller ones, as you can see in the picture.
1 x Arduino Uno
1 x 16x2 LCD screen
1 x 300 ohm Potentiometer
3 x momentary switches
3 x 10k ohm resistors
1 x LED (color is your choice)
1 x temperature sensor. I used a TMP-36
Various jumper wires, around 30-40 is good.
Step 2: The Code
The original code was written by Dylon Jamna and modified by me.
Modifications included customized functions and slight reworks.
The code can be found Here
Feel free to edit the program to your liking, just be sure to credit myself and Dylon for the original.
Step 3: Assemble the Board
Following the above image, the layout is relatively simple.
Remember a static free work station is highly recommended. If you're an avid electronics enthusiast and don't have an ESD wristband or work mat, get one. If this is your first, and maybe only project, a large piece of metal such as a power supply case can work fine.
Now, lets begin!
First off, attach your LCD screen to the bread board. Have the opening pins spaced from left to right as shown above. For simplicity, the left-most pin, based off the orientation above, we'll refer to as pin 1, moving right to pin 2, pin 3, and so on.
Provide power to the breadboard by running one wire from the 5V pin to the + rail on your breadboard and another wire from the GND pin on the Arduino to the other long rail on your breadboard.
Press the potentiometer into place. Run a wire from the power rail to the outermost pin, then another wire from the ground rail to the other outermost pin. Connect a wire running from the middle pin to pin 3 on your LCD screen.
Run a wire from the gnd rail to the left-most pin on your LCD, then run another wire from the power rail to pin.
Now for the rest of the LCD connections:
Connect pin 4 to pin 12 on your Arduino
Connect pin 5 to pin 11 on your Arduino
Connect pin 6 to the GND rail.
Connect pin 11 to pin 5 on the Arduino
Connect pin 12 to pin 4 on the Arduino
Connect pin 13 to pin 3 on the Arduino
Connect pin 14 to pin 2 on the Arduino
Connect pin 15 to the GND rail
and finally, Connect pin 16 to the power rail.
Now to the buttons. The process can be repeated 3 times, the only difference is where the data pin goes.
Connect the power rail to one leg of the button, then on the 2nd leg, run a data wire to pin 7 on the Arduino. On that same leg, run a 10k ohm resistor to the GND rail.
Repeat the process 2 more times, running the data wires to pins 8 and 9 on the Arduino, respectively
Press the temperature sensor into the breadboard.
With the flat side facing you, run a wire from the power rail to the left-most pin, run a wire to the GND rail on the right most pin, and run a final wire from the center pin to pin A0 on the Arduino.
Press a LED into place, with the long leg pressed into pin 13 on the Arduino.
Double check all of your connections, comparing it to either the text above, or the photo above.
Step 4: Time to Test!
Plug the Arduino into your computer via the USB cable and run the program to the Arduino.
If all was done correctly, you should now have working thermostat!
If not, refer to the next step for a short troubleshooting guide.
Step 5: Hmm... It Doesn't Seem to Work (Troubleshooting)
I myself ran into two crippling issues when creating this guide:
Q: Help! My LCD displays gibberish characters!
A: Double check all of your lead connections. Be sure that they're all going from the correct pins to the right pins on the Arduino. Also check and be sure that no bridges on the Arduino are being jumped accidentally. If that doesn't work, try replacing the wires.
Q: The buttons don't work!
A: If you have a multimeter, the simplest thing to do is turn it to continuity mode and test the button. If the button works correctly, try changing the wires. I myself spent almost 2 days running in circles trying to figure out what was wrong and it turned out to be a faulty ground wire.
If any other questions arise feel free to comment and we can try and resolve them.
Step 6: All Done!
Thanks for reading this instructable and trying out this project.
IT really means a lot.
If you made it and it was a success, click the "I Made It" button at the top of the page.
What would you change or add to this?
Was it a challenge? Maybe it was a bit too easy?
Feel free to let me know in the comments below!
Also, keep an eye out for the next instructable. It'll be a blast!