Skip navigation
2014

So, for my 40th birthday my family decided to get me a Raspberry Pi + camera and some sensors.  In this sensor kit were some fun goodies, like a piezo buzzer, a DHT11 (humidity + temp sensor), a relay switch, a LDR, and a servo motor.  I currently live in Tanzania, where power isn't 100% guaranteed. so we have 15 solar LED security light system (125 watt panel, controller, and deep cycle battery).  Having to manually turn on every solar light at night was getting tiresome, and I just so happened to have a spare Pi not doing anything.  So, I got myself a 12v -> 5v (usb) adapter, an analog I2C sensor (with a LDR built in), and made some code that would check the light sensor, and if it was dark enough, turn on a relay which completed the circuit to solar lights.  Now I also happened to have a spare Pi camera ... so, I thought to myself, why not make a web camera?  I found a great example of a php / service script that took a picture every few seconds and created a jpg image in /dev/shm (as to not bother with writing to the SD card) and the php created a new image with the current time to display via a web server.  I took this one step further and slapped on a DHT11 sensor and (using a tutorial from Adafruit) made a crontab that ran the sample Python script from Adafruit and piped it to a file that the webcam php read in and threw it under the time embeded in the image. Now I could see what was going on outside my house, but I wished I could move it. After some experimenting / googling, I discovered a neat little PWM driver that didn't need root access.  It's called ServoBlaster and it creates a file in /dev (/dev/servoblaster to be precise) and allows non-root users to echo angles into the device and it moves the servo according to how the service was set up.  We have a security guard / handy man that every now and then we have to yell out his name if we need anything.  Then another thought came to me, why not use the piezo buzzer?  So, I threw some more wires in and got myself a rather loud buzzer that I can turn on/off via a simple command.  After some woodcrafting, I finally had something; a webcam that gave me the current time, temperature, and humidity, a servo / buttons that let me turn the camera from a web page, and now a buzzer button that would alert our guard if we needed him.  If anyone wants me to make a far better / more detailed account of what all I've done (including source code) let me know, I'd be more than happy to spread the word on what all I did.

 

[Pics - https://plus.google.com/photos/117833478491757346228/albums/6096843358101406833?authkey=CMCS3NPCiP6gwgE]

Filter Blog

By date: By tag: