Step 1: Parts list
- Arduino Duemilanove
-5V radio reader module (SEEED Studio 125kHz UART or equivalent product. Most readers have small antennas. To use the custom antennas discussed here, you need a reader that allows access to external antennas)
-Rf tag (I use these 35mm disc-shaped labels)
- about 86 feet of No. 24 electromagnetic line (length than the photo)
- Sharp GP2D12 infrared proximity sensor
- Two 12V electronic cabinet locks (Novo News). Basically, a solenoid valve. - a 12V DC power supply
- Two TIP120 Dalin Transistors
- a Hall effect sensor
- A Hall effect sensor is activated in a range of approximately 2 cm in the range of approximately 2 cm
- A 100 ohm resistor
- Four 2 kohm resistors
- Two buttons
- a LED
- A hinge (for the sake of precision, a hinge is easy to move but not too many lateral movements)
"- a 6" x 9 "block 1/8" thick organic glass, perhaps another block of about 6 "x 3" for installation lock
- Wiring, including approximate 27 "special line (26 AWG or thinner)
- Nuts, bolts and serrated gaskets
- Rubber isolation bar or other soft material for filling the edge of the door and the door post
The system includes a plurality of "modules" (solenoid valves, RF readers, etc.)). One of the images here shows the basic plan of connecting modules to Arduino (electronic devices). In the next step, mechanical parts and each module will be discussed in detail.
Step 2: Produce the door
The door is hanging on the organic glass flap on the hinge. At the bottom of the door post, there will be two solenoids, each having one of the flaps to prevent unauthorized animals from entering. This is very simple. Remember the following points:
Make sure that in a stationary state, the baffle is in the center position between the two solenoids. In the picture, in the middle of the dashed line. To this end, it can make the side without weight and use a hinge that is very friction.
It allows the horizontal movement of the hinge (moving laterally in the plane of the wall). This will help the Hall effect sensor (electromagnetic switch) work. I will discuss this in the steps. .
The door needs to be strong but the weight is light, so that it will be easily pushed open and will not be injured when clamping the tail.
Step 3: Produce antenna
The antenna is just the electromagnetic coil connected to the radio frequency reader. Most RF readers have an antenna, but some readers allow external antennas. In this project, I wrapped around the 24th of the sawing bucket around the sawing bucket, so that it was strong and made into 10 x 10 inches of square antennas. The distance between the turns must be as small as possible. I use two wood as a spacer to fix things on the plywood, so that it is slightly separated from the wall so that the cat can activate it farther away from the wall. The 35mm CD tab I use can be read to the coil plane 4 inches. RF readers and antennas are powered by ARDUINO's 5V. Even if Arduino is working properly using a USB cable, the RF reader can still work more when Arduino is inserted with a 9V power adapter into the wall.
Step 4: Connect the RF reader
The project is made from multiple "you need to connect to Arduino and test the module in advance. You can connect the RF reader. You can use the ARDUINO's 5V output to power it, and use the digital port (I use 2) to get the signal. I use The RDM630 also has the LED pin I don't use. It also has a RX pin, which is used to send information back to the RF reader, but I don't use it. Connect the antenna, get the label, then use Arduino's serial monitoring View whether it is detected. Now, you can also try to improve the antenna by adding or decreasing the number of turns, trying different shapes, etc., using a 9V power supply (not only USB) to power the ADRUINO, at least in my opinion, this is Uncontunnation. You can download a file named "RFID3.PDE" to test. This code requires newsoftserial.h.
Step 5: Add a solenoid valve
As shown, the solenoid valve is connected to Arduino: connect TIP 1220 to digital ports 5 and 6, and 2K resistors are used between the two. A pin ground, another pin connection solenoid, the diode across a diode (ensuring the polarity correct), and finally connects the 12V power supply. Another wire of the power supply ground. Connect it to other places. Simply connect all grounds of all components including Arduino.
Step 6: Add Hall Effect Sensor
The Hall effect sensor is used to detect whether the door is in the range of closing the door lock. There are other solutions, such as mechanical / optical rotary encoders, contact sensors, beam interrupt sensors. The main reason for choosing the Hall effect sensor is that it does not increase the friction, which can completely cover it, and I am also very curious about their way.
I don't want to put magnets on the door, because it will be more important, so I put the switch on the door, and the magnet is placed in the door. I have to use fine, very soft wire, otherwise its rigidity will deviate from the center. Sensor and wires only need to take tape to the organic glass. I have two small magnets on the door post. At the closest position, the distance between the sensor and the magnet is 5 mm. The range is approximately 3 cm.
Connect the signal pin of the Hall sensor to the pin 4 and connect to 5V through 100 ohm resistors. Connect the ground pin to other ground and connect the VCC pin to 5V. Add an LED to the digital pin 7 using the appropriate resistor (using a 220 ohm resistor in the green resistor).
Download Hall_Effect.pde to test this part of the system.
Step 7: Add proximity sensor
For this system, I only care about the entry of the cat, and any creature may exit. Therefore, I only need to use RFID on one side. The door should be open to any animal close to the other side. The IR approaches the sensor works fine.
Connect the output pin of the SHARP GP2D12 to the analog port 0, connect the ground pin to other ground, connect the VCC pin to 5V.
Download IR_TEST_ANALOG.PDE to test this part of the system
Step 8: Add two buttons and load the final code
Finally, you can add buttons to manually open the lock (see schematic). .
In the final code you can download here, I store the value of the two labels wearing the animal, one with access, and another no access. When an animal that cannot be entered attempts to enter, the door is immediately locked.
Byte Goodcode [6] = {0x1c, 0,0xFc, 0xB2, 0x90};
BYTE BADCODE [6] = {0x16, 0, 0x78, 0xE7, 0xFE};
You must find the code of the label you are using and put these values in the array "Goodcode" and "Badcode". The value is a hexadecimal, in this programming language, it needs to be "0x".
If you don't want to mark another cat, shorten the open time (the value of the "Open_Time" is smaller) can help this to respond faster to the burden of the cat.
Placing a housing around the electronic device is a good idea, but this guide will not be discussed.
Last point, if your antenna has a large range to the safe area, you may need to calibrate the antenna and the location of the sensor to ensure that RFReader is not activated from the interior. If the cat is in it and wants to go out, approaching the sensor must first detect the cat. Once this happens, it is possible because the RF reader is not checked in this section of the program.
Our other product: