Arduino Safety Relay Box With Wall Socket

Introduction: Arduino Safety Relay Box With Wall Socket

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate the switch and provide electrical isolation between two circuits. In this project there is no real need to isolate one circuit from the other, but we will use an Arduino UNO to control the relay. (read more @ Wiki)

One side of relay will be connected with high voltage (home) circuit, that means risk of electrocution! In this project we will develop a simple wood box to ensure that risk of electrocution will not be a problem any more. With this box it will be totally safe to start playing with the Arduino uno and Relay module.

So, let's get started!

Step 1: What You Will Need

To build this Safety Box you will need:

  • Arduino uno
  • One channel Relay Module
  • AC to DC 12V converter
  • Wall socket
  • High voltage cable ~50cm
  • Βipolar plug
  • Clamp
  • Balsa wood sheet 5x100x1000cm

About relay module:

We will need a 5V 1-Channel Relay interface board - 15~20mA Driver Current, equiped with high-current relay, AC 250V 10A / DC30V 10A.

(see images above)

Step 2: The Circuit

Please check your connections at least once! DO NOT plug circuit to wall socket yet!

Tip! You can also use a schuko socket and plug for more protection, just connect ground cable (protective earth pin) between them.

You can watch the video below, but it's in Greek language. Soon will be available with English subtitles.

Step 3: The Box

To build the box you will need to cut balsa sheet (or other wood) as:

  • 2pcs 15x10cm for top and botton
  • 4pcs 5x15cm for all around sides

These are mine box dimensions. You must change them if it's necessary to fit yours AC to DC adapter.

On top side you must open one big hole that will fit wall socket and two small holes for arduino cables, see above images.

You can merge sides with glue (you can also use glue for 'in-box' stuff). Use adhesive tape to attach arduino uno on top of box.

Step 4: Testing...

Take one desk lamp and plug it on box-socket.

Attach usb cable to Arduino uno and run the following program.

Now you can power on your box, just put box-plug to wall socket.

You will see your lamp to blink every 3 seconds.

Step 5: Well Done!

That's it! Now you have your own Arduino Safety Relay Box ready for our next cool projects!

Make sure to click Follow button ;)

I hope you liked this, let me know in the comments.

1 Person Made This Project!


  • Electronics Contest

    Electronics Contest
  • Woodworking Contest

    Woodworking Contest
  • Trash to Treasure Contest

    Trash to Treasure Contest



6 years ago

Nice project!
But i have some questions..

  • you tell us to get a AC to DC 12V converter, but in your lay out you use a 9V 1A adapter, wicht one do you want me to use?
  • I also saw that you made one with a HC-SR04-Ultrasonic-Sensor but i cant find the sketch of the breadboard and arduino, do you have one?

    I hope you can help to awnser my questions, i can use this for a school project! Thanks


6 years ago

Hi, great project!

I'm portuguese with a lot of english knowledge but my electronics vocabulary is "in development". Can you tell me what's a clamp?


6 years ago on Introduction

hey, first of all nice instruction. But if you are talking about a Safety Relay Box, please install the required electric safety parts. Change the power Plug to an Schuko power conector, with the required protective earth pin and conect it with the wall socket. This way all electric safety mechanism could work correct.


Reply 6 years ago on Introduction

Hi! Thank you for your comment!

You are correct, you can also do it with schuko power conector and connect one more cable for ground (protective earth pin). But this is not necesery because the AC devices that we can control with this project are 'low power' devices for example a desk lamp. Desk lamp usualy has a bypolar plug conector.

Remember that you can only turn on or off something... for example if you connect a TV you can only "cut" the power with this and turn it off... but, you can't turn it on ;)

I will make a comment to step 3 about schuko socket. ;)


Reply 6 years ago on Introduction

Thank you for mention this in your instruction.

Keep in mind that an earth fault is only limited by your short circuit protection which is normally an fuse with an B16 characteristic. This means you could have an earth fault or short circuit with >80A, which has nothing to do with the power of the device connected. The connection of the protective earth is required to guaranteed the safety requirements, you do not know what device a user of your instruction will connect to it. It’s nothing big but brings a lot more safety to you solution, trust me I’m an electrical engineer :D