go_away

Author Topic: new to programming a RFID rig  (Read 617 times)

0 Members and 1 Guest are viewing this topic.

Offline absolute_n00bTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
new to programming a RFID rig
« on: July 18, 2013, 10:07:59 AM »
Hi all,

I am looking to build an RFID device to keep one of my cats away from my other two cat's food bowls. The way I am envisioning this thing to work is it will sense the RFID tag on him when he gets within range of the antenna (which is by the food). Once in range I want it to blast a shot of compressed air to scare him off (he's a real scaredy-cat so it'll do it easily). The problem I have is I don't know how to computer code (I can code for statistical and mathematical modeling, but that's all I know), and I'm not 100% sure of all the components and setup I will need. I have a rough idea in mind that basically will have a solenoid push the trigger on the compressed air, and release immediately. It will repeat the blast consecutively until he is no longer in range of the food bowl.

So for all you experienced people out there, how should I approach this? Thank you in advance for any and all assistance you can provide.

Offline absolute_n00bTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: new to programming a RFID rig
« Reply #1 on: July 18, 2013, 10:51:53 AM »
One idea I just had was to use a sprung push solenoid to activate the trigger, then just have the power removed from it so it returns to its previous position. This way it will just have to have power applied to it again in order for it to fire consecutively. Still dont know how I would code this up, but I think it is a more simple and elegant solution.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: new to programming a RFID rig
« Reply #2 on: July 18, 2013, 11:40:47 AM »
You would need an RFID reader with a sufficient reading distance -- go for 10 inches to make it robust. The cheak 125 kHz ones will not do it. Maybe the 13 MHz ones will.
The RFID readers typically output serial data on a pin. You can hook that serial pin to the serial input of a microcontroller, such as the Arduino Leonardo. Write code for that microcontroller to recognize data coming in on the serial port.
The code would just activate an output pin, wait for an amount of time, and then deactivate the pin.
The pin, in turn, would drive some kind of controller that knows how to activate the scaring-device. You can't drive it directly from the pin, because digital pins on microcontrollers cannot deliver strong enough current.

So, approximately, you'd need something like:
1) a 12V 2A DC power supply of some sort (wall wart)
2) an Arduino Leonardo. You don't want the Uno, because its serial port is already used for programming it, so it would "fight" with the RFID reader
3) a RFID reader with suitable range, and a tag for it
4) an H-bridge or relay to drive the solenoid. Something like a Pololu 8835 motor driver would likely be sufficient
5) an actual solenoid (or air pump, or whatever) with current draw and voltage to match the driver. Or select this part first, and select a driver to match.

The Arduino is very easy to program. There are lots of tutorials on the http://arduino.cc/ website. You'd want to read the RFID serial input, and use the digitalWrite() function to turn on the output, call delay() to delay for a little while, and then digitalWrite() again to turn off the output.

Offline absolute_n00bTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: new to programming a RFID rig
« Reply #3 on: July 18, 2013, 12:02:48 PM »
Thank you for your awesome reply!

I found this between the time of my last post, and your response (http://www.instructables.com/id/Controlling-solenoids-with-arduino/?ALLSTEPS). Would this be similar to what you mentioned? It does not have the RFID portion of it though, but from what you are saying I can have the signal from the reader activate the Arduino and go from there. Am I on the right track here?

EDIT:
I read up on what an H-bridge actually does, and I'm not sure that will be a required item for a single direction (Push) solenoid with a spring. Once the power has been removed from the solenoid the spring will return it to its original position. Then restoring the power will have it hit the trigger again. Am I correct so far?
« Last Edit: July 18, 2013, 01:09:07 PM by absolute_n00b »

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: new to programming a RFID rig
« Reply #4 on: July 18, 2013, 02:58:15 PM »
Quote
I'm not sure that will be a required item for a single direction (Push) solenoid with a spring.

That is correct. The reason I mentioned it was that it's actually easier and more robust to find a motor driving H-bridge, than to find/build a solenoid-specific one-direction only circuit. Or, as I also suggested, you could simply use a relay as the on/off switch; there are simple relay boards that easily plug into an Arduino.

 


Get Your Ad Here