Wigglecam Pt 2
Introduction to Physical Computing
01 Oct 2018
Part 1 Now that I have the camera program working, I’m going to add some visual feedback for the camera. I figure I’ll need three leds to cue the users - a green light to indicate that the camera is ready for operation, a white light that signals that the pictures are being taken, and lastly a red light to indicate that the GIF is being processed.
Once again I am making simple circuits to the GPIO pins on the Raspi. Make sure that you are using the same pin mode we set earlier to make the switch.
The code part is fairly straightforward as well. At the top of each function call I simply turn on the appropriate led and turn it off before leaving the function.
With everything in place I need to do a few things for my housing.
- First I need to operate the Pi headless and have my script from boot.
- To do this edit the .bashrc file
sudo nano /home/pi/.bashrc
- At the bottom of the file add
sudo python /home/pi/wiggle.py
- Change the output to name the gif by the time stamp
- I import the time module and add the timestamp to the imagemagick step
With that my camera has all of its functions and I’ll make a housing for it.
I start by taking components off the breadboard to make it more flexible. I tried soldering the resistor to the led, but I had poor results so I went ahead and wrapped the rest together.. it wasn’t pretty.
Next I folded together a cardboard box to house everything and made sure to have cut outs for the web cams and on the top of the box I made holes to house the leds.
The end result:
The fabrication for the housing was done really hastily and it doesn’t look very polished, the housing is not efficiently utilizing space, and the wire connections were haphazardly put together. A lot of exposed circuits and shorting circuits. BUT I this prototype is completely functional - the feedback lights work as intended, the gif is outputted using time stamps for the name in order to continuously take gifs.
Next steps I’m glad to materialize my idea but in the next iteration I will make a lot of improvements.
- I want to fabricate it with better materials and more precise measurements
- Improve wiring
- Use an external battery so it can be portable
- Ideally I would like it to post gifs to Instagram or upload to a server