Handheld Arduino LED Matrix Thermometer
1109 Views, 1 Favorites, 0 Comments
Handheld Arduino LED Matrix Thermometer
Made for ART3681C - Interactive Electronic Art
Supplies
Needed Supplies:
Most of the supplies I used were in this ELEGOO Arduino starter kit: https://www.amzn.com/B01D8KOZF4
- 1 - ELEGOO Arduino UNO R3 (included in kit)
- 1 - DHT11 Temperature and Humidity Sensor (included in kit)
- 6 - Male-to-Male Jumper Wires (included in kit)
- 1 - 9V Battery with Battery Clip (included in kit) or 1 - 5V Power Adapter (not included)
- 1 - 8 x 8 WS2812B LED Matrix: https://www.amzn.com/B088BTSPYD
- Thin Heat Shrink Tubing or Electrical Tape
- Arduino IDE (used to add code to the Arduino) https://www.arduino.cc/en/software
To add code to the Arduino, you'll need a computer nearby, and the USB cable that came included with the kit.
Optional Supplies:
I had leftover chipboard, Bristol board, and tacky glue to make a screen for the LED Array, but it's not necessary to complete the project. If you want to make the screen I made, you'll need a 3.5" x 3.5" square of any kind of thicker-pressed paper(Bristol board or cardstock are some examples),a small amount of chipboard, and tacky glue to make a frame for the LED Matrix.
Prepare the Jumper Wires
To begin, grab six jumper wires. I recommend grabbing two red, two black, and two other separate colors, choosing four colors in total. After gathering the wires, you should notice that they have some rubber bits on both ends of them. We'll want to remove some of them by pressing the point of the jumper wire into the surface you're working on and holding onto the rubber part. They should come off rather easily, without ruining the wire. Do this on both ends to one red wire, one black wire, and one of the other colored wires. On the other three wires, you'll only want to remove one of the rubber ends, instead of both. We want to remove some of these so that we can connect everything together while also maintaining a lower profile on the finished product.
Start Connecting the DHT11 Sensor
Grab the DHT11 Temperature and Humidity Sensor from the Arduino Kit, the three wires that have both rubber ends removed, and some heat shrink/electrical tape. The sensor should look like a blue box with holes, connected to a tiny circuit board with three leads coming from the board. Hold the sensor so that the blue is facing you, and the leads are pointing down. In this orientation, the leads in order from left to right are Data, Power(5v), and Ground. We'll want to connect a wire to each of the leads on the sensor. I recommend using red for Power, black for Ground, and whichever other color was chosen for Data.
With Heat Shrink:
- Add the thin-sized heat shrink to a end of jumper wire.
- Put one of the leads of the sensor in the heat shrink and make sure that the wire end and lead touch a decent bit.
- Warm the heat shrink so that it collapses around the wire end and lead, making a connection between the two.
- Repeat for the other two leads.
With Electrical Tape:
- Wrap a tiny bit of electrical tape around the end of a jumper wire.
Put one of the leads of the sensor on the tape and make sure that the wire end and lead touch a decent bit.
Press the tape around the lead and wire, making sure that the connection is solid.
Repeat for the other two leads.
Once you have the wires connected firmly with the leads, take the other point of each wire and bend them 90 degrees. You might have to add heat shrink or tape to the other end, as the wires sit close together on the Arduino, and having them touch might cause shorting.
Start Connecting the LED Matrix
Grab the LED Matrix, along with the other three wires, these being the ones where only one rubber end was removed. The LED Matrix has several wire coming from it, two sets of red/white/green wires, and one red/black pair of wires. We only care about one set of the red/white/green wires, specifically the one that's labeled Power/Ground/DIN(Data In). The other wires can be cut short (I recommend cutting them down a bit, but not all the way, incase you might damage the matrix, or if you would want to reuse the matrix later.)
The set we care about should have a black plastic connector on the end. We want to take the jumper wires, and with the ends that still have the rubber bits, insert the wire ends into the connector, connecting the colors in each spot. (Red to Red, Black to White, and the other color to Green). After doing this, take the other end of the wires and bend them 90 degrees like the previous step.
Connect Both Parts to the Arduino Uno
Starting with the DHT11 Sensor, connect the red wire to the Vin Pin on the Arduino, the black wire to one of the Ground Pins, and the other colored wire to the A0 Analog in Pin.
Next is the LED Matrix. Take the red wire and connect it to the 5V pin on the Arduino. Connect the black wire to the other ground pin. Finally, connect the other colored wire to the ~6 Digital Pin.
Installing Libraries to Arduino IDE
We'll need to use some libraries so that the Arduino can properly communicate to the sensor and the LED matrix.
- For DHT11 sensor: https://github.com/adidax/dht11
- To add this library, go to Sketch -> Include Library -> Add .ZIP Library.
- From there, locate the dht11-master.zip file from the location you downloaded it to.
- The LED matrix libraries can be installed within Arduino IDE:
- To add the matrix libraries, go to Sketch -> Include Library -> Manage Libraries...
- From there, you want to type in the search bar "Adafruit NeoMatrix", "Adafruit NeoPixel", and "Adafruit GFX Library"
- Install each of the libraries named exactly after the search.
Import Code to Arduino IDE
Connect the Arduino Uno to your computer using the USB cable included with the starter kit. Within this .ino file is the code that allows the Arduino Uno to take inputs from the DHT11 sensor and output a temperature in Fahrenheit and a Humidity in percentage to the LED Matrix. Each line has a comment, marked by grayed out text, which shows the function of each line. Once you have the file open and the Arduino connected, press Upload(Circle with arrow pointing right, located near the top). The LED matrix should light up, showing the Temperature and Humidity.
Downloads
Power the Arduino Uno
Once the .ino file has been uploaded to the Arduino, you can safely unplug the USB cable from the Arduino. Depending on how you choose to power the Arduino will determine how the project can be used. A 5V adapter can be used to power the Arduino as long as you want, but that limits your uses to wherever the closest wall outlet is. Using the included 9V Battery and battery clip allows you to place the thermometer anywhere, with the drawback of how long the battery lasts.
Optional Steps: Making a Screen for the LED Matrix
Here is where the chipboard and thick paper is used. You can use these to design the screen however you want, using whatever materials you'd like, but I'll briefly go through the process that I went through to make mine.
I first got measurements of the LED Matrix. If you got the one linked in the beginning of the instructable, yours should be about 3.5" wide and long. You'll want to cut a square of the thick paper the same size as that.
Next, grab the chipboard and cut two squares that are slightly larger in either diection, about 3.75" wide and long. Take one of the chipboard squares and cut a smaller square out of the center it. You'll want to leave some overhang so that you can glue the paper to the chipboard, kind of like a frame. The size of the square I cut out was about 3.25" wide and long. After that, I cut out small strips of chipboard to connect the two squares together, and glued them all together. I intentionally left one side of the frame open, so that I could remove the LED Matrix if I needed to.
Once the screen was made, I stuck the Arduino and DHT11 Sensor to the back of it, and called it finished