Friday, March 8, 2013

RoboDoor

Hello There!


Long time no post, though I had done many things, for a reason or another, I am addicted to RoboThing, I have RoboCar, RoboDoor, RoboGardener. Today I am gonna post about my RoboDoor!


The concept is simple, use an RFID tag to enter the room, an emergency entry should be implemented to prevent locking the door permanently (a UPS will be considered at a later stage)


So I started off with a Solenoid actuator which I got from Sparkfun for 15$, the solenoid is rated for 36v however, it works just fine at 12v.

I decided to use an ATX power supply to provide the 12v and 5v for my system.

I made some measurements and then cut some wood and fixed in the solenoid (Sparkfun 4-40 screws works amazingly)





One important thing here is that I should guarantee that I will not get locked outside my room, so there must be an emergency entry method if the microcontroller or RFID fails


Remember that later on, a UPS will be added at a later stage, so cutting power from the room circuit breaker will not work.

I decided to use a discrete "Discharge Circuit" where-in you hold the door handle for say 20 seconds which would discharge a capacitor and activate a relay contact to open and cut the power from the solenoid.


Drawn using Digi-Key SchemeIt


I added a Micro-switch which would activate when you fully press the door handle, the pot is set to give 5v, the capacitor charges very fast when you release the handle and discharges slowly through the 100Kohm and takes about 20 seconds to activate the output of the comparator which would cut the power from the solenoid.


Yes!! emergency entry works, now, next step is the RFID

I decided to use ID-12 RFID because it is mid-range and suitable for my need, I bought them from Sparkfun as well

I did some testing before adding up the RFID system, luckily, the tag reader can transmit and receive through the door which made things even awesomer :)

I first added a little indicator LED and a key switch



Then, I added the MCU circuit, I used ATmega328


The RFID module is awesome, you only need to connect up +5v, GND and you get the serial data outputed which you can read in your micrcontrollers



The output data is formatted as follows (details in datasheet)

STX,ASCII CODE,CHECK SUM,CR,LF,ETX

STX: Start of Text (0x02)
10 ASCII Char (5 Hex bytes) This is the unique tag ID
2 ASCII Char (1 Hex Byte) Check Sum of tag ID
CR: Carriage Return (0x0D)
LF: Line Feed (0x0A)
ETX: End of Text (0x03)

lookup the ASCII table to know more about STX, CR, LF, ETX

I did not bother about check sum as I really dont know what it is exactly, I just checked for the 12 char matching in my code


Adding a lil circle on the location of the RFID tag reader makes accessing the door easier as you dont have to scan your card through the entire door!




One thing still needed some work, which is the fact that I used a 5 second delay after reading and accepting the tag. After the 5 seconds, the lock will activate even if the door is open, which is bad!
If the solenoid is extended and someone tries to close the door, the solenoid could be damaged.
Therefore, a reed switch and a piece of magnet made things more organised.

The magnet will activate and close the contacts of the reed switch only when the door is closed.





Too many wires! needs some orgnizing


A final test on the system functionality


------------
Update:

I found that the solenoid becomes really hot after some time, therefore, a cooling was required

I used a 12v brushless fan (PC fan), it works great for keeping the solenoid clean


Note: I added a wire mesh for hand protection ;)


Here is the code on GitHub

End of Code



No comments:

Post a Comment