How to Make Remote Controlled Spike Buster or Switch Board Using Standalone Atmega328P

About: For more content please subscribe to my YouTube channel @ https://goo.gl/BHxFf7

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

  1. Atmega328P-PU
  2. 16MHz Crystal
  3. 2*22pF Capacitor
  4. 10K Ohm Resistor
  5. 4*1K Resistor
  6. 4*LED's
  7. 4*5 Volt Relay
  8. Tsop1738
  9. UL2003A
  10. Custom PCB Board (Gerber files will be shared in the post) or any perf board
  11. Enclosure with Female Plug

If you want to purchase online here are few affiliated links which you can try

Amazon IND

  1. Atmega328P-PU - https://amzn.to/2E79Hs0
  2. 16MHz Crystal - https://amzn.to/2KZzofA
  3. 4*5 Volt Relay - https://amzn.to/2E302D3
  4. Tsop1738 - https://amzn.to/2PpiKXo
  5. UL2003A - https://amzn.to/2zM5BTa
  6. Arduino UNO - https://amzn.to/2AWIYLG

Amazon US

  1. Atmega328P-PU - https://amzn.to/2rlmiR0
  2. 16MHz Crystal - https://amzn.to/2rpo8jN
  3. 4*5 Volt Relay - https://amzn.to/2Ei4AWY
  4. Tsop1738 - https://amzn.to/2QhOp2s
  5. UL2003A - https://amzn.to/2Ej3RFc
  6. Arduino UNO - https://amzn.to/2Ej7Tgr

Banggood

  1. Atmega328P-PU - https://goo.gl/x9CseU
  2. 16MHz Crystal - https://goo.gl/a2xqwx
  3. 4*5 Volt Relay - https://goo.gl/9JVAqM
  4. Arduino UNO - https://goo.gl/uCphcZ

AliExpress

  1. Atmega328P-PU - http://s.click.aliexpress.com/e/bfttaXZe
  2. 16MHz Crystal - http://s.click.aliexpress.com/e/c1liuZ7S
  3. 4*5 Volt Relay - http://s.click.aliexpress.com/e/ccGa793K
  4. Tsop1738 - http://s.click.aliexpress.com/e/bY2kOXEs
  5. UL2003A - http://s.click.aliexpress.com/e/cC5N8Xdm
  6. 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:

  1. First connect all the neutrals of the female plug together & then connect neutral wire of the main cable to it
  2. Next connect the Live wire of the Main Cable to the Pin "IN" on the board
  3. The Pin 1,2,3 & 4 on the board goes to the Live pin of the Female Plug individually
  4. 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

PCB Contest

This is an entry in the
PCB Contest

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest

    3 Discussions

    0
    None
    SimonQ5

    3 hours ago

    Wouldn't it make more sense to use an ESP12, and then it could connect to your WIFI and be controllable from your phone etc, as well as using the IR remote?

    0
    None
    DIYTechStudioJeffM15

    Answer 4 days ago

    Yes. that would be very nice if you don't have any AC plug near by for the adapter.
    Even i had a similar kind of idea. My idea was to use a transformer but finally went with adapter since had a spare one..