# How to setup a rfid reader to switch a relay to constant on

#### Oneofmany78

Joined Oct 6, 2018
4
Hello, complete novice here. I am a custom home builder by trade. We leave our tools at the job sites from time to time. I am constantly finding that my power tools are being used while I am on other sites or on errands. I had a thought that since I have a nfc ring, maybe I could hook up a reader (internally) that would allow me to use my tools as long as the ring is present. I have dug through the internet & can find a way to trigger a switch on or off. But I believe the constant presence of the ring would cause problems. Is there a way to setup a pn532 v3 to switch a relay to on only while the ring is present?

#### Electric Rhino

Joined Oct 8, 2018
7
On a very brief look at the website (which you should link to help us give answers), that pn532 v3 looks like just a reader chip. you'll need something to process that data coming in from the NFC bit and flip a relay. Circuit is totally doable, find any microcontroller you like and write a bit of code to read the data (supplied in i2c or spi) by that pn532, and then write out a logic 1 to a driver transistor that will drive the relay.

With that said, as a complete novice, this will be a difficult project to tackle, especially getting the form factor down enough to fit into whatever power tool you have (what is it?). Perhaps when I have more time, i'll make a video about something like this.

#### KeepItSimpleStupid

Joined Mar 4, 2014
3,635
Two other ideas:

RFID NFC needs to be too close to work. Although, I see what you want to so. Swipe a card over the tool. With RFID, the tool just needs to be close by. Sort of like the new start/stop button on a car and the keyfob in your pocket.

The bigger problem is placing the extra circuit in the tool and having a space for the antenna.

RGID can be passive or active (EZPASS).

Put a box on the power cord that has a keyswitch and use tamperproof screws or one way ones. Hopefully, they won't cut the cord or open the box. Downfall-- takes up more room in the tool box.

Outfit the tool with a non-standard CPC connector. That connector to a 120 v plug is the key, you take with you, Maybe, something like: https://www.digikey.com/product-detail/en/te-connectivity-amp-connectors/206037-2/A1685-ND/241465

These connectors are "hard to order" because you have to order all of the pieces separately. Contacts, shells, seals etc. It also requires a crimping tool. There are cheaper tools than recommended. I think $40-$60 price range.

I'm NOT SURE if there is a sealed version of the connectors. Sometimes, you might use them in a wet/damp environment? There is seal for the mating surfaces. You could seal the other side with electrical grade silicone (no citric acid no non-corrosive)

So, you make a pigtail with a 120V plug on one end and these (the female contact version) on the other. Put the male contact version on the tool side. That pigtail is your "key", make up a few (tools used at once), hide one if possible and have some spares at home.

Outfit the tool with a non-standard CPC connector. That connector to a 120 v plug is the key, you take with you,

A note about connectors. MOST of the time, the connector is defined by the pin and in general they can be classified as "reverse-sex" e.g. male pin and female housing. Same sex connectors have a male pin and male housing.

With a pin removal tool, the pins are easy to remove. They also mate nicely.

Metal, military connectors might be sealable.

==

This https://www.sparkfun.com/products/13198 RFID partial development system probably won;t read far away stuff.

With nearly anything internal, you need to stuff a low voltage power supply there too.

Kinda odd that manufactures don't offer a key-lock for expensive power tools. EZ-oass does use a battery. Also see: https://www.atlasrfidstore.com/

The problem is the reader is expensive and your trying to place it inside the tool not the other way around.

I wonder if Zigbee could work? The idea is to have a transmitter that sends a "packet" every so often to keep the tool running. Turn off the xmitter and the tools won't work. The tools could use internal power as needed, but the xmitter would have to powered all of the time. You could make the tool work for 1 minute and then quit if out of range.

#### Oneofmany78

Joined Oct 6, 2018
4
Thanks for the input. Most of my tools are cordless now. I leave my corded in my van unless there are some really heavy workloads. Still think the nfc ring will do it. Found some pretty small microcontroller boards. Buino beetle is only .5" square. Now I was thinking that due to the lack of constant power, I could use an accelerometer with a watch battery power source to wake up the rfid reader every time the tool moves for a specified time. I was thinking the reader, the controller & the relay could utilize the tool's battery. Do these readers or controllers loose their programing when power is gone? Is the hardware configuration doable? The coding is a whole other mountain to get over. Probably going to have to pour over the internet for lines of code that may or may not work. May have to try this in a simulator/emulator.

#### KeepItSimpleStupid

Joined Mar 4, 2014
3,635
Do these readers or controllers loose their programing when power is gone? Is the hardware configuration doable?
Microcontrollers generally don't or they may have a long life measured in 10's of years. Vintage instruments have been known to loose their programming after 30-40 years.

Another thought is Bluetooth LE (Low Energy). Not sure how it might work.

Easy to use boards like Arduino I don't think really have the ability to go into "deep sleep"

#### Oneofmany78

Joined Oct 6, 2018
4
Microcontrollers generally don't or they may have a long life measured in 10's of years. Vintage instruments have been known to loose their programming after 30-40 years.

Another thought is Bluetooth LE (Low Energy). Not sure how it might work.

Easy to use boards like Arduino I don't think really have the ability to go into "deep sleep"
Microcontrollers generally don't or they may have a long life measured in 10's of years. Vintage instruments have been known to loose their programming after 30-40 years.

Another thought is Bluetooth LE (Low Energy). Not sure how it might work.

Easy to use boards like Arduino I don't think really have the ability to go into "deep sleep"
The only problem with the ble setup is the range. With the multiple devices running on any given site I wonder what the lag would be due to interference. The other issue with range would be my ble device would attempt to link from around 30'. Trying to keep the proximity to around 3 to 6 inches. Now the sleep mode is another hurtle. So far as I can tell, no readily available devices are capable of entering a sleep mode. I will have to keep rolling this around. Once I solve my hardware problems then on the the hard part (for me anyways),the coding.

#### KeepItSimpleStupid

Joined Mar 4, 2014
3,635
BT LE might work a little differently and probably not desireable. It might work as a Lock/unlock signal. I think BT LE is a mesh network.

The MSP430 can do deep sleep. I think ARM can to, just not in the Arduino world.