Bluetooth Controlled 4X4 Led Matrix Using a SPLat EC1 PLC
1901 Views, 13 Favorites, 0 Comments
Bluetooth Controlled 4X4 Led Matrix Using a SPLat EC1 PLC
Parts:
soldering iron and solder
drill bits
drill
small piece of wood
A computer running SPLat/PC, the free SPLat programming environment (IDE)
solid strand wire
Female header wires
1 EC1 SPLat PLC
JY-MCU Bluetooth Wireless Serial Port Module for Arduino
16 LEDs of your choice (I used recycled 5mm leds from various things and therefore they were all different, I suggest using all the same kind of LED)
8 NPN transistors (I used the 2n4401)
4 PNP transistors (I used the 2n3906)
12 1k ohm resistors
The Schematic
Make the Matrix
Grab a small piece of wood (I used a 2x4) and mark a 4 by 4 grid the size of the matrix you want
Now using the appropriate size drill bit for your leds (5mm or 3mm) drill a hole at each intersection on the graph
Then begin placing one LED in each hole making sure the positive leads are in the same direction
Solder the LEDs
Now lets begin soldering a wire horizontally connecting the positive leads in each row (I removed the other leds for convenience)
Do this for all four rows then place them all back in the form
Solder the LEDs (cont)
Begin soldering the negative leads vertically making sure not to connect the positive by accident.
Do this for all four columns.
Solder the Transistors
Now we can take our led matrix out of its form to solder the transistors that will trigger the rows.
Begin by soldering the emitter of a PNP transistor to the Positive row
Now add a 1k resistor to its base
And aditionally add an NPN transistor, soldering its emitter to the 1k resistor and soldering another resistor (1K) to its base as well.
Repeat this for all four rows
Solder the Transistors (cont)
Now solder a wire connecting all the PNP collectors together and another for the NPNs.
Now solde the remaining NPN transistors to the negative rows in the same way but this time we only need one transistor per row
Again solder all the collectors together and this time connect both the row and column NPN transistor collectors together to form a common ground.
Now solder one female header wire to each stray resistor and one to the PNP collectors and one to the NPN collectors.
Connect It to the EC1
Connect the rows and column triggers in order to pins 6-13 on the EC1 then connect the PNP collectors to the 3.3v pin and the NPN collectors to the 0v pin
Now connect the Bluetooth module as shown, making sure to connect the pins in the correct order because the BT module and the EC1 do not line up correctly.
Finally plug it into your PC and open the SPLat programming software
To test your connections before we program you can simply connect to the EC1 and turn on outputs 2-10 and make sure all the LEDs turn on then pay attention to the rows as you turn off the outputs
Begin Programming
I am going to start with a simple program to chase an led around the matrix and then one to show a more complex pastern such as the letter D but first lets start with the LED chase
We can start at any LED but I am going to start with a corner, you can find the program in the picture above.
This program will make one led turn on at a time but make the illusion that it is going around the outside of the matrix in a continuous circle (or square)
More Complex Programming
for more than one LED, depending on its placement you will need to alternate what one is on.
we can do this by turning them on and off very fast to make it seem as though they are both on.
This is a simple program to show two LEDs not in the same row or column on at the same time:
start
on 2
on 6
off 2
off 6
on 5
on 9
off 5
off 9
goto start
This will turn on opposite corners without turning on the other two corners.
Now the letter D, this is shown in the image above, we need to group them in rows or columns so i will croup them as shown above.
Add the Bluetooth Program
Once you have written a few programs you want to display you can add them to the Bluetooth program so that you can control them from your smartphone
Simply add a button that will trigger a program as shown above OR download the program attatched "BT chase program"
Have fun and enjoy!