I used a Raspberry Pi and usb webcam to create my own "Family Hub" refrigerator. Every time I open the door a light sensor triggers the camera, which uploads the photo to the internet!
Step 1: Parts Needed
Do make your own refrigerator camera, you'll need:
- Raspberry Pi (I used an old one)
- USB wifi adapter
- Light sensor
- Wide-angle USB webcam
I used the Genius WideCam F100 with a 120 degree field of view. The wider the better!
Step 2: Make a Button Trigger the Webcam.
This was my first Raspberry Pi project, so I started by just making a button take a picture with the camera. I used a pre-installed program called "fswebcam" to take the picture and the GPIO python library to use the button.
I originally started using the "Pi Camera" that's made for the raspberry pi. But as you can see from the picture the focal length was too narrow to see anything in the refrigerator.
Step 3: Swap the Button for a Light Sensor.
I was expecting this to be more difficult. It turns out the light sensor was a drop in replacement for the button. All I had to do was switch the wires over and it worked! At this point, whenever the light sensor saw light it would take a picture.
Step 4: Upload to the Internet.
This took a little longer than I expected. Eventually I figured out you could use a python library called "ftplib" to transfer any file on the raspberry pi to a server (our website). Then I bought a simple to remember domain name (inourfridge.com) and forwarded it to the uploaded image. That way it's easier to remember at the grocery store.
Step 5: Install Into the Refrigerator.
I got half lucky with my installation into the refrigerator. I needed 5V DC power, and the fridge circuit board provided 13.5V. Better than nothing!
Step 6: Step Down the Voltage.
I started by using a linear voltage regulator (7805) but it got EXTREMELY hot. It turns out I created a 7 watt space heater in my refrigerator. I learned I needed a switching regulator. Those can be found in every car usb adapter, so I just soldered in my 13.5V leads.
Step 7: Hide the Wires.
I was able to stuff my USB cable behind the magnetic strip of the refrigerator which made things look nice and neat. I drilled one small screw hole to mount the camera.
Step 8: Finished Installation.
Step 9: See It in Action!
You're welcome to visit inourfridge.com to see what's in our fridge, although I'm not sure how long we'll keep that public ;)