Because of the complexity of taking pictures and uploading them to Twitter, we decided to ditch the Arduino Uno in favor of the Raspberry Pi. The RPi provides many of the same hardware control and programming capabilities as the Arduino, with the added benefits of running Linux and connecting to USB devices and the internet very easily.
Once we had our idea, we worked out how to accomplish it. It was clear that we had a few mandatory components needed to get it to work:
1. Alarm clock (cheap, pre-existing model without a radio)
2. Raspberry Pi (to control the whole system)
3. USB Webcam (to take the pictures)
4. Light source (to illuminate the dark room when the picture is taken)
For the alarm clock we went to the thrift store Value Village in Capitol Hill and found a basic used $3 clock made by Sharp.
From previous projects I already had a Raspberry Pi and USB webcam, so we reused those components. For the light source we used a $4 LED lamp from IKEA that runs on two AAA batteries.
From previous projects I already had a Raspberry Pi and USB webcam, so we reused those components. For the light source we used a $4 LED lamp from IKEA that runs on two AAA batteries.
The prototype assembled with clock, webcam, light source, and RPi
Programming the Raspberry Pi was relatively easy thanks to online tutorials. For controlling the webcam and uploading to Twitter we decided to use Python because it is a powerful scripting language with lots of online support. One online tutorial in particular was perfect for our needs - it had code for taking webcam pictures and then uploading them to Twitter, allowing us to copy it virtually line-by-line for our project. It can be found here: http://www.makeuseof.com/tag/how-to-build-a-raspberry-pi-twitter-bot/
With our prototype assembled and programmed, I tried it out for a few nights, and it worked perfectly! Check out the Twitter feed with actual morning pics here: https://twitter.com/tweetyclock
No comments:
Post a Comment