In this project i will show how to build remote controlled Spike Buster or Switch Board using Standalone Atmega328P. This project is built on a Custom PCB board with very few components. If you prefer watching video then i have embedded the same or if you like reading please continue with the post.
Step 1: Components & Materials Used
For this project we require components like
- 16MHz Crystal
- 2*22pF Capacitor
- 10K Ohm Resistor
- 4*1K Resistor
- 4*5 Volt Relay
- Custom PCB Board (Gerber files will be shared in the post) or any perf board
- Enclosure with Female Plug
If you want to purchase online here are few affiliated links which you can try
- Atmega328P-PU - https://amzn.to/2E79Hs0
- 16MHz Crystal - https://amzn.to/2KZzofA
- 4*5 Volt Relay - https://amzn.to/2E302D3
- Tsop1738 - https://amzn.to/2PpiKXo
- UL2003A - https://amzn.to/2zM5BTa
- Arduino UNO - https://amzn.to/2AWIYLG
- Atmega328P-PU - https://amzn.to/2rlmiR0
- 16MHz Crystal - https://amzn.to/2rpo8jN
- 4*5 Volt Relay - https://amzn.to/2Ei4AWY
- Tsop1738 - https://amzn.to/2QhOp2s
- UL2003A - https://amzn.to/2Ej3RFc
Arduino UNO - https://amzn.to/2Ej7Tgr
- Atmega328P-PU - https://goo.gl/x9CseU
- 16MHz Crystal - https://goo.gl/a2xqwx
- 4*5 Volt Relay - https://goo.gl/9JVAqM
- Arduino UNO - https://goo.gl/uCphcZ
- Atmega328P-PU - http://s.click.aliexpress.com/e/bfttaXZe
- 16MHz Crystal - http://s.click.aliexpress.com/e/c1liuZ7S
- 4*5 Volt Relay - http://s.click.aliexpress.com/e/ccGa793K
- Tsop1738 - http://s.click.aliexpress.com/e/bY2kOXEs
- UL2003A - http://s.click.aliexpress.com/e/cC5N8Xdm
Arduino UNO - http://s.click.aliexpress.com/e/bdrMTOu0
Step 2: Circuit Diagram & Layout Design
This is the entire circuit diagram which i designed on KiCAD. The circuit mainly is around Atmega328P-PU which is the Micro-Controller used in Arduino UNO. Instead of using the entire Arduino UNO, I am using a limited component version of Arduino UNO on a custom PCB Board (For more details on limited component version of Arduino UNO you can read an article shared in the Arduino official website by Clicking Here). This is mainly to reduce the space & the cost. You can also build this project using Arduino Uno & the 4 channel relay board along with remote control module.
The TSOP1738 in the circuit is used as IR Remote Receiver.
To drive the relays i am using ULN2003A IC which is a series of seven NPN Darlington transistors.
After designing the circuit diagram i designed the layout & generated the Gerber & Drill file for Fabrication of the PCB Board. I use JLCPCB for fabrication of my PCB board as they provide very good & well finished PCB's at very low cost. Usually 10 pcs will cost you 2$ & will be shipped within 48 hrs and if you order 5 pcs the PCB will be shipped within 24 hrs. If you want to place the order for the same board you can download my Gerber File by Clicking Here.
Step 3: Installing IR Library & Finding IR Codes
To find the IR Codes first you need to install the IR Library. You can download the library from GitHub . After Downloading install the Library in your Arduino Libraries folder.
Then construct the circuit as shown on a bread board using TSOP1738 & Arduino Uno. After Construing, power the circuit & upload the sketch. Then press the button you want to use on the remote & note down the codes which appear on your Arduino IDE's serial monitor. For this project i am using 4 buttons so you need to make a note of four codes for four different buttons.
I have shared the download link of the sketch in the previous step.
In the video this step starts @ 1:07 or you can click here
Step 4: Final Sketch to Control Relays
Next i uploaded the final sketch to my Standalone Atmega328P-PU. The standalone Atmega328P was constructed on bread board & was programmed using Arduino UNO.
You can download this sketch by clicking the link shared in the step Circuit Diagram & Layout Design.
Before uploading the sketch you need to make a small change. For you, the IR Codes may change so you need to replace the existing codes with your IR Codes in the case statement.
Extra : If your not familiar on how to boot-load or upload a sketch to standalone Atmega328P-PU, i have made a separate in depth video explaining that. You can watch that by clicking here
In the video this step starts around 2:33 or you can click here
Step 5: Board Assembly
After receiving the board from JLCPCB, i mounted all the components accordingly & secured them using solder.
Step 6: Finishing the Project
After the board assembly, i mounted the board on the enclosure & secured it with M3 nuts screws & then connected the board and the female plugs accordingly.
Board & Enclosure Assembly:
- First connect all the neutrals of the female plug together & then connect neutral wire of the main cable to it
- Next connect the Live wire of the Main Cable to the Pin "IN" on the board
- The Pin 1,2,3 & 4 on the board goes to the Live pin of the Female Plug individually
- You also need to connect a DC jack to the Pin 5V and GND on the boar
Once all the connections are done, power the PCB board using 5V 1Amp adapter & connect the Main cable to the AC.
In the video this section starts around 5:42 or you can click here
Testing begins @ 8:03
Thank you for reading guys
You can subscribe to me on YouTube for more contents like this. To Subscribe Please CLICK HERE
Participated in the