Step 5Add proximity sensor
Code for testing the IR sensor can be found here:
http://www.writtensound.com/arduino/cat_feeder.htm
The sensor has an optimal range. Closer to, or farther away than that, the output will be low. The sensor used here (Sharp GP2D120) has a range of 4-30 cm. Mount it in such a way that when the cat is eating, his head is at a distance that makes the output reliably cross your threshold, and set the threshold at a value that doesn't give a lot of false positives. My sensor output hovers between 50 and 150 with nothing in front of it, and increases to over 230 when anything is within 10cm, so I set the threshold at 200. Also, mount it in a way that the door itself does not activate it. The code is about the same as step 4, but with the IR added. Now the door will never close whenever something is in the way.
code: http://www.writtensound.com/arduino/cat_feeder.htm
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|













































