
Limited time download:Reply “Tutorial” to get the microcontroller e-book, reply “Simulation“ to get Proteus simulation materials, Baidu cloud group share link update time: 2016-03-06,if invalid please leave a message at the end of the article, do not leave a message in the background
Let’s go back to February 2013 when I started teaching Raspberry Pi 101 courses at Hack Factory. Since the first class, I felt that the Raspberry Pi had deeply embedded itself in my mind. I planned a short weekend trip to the countryside with my girlfriend, so she had to leave her two little cats at home. She said she would leave a big bowl filled with cat food for them, but I gave her a better option: I would make an automated cat feeder for those two little guys.
So they wouldn’t eat too much food, or maybe even additives, and it’s really cool!(Did I mention it’s cool?!) So… five days before we set off, I bought a food hopper, but unfortunately, I couldn’t finish it before leaving for vacation. So I switched to Plan B, a big bowl filled with cat food and water.
However, I didn’t give up on my original plan and successfully completed it for the next outing. In this blog post, I will introduce to you step by step (most parts are like this) how to make your own Wifi-enabled Raspberry Pi automatic cat/kid feeder.
I have already published a Google spreadsheet that lists some special parts needed for this project. This project is very simple, and once you have all the parts ready, you will be able to assemble it in 4 to 6 hours.
Tools Required:
-
Soldering iron
-
Drill
-
1/2″ drill bit
-
1″ drill bit (for installing the switch button, optional)
-
Hot glue gun and glue sticks
-
Wire cutters
Prerequisites:
-
Ensure all parts are ready, check against Google spreadsheet list: https://docs.google.com/spreadsheet/ccc?key=0Aql9CqlhyL98dGxydWVuR0FJckZLeXAxa2E1bElFS2c&usp=sharing#gid=0
-
Raspberry Pi has the operating system installed, either Adafruit Occidentalis: http://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi or Raspbian: http://www.raspberrypi.org/downloads is fine
-
Wifi adapter configured and working: Occidentalis: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis or Raspbian: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-raspbian
-
Download the source code from my Github Repo: https://github.com/videoman/Raspberry_Pi_Class to experience GPIO input and output
-
Install the Python GPIO.PWM module: RPIO install docs: http://pythonhosted.org/RPIO/index.html#installation
Install the motor! The continuously rotating motor needs to be connected to the handle to make the flap rotate. Before that, test to see if it can drive the flap handle. Here I used some tape to stick it to the front of the handle, fixed it, and then turned on the motor.
This at least tells me that the motor can drive the flap without major issues. Of course, there is no load now, as we haven’t put any food inside.
Next, I decided to place the handle at the back so that it wouldn’t be exposed to anyone or bump into those two little guys (or get grabbed by them). So I moved the handle to the back. After moving the handle to the back, I needed to dig out 3/4″ on each side’s back. This way, the handle can easily rotate 360 degrees.
Now let’s open a channel for the little motor’s head…
I eventually dug into the channel by 2mm and basically had a motor base shape. That’s about it, but when I pressed other things on top with the hot glue gun, it felt like it was just stuck to the surface, not connecting the lever and would soon break. The hot glue gun sticks things well, but cannot serve as a solid joint. After gluing, I added two nylon tie straps.
As you can see, I have opened a channel for the little motor head and tried to keep its shaft close to the center. But it cannot be 100% centered, almost fine.
Connect all the wires! I used a “small size Raspberry Pi prototype breadboard” bought from Adafruit (http://www.adafruit.com/products/1171 ). Insert a 3-pin socket for each motor. This makes it easier to plug in/out the little motor.
The back of the board….
When you look at the back of the board, at the place where the motor wires are soldered, I made a 5V solder bridge (from the 5V line). On the left, another is the ground solder bridge, and it connects to the first hole, which is where I connect GPIO pin 18 and 23. To make this solder bridge, you need to carefully dig out the first two rows with tweezers (side cutter or dyke). Then you can solder the motor connection wires inside. Next, we need to add a current limiting resistor for the LED light because we don’t want it to explode! Soldering a 390-ohm resistor on the line works well!
Make sure you put on heat shrink tubing before soldering the resistor.
I have a 12V button with neon lights, but I want to replace the neon light inside with an LED.
So I replaced the bulb with an LED, just need to pry open the switch (easier said than done), replace the bulb with an LED and solder it up. Connect one end of the two LEDs with a resistor to pin 4 and pin 27 on the breadboard as output. Connect the negative to the negative slot (don’t forget to connect the negative slot to the GND line).
Now, we do something when the button is pressed. We use the same 390-ohm resistor as our so-called “pressed” resistor. This resistor is grounded, ensuring our input pin won’t fluctuate and won’t be particularly high. Next, we connect the other end of the switch to the 3v socket. When the switch is pressed, it will read a “High” in the GPIO system or “True” in Python.
Finally, connect your buzzer to pin 24 and ground. Now, once all the wires are soldered, and you press the button to test everything is fine, you can start modifying the food hopper and assemble everything together at its back… I have opened holes for the USB power line, motor head, through holes, and side button on it.
and I stuffed them all into a column…
Now it looks like this:
Now, turn it on and start testing!
View all photos on Flickr: http://www.flickr.com/photos/synackurgfoo/sets/72157633110276817/ .
Future improvements include:
-
Pi camera
-
Mobile WebUI using PiUi: https://github.com/dps/piui
-
Active speakers
-
Sound clips from red dwarf, especially the fish requested by the kittens
Original link: David Bryan’s Blog Translation: Geek Fan – Boyd WangTranslation link: http://www.geekfan.net/6188/
Limited time download: Reply “Tutorial” to get the microcontroller e-book, reply “Simulation” to get Proteus simulation materials。
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Click the lower left corner “Read the original text”, enterForum Communication!!!