Workshop Safety Switch With RFID
by taste_the_code in Workshop > Tools
2628 Views, 15 Favorites, 0 Comments
Workshop Safety Switch With RFID
My workshop is in the basement of my house where it exists in the backyard, so very often, my kids stroll through it. Since I'm not always there to monitor what they do, I was worried that they might play with some of the power tools and injure themselves so I decide to make a safety switch that will turn off all of the power outlets in the workshop so even if tools are left plugged in, none of them will be able to be turned on.
This switch should be relatively difficult for them to turn on, but at the same time it should be easy for me to turn it on and as an added safety measure, it should be able to turn itself off after a set period of time.
To achieve all this, I've used an Arduino Nano, an RFID module from Reyax, a relay, and a contactor to make a switch that is turned on by an RFID card or by my phone and turns itself off after a set timeout.
This Instructable is sponsored by my friends at PCBWay that provide all the PCB prototypes for my projects.
Working with AC mains voltage can be dangerous so only proceed with making this project if you know what you are doing and at your own risk.
Supplies
- Arduino Nano: https://s.click.aliexpress.com/e/_DCQ73YF
- Reyax RYRR10S: https://www.techdesign.com/market/reyax/product-detail/ryx000040/ryrr10s?packing=Unit&tab=description
- https://www.amazon.com/REYAX-RYRR10S-Multiprotocol-Integrated-13-56MHz/dp/B09GVRVVVL
- 5V Relay Module: https://s.click.aliexpress.com/e/_Dk8zxsx
- Prototype PCBs: https://s.click.aliexpress.com/e/_DesjDFv
- High power contactor: https://s.click.aliexpress.com/e/_DlPvQAF
- Buzzer: https://s.click.aliexpress.com/e/_DktegUr
- Resistors: https://s.click.aliexpress.com/e/_DmPUNMT
- Jumper wires: https://s.click.aliexpress.com/e/_DFJeB6B
- Mini breadboards: https://s.click.aliexpress.com/e/_DlRVour
- Soldering station: https://s.click.aliexpress.com/e/_DDokURN
- Multimeter: https://s.click.aliexpress.com/e/_DdicqcP
The RFID Module
The star of the project is this Reyax RYRR10S RFID & NFC Module that was kindly provided to me by Reyax.
This is a multiprotocol antenna module that can basically work with any card type and it is very easy to be integrated into projects with the corresponding lite module. The module is powered by the ST CR95HF chip and it can be interfaced with any microcontroller either by UART or SPI interfaces.
For this project, we will connect it with Arduino Nano via serial and we will use it to recognize the approved cards that activate the switch.
Designing the Prototype Circuit
To test out the idea and to make sure that everything will work as expected I first connected the circuit on mini breadboards where one of the breadboards housed the Arduino Nano and the other one had the buzzer and the RFID reader module.
The RFID is connected with RX to pin 3 of the Arduino and TX to pin 2 of the Arduino Nano. The relay module is configured to be triggered HIGH and its control pin is connected to Arduino pin 6. The buzzer is connected with a 100 Ohm resistor to pin 9.
The RFID module is powered with 5V from the regulated output of the Nano, but I've connected the relay module directly to Vin as it can draw more current when the relay is triggered, so this way, that current will not have to pass through the regulator on the Nano.
The Arduino Code
The code for the safety switch can be downloaded from its GitHub repository.
In general, the code is separated into several sections: initialization, card detection, card reading, and actions.
During initialization, we first define the required inputs and outputs for the modules and we send a specific set of commands to the RFID module so it is ready to read and recognize cards.
Next, we need to constantly tell the module to look for a card that is placed nearby and if found, we instruct it to read the ID of that card. IF the ID is from a known card, we then proceed to the actions part of the code where we either turn on the switch and contactor or we turn it off depending on the conditions.
Transfer the Circuit to a PCB
With everything ready, it was now time to make everything a little more permanent so I used a prototyping PCB to add a holder for the Arduino Nano and solder the buzzer as well as the wires going to the modules.
While building the circuit, I basically was transferring the breadboard circuit one element at a time and connecting it the same way, but this time with solder.
Solder Connectors for the Modules
Since I wanted to have the RFID and relay modules to be removable, I made connectors for them from female header pins that I cut to the required length.
The wires are directly soldered to the headers and I've then added a bit of hot glue to the solder joints so they have a bit more strength.
Since the relay module originally had a jumper to select how it is triggered, on its connector, I used the wire to make that connection.
Place Components Inside the Enclosure
The enclosure for the project is an electrical box where I first mounted the contactor to it and I then mounted the Nano and the relay module with hot glue.
While still at the bench, I did the final wiring of the incoming and outgoing cables as well as the power cable for the contactor coil that is triggered by the relay.
The contactor is really important here as there will be a lot of current that will pass through it and the regular relay won't be able to withstand that. The contactor I used is rated for up to 4kW per phase and since all of the outlets in my workshop are divided on different phases, this should be more than enough.
Mount the Enclosure to the Wall
When the electrical box was ready and wired up, I choose a suitable position for it next to the breakers box in my basement and mounted it to the wall with screws.
Once mounted I used some hot glue to secure the 5v power supply for the Arduino and I also secured the RFID sensor to the lid of the box.
Attach the Switch to Existing Wiring
Since we will be dealing with AC mains wiring here, before touching any of the wires make sure that you turn off the power to them from the breakers. I have a set of breakers in the junction box as well as another set of breakers on the incoming line that I turned off before modifying the wiring.
Again, before touching any of the wires, I've used a test light to make sure that there is no power on the wires!
Being 100% sure that it is now safe to work in the box, I removed the wires exiting the breakers and replaced them with the input cable from the safety switch.
I then connected the output of the safety switch to the cable that distributes the power to the workshop with wire terminals.
Since I want the lighting to be independent of the switch, it stayed connected as before to the output of one of the breakers.
How the Switch Is Used
The positioning of the switch makes it perfect for when I'm coming into the workshop from the house. The switch is right next to the door so once I go in, I can swipe the card or my phone to the box, on the position marked with the sticker and the switch turns on and I can start working.
I have set the current run time to two hours as I rearly have the time to work longer than that. On exit, I can again touch the phone or the card to the box, and that will turn the contactor off, but even if I forget to do so, the switch will turn off automatically after the set timeout of two hours elapses.
If I'm still in the workshop, during the last 30 seconds of the timeout, the buzzer will beep and during this period I can trigger the switch with the card/phone to extend this timeout with additional two hours of run time.
This way if I need to work longer, I can still do that.
As an additional safety measure, if the switch is on, swiping an unknown card will immediately turn off the switch and in an event of a power loss, the switch always starts with being turned off.
Next Steps
I'm very pleased with the end result and I can now stop worrying about leaving a tool out in the workshop.
In the future, I plan to possibly upgrade the switch with WiFi so it can be connected to a home automation system that I plan to build, and if that sounds interesting to you, then be sure to subscribe to my YouTube channel.
In the meantime, you can check my other Instructables and for any questions, you can comment below.
Thanks for reading!