Introduction: LED Matrix Thermometer
A few updates! The code was edited so the decimal is in the correct location. I also added one step I forgot in the soddering section.
Using an LED Matrix board as well as a temperature sensor, I wanted to explore the possibility of low-quality animation using pixels to depict the temperature. The project is still a work in process as I plan to explore more of the arduino code. There were several hardships I experienced with this project - as I am very new to the use of arduino and coding. Assembly of the LED Matrix and the temp sensor were the easiest steps to this project.
In the end, I was unable to do the animations I initially intended. However, I did succeed in that it will read the temperature of the room in a scrolling text. There are still some hiccups to the code (Mainly the fact that I need to find the conversion code to change it to degrees Fahrenheit). Right now it is currently reding in Celsius but the decimal point is not in the correct location.
The project is fairly simple once you get the supplies. Each item is linked to the place where you could find/buy it.
32 x 16 RGB LED Matrix from Adafruit (This should include your power cable as well as your ribbon cable with your purchase)
Permanent BreadBoard (This is the closest I could find to what I used)
Electrical Tape (Can purchase locally)
The above supplies list is just to get your LED Matrix up and running as well as to have it light up and display what you need it to. How you display your board is entirely up to you. I had a wooden frame/box made where it could be hung up in a desired location.
Micro Screwdriver set
Step 1: Setting Up Power
Setting up your primary power to the LED Matrix board. These steps are pretty simple. For the board that I used, adafruit provides their own instruction on their website. This one is more in depth as there are a variety of ways to adapt the power depending on how your board is set up. The one that I have made things extremely simple as it comes with its own power adapter. However, there are still a few steps to take to make sure you can plug it in.
Terminal Block Adapter
Locate your power cable that should have come with your LED Matrix. It should look like the image provided. You will want to gather your terminal block adapter, wire cutters as well as the appropriately sized screwdriver from the screwdriver kit.
With the power adapter I got with my board, the metal points ended in rings. These will not fit into the block adapter so you will need to use your wire cutters and cut off one side so it will fit inside.
Once you have done this, you will want to take the red cable and slip in the metal part into the block adapter's positive side. Secure the piece by tightening it down with the screw driver. Do this for the black cable on the negative side as well. (See Images for reference) Originally I had used heat shrink tubing to secure the wires and also to protect the exposed metal piece. This did not work in the long run as it was not secure enough. In the end, I wrapped it in electrical tape and it worked much better.
At this point you can go ahead and plug in the power cable to your board. Make sure you follow the arrow and make sure it plugs in correctly. It gives you two attachments (in case you are running two boards) - you will only need one to plug in. Do not plug in your ac/dc adapter until you are completely ready to run your LED board.
Step 2: Step 3: Matrix Connections
Here we will be applying the connections to the LED matrix. Adafruit lists two different ways for you to attach the cables - however I opted for jumper cables as it was easier to access and change out if necessary.
You will want to gather your ribbon cable as well as your male/male jumber wires and your sodderless breadboard. (You will sodder later..for now, this allows you to make sure your board and connections are correct before you try to make things permanent).
Some images were borrowed from adafruit in addition to the pictures I took of my connection.
Lay out your ribbon cable so the red line is at the top. Identify which pin goes where by taking a look at the provided images. The pins must line up with the pins on your board. Either side of your cable can connect into your board so long as the red line is on the top. To make things simple, I plugged mine into the left side.
Step Two: Grounding
We begin by connecting the ground wires. The 32 x 16 board (which is the one being used) requires four ground connections. The Arduino Uno only has three ground pins which is why a breadboard is necessary.
Plug in a jumper wire into the three GND pins as well as the D pin on your cable. The first GND jumper should connect to one of the GND on your arduino. The rest should be plugged into the sodderless breadboard on the negative side. Plug in another jumper to a GND pin on your arduino and then plug it into the positive side of your breadboard in the same line as the others. (The image I provided comes from adafruit. There is also an image of my own connection).
Step Three: Upper RGB
Things start to get a little tricky. It may be easier for you to color code your jumpers - however if it isn't possible, make sure you pay attention where everything goes.You will be running the jumper wires from your cable to your arduino. You will need to use jumper wires to pin R1 to Digital Pin 2, G1 to Digital Pin 3, and B1 to digital pin 4. The digital pins are on the right side of the arduino uno.
Step Four: Lower RGB Data
Using jumper wires, make sure to pin R2 to Digital Pin 5, G2 to Digital Pin 6, and B2 to Digital Pin 7.
Step Five: Row Select Lines
Here, we move to the other side of the arduino for the analog pins. Using jumper wires, make sure to pin A to A0 (Analog), B to A1, and C to A2.
Step Six: LA, CLK and OE Wire
Using jumper wires, run it from LAT to pin A3 for your LAT. Then, connect a jumper wire to your CLK to pin 8. For your OE Wire, run a jumper from the OE to pin 9 on your arduino.
Your connection should look similar to what the images above display.
Step 3: Step 3: Testing Your LED Matrix
With everything plugged in, it is now time to run a test on your matrix and arduino to make sure you have everything set up properly. You will need to install arduino onto your computer if you haven't already. This link will lead you to the download on the arduino website.
You will also need to install several things from the adafruit website. One of the example codes will be the base code for our project.
This step is extremely easy. All you need to do now is plug in your arduino into your computer using the USB connection. (make sure none of your jumper cables come out).
Load up your arduino program and go to File > Examples > RGB Matrix Panel > Plasma_16_32 . This should load up a length of code. Go ahead and click on the check-mark to make sure the code is correct. You will need to make sure you have the correct port selected by going to Tools Port > And selecting whichever port pops up with your arduino. Also make sure Board:"Arduino/Genuino Uno" is selected.
Now, click the arrow that says "Upload". If your LED matrix is set up correctly, it should turn on and display whichever example you chose. (Note: To run this test you do not have to plug in your AC adapter yet.)
If your connections are correct and everything turns on properly, we can now move on to the next step.
If for some reason your connection is not correct and you have checked the instructions, you can try to go to the adafruit learn to double check their instructions.
If everything is correct, please proceed forward!
A video is provided of when I first got my matrix working!
Step 4: Step 4: Setting Up Your Temperature Sensor
Before continuing, please make sure to unplug your arduino from your computer so there is no power running to your LED matrix.
For this step you will need your arduino board, your sensor, a few jumper cables and the arduino program.
There is another program you may get but it is optional and not necessary for this project - however it is a good tool to check and make sure your sensor is giving off readings. The program you can install is called Processing.
Okay, so now we begin wiring. Make sure you have the wires connected in the CORRECT spot. Otherwise, when you plug in your sensor you will burn it out. It will actually overheat and you will feel it burning into the breadboard.(I learned this lesson already).
Okay, so follow the images provided both by me and the ones I posted from the reference blog. Some notes have been made on the image itself to explain what needed to be done.
If for some reason this does not work, you may go to the reference blog. Keep in mind, you will still need to modify the connections to work in conjunction with the matrix hook-up.
Step 5: Step 5: Combining the Code
Okay, with this hooked up, you will want to go ahead and connect your arduino back to your computer. Immediately make sure you are checking to make sure the temp sensor is not over-heating by placing your finger over it. If it is not burning or heating up, then you are good. If, however, it starts to heat up rapidly immediately unplug your arduino and check your connections.
From this point you will need to start up your arduino program. (It is okay if your LED matrix is currently running, it will turn off temporarily when you change the code).
When your arduino program is up, you will want to go ahead and upload this text:
(These codes were found on this blog)
Go ahead and compile by clicking the check-mark and then uploading it to your arduino. The LED matrix should shut off at this point.
After you have done this, load up the Processing Program and paste in this code:
Make sure the arduino program is closed. You can go ahead and 'play' the code through processing. If your connections are correct, a graph should pop up.
Go back to previous steps if there are any issues. Otherwise, we now move on to the final sets of code as well as soddering!
Step 6: Step 6: Final Code
So, the base code that I used was the RGB Matrix Library ScrollText example. It was modified by adding in the temperature sensor code and making sure the TempPin was A5. After this, several more bits of code were added with the help of my instructor as well as the amazing people from adafruit on their form. There were several hiccups we encountered along the way - such as getting the display to show. After turning off the debuff we had it showing however the temperature was reading way too fast. Several more lines of coding were added - but then the text was scrolling too fast. Finally, we added in a delay and we have it running properly.
For this portion, you still do not need to plug in your AC adapter. Your display will appear glitchy at first because it is not being run on full power..that is okay, because we want to make sure the code runs in conjunction with your set-up before we continue to the final step of soddering your breadboard.
I will be posting a link to the codes used as well as the final code for you to compare and see what was changed and/or added.
Final Code <- This is the final code you will want to upload for this project to work.
After you compile it (clicking the checkmark), go ahead and upload. Your LED matrix board should now present to you a reading of the temperature! However, this code will be modified later once the proper conversion/decimal is fixed.
Step 7: Step 7: Soddering
Now that everything is working (as it should be), now it is time to make your circuits/connections more stable - specifically the few connections on the breadboard.
You will need your soddering iron and sodder, as well as a sponge (to clean-up, etc). If you are unfamiliar with soddering, there are many tutorials on youtube you should check out. You will also need your permanent breadboard.
To get started, look back to your breadboard on how you have everything connected. You will be essentially transferring this over to your circuit board. (A friend of mine helped me with this portion I was not quite sure how to do this, she made it really simple as she explained it). You will need one of those strip ports to house your temp sensor in case it burns out..it can be easily replaced without having to completely resodder your project. For this, you can trip the port down to the necessary prongs (three for your temp sensor). Go ahead and choose the spot for this (as this is where we begin). You want the metal pins to be sticking out on the side with the copper for this port.
Carefully sodder the pins, making sure you do not have anything crossing or touching. After this, go ahead and choose the next object - we chose the white jumper cable that connects the sensor to the grounding area. Go ahead and follow the same steps - making sure the metal pin is sticking up and connected to the copper rings by soddering it there. Again, make sure it does not cross or touch the port pins. You can always trim off any of the pin after it is secured.
You will follow these steps for the remaining jumpers. Completely following how they are connected on the sodderless and soddering them as you see them on your circuit board. The images above will show you how we completed mine. Once everything is soddered make sure you plug in your temperature sensor into the port in the correct position (base don how you put it on the breadboard). From that point, you can move on from there.
After this, you should go ahead and plug in your arduino and make sure this is working. If for some reason it is not, go back a few steps and double check everything. If it all works, you can finish securing your other wires.
I was able to secure the wires on my arduino by merely having a bit of electrical tape around them (make sure none of them are touching or crossed). I also taped the cable as well just to make sure it was all secure.
Now, your final step.
Step 8: Step 8: Final Step/Plug-in!
Now, with everything plugged in properly - you may go ahead and attack your battery clip to your arduino. Go ahead and connect your LED matrix to your AC adapter and plug that in as well. Don't worry - your screen won't turn on until you connect your arduino to the battery. Go ahead and do this. When it is all connected, look at your display! If all is connected appropriately and the code is working, you should have a display telling you that "The current Temperature is ----"...
And with that, you are finished!
You can see the video I uploaded of everything working properly. You will also see the display/case/box that was built for it. How you want to display your LED Matrix is entirely up to you.