Low Budget Time Lapse Camera With DigiSpark
by Absolutelyautomation in Circuits > Reuse
1401 Views, 20 Favorites, 0 Comments
Low Budget Time Lapse Camera With DigiSpark
KEYCHAIN CAMERA
Este proyecto tambien esta disponible en Español haciendo clic aqui
This diminute mini cameras were built into multiple forms like keychains, gum pack, pen, cigarette lighter, etc. All basically have a CMOS picture sensor, image processor and a rechargeable battery to record video (with audio! ) and to take still pictures, usually using a removable micro SD card.
The build quality of those cameras is very low (their price is usually under 5 USD/EUR/GBP) so they fails often. The rechargeable battery like in other portable electronic devices is their Aquiles Tallon. If there's a battery failed camera somewhere lying in a drawer, it's time to give a second chance as a time lapse camera with very low budget additional components.
The project's features are:
-
Programmable time intervals
-
Very low power
-
Automatic flash
-
External battery
-
Low budget ( could be 0 )
Some of the elements needed for building & testing:
For more info, visit Absolutelyautomation.com
REQUIRED COMPONENTS
Here is the list for the required components for this project with the absolute lowst prices! If tou find something cheaper somewhere, please msg me!
- Arduino compatible USB Thumb DigiSpark board ► ( http://goo.gl/xLrss2 )
- Miniature DV Camera ► ( http://goo.gl/jWHKqG )
- While LEDs ► ( http://goo.gl/poszp7 )
- Mini solar panel from toy car ► ( http://goo.gl/3KAvAq )
- Optocoupler 4N25 ► ( http://goo.gl/6Nzgns )
- 2N2222 Transistor ►( http://goo.gl/McynZp )
- 100 Ohm Resistors ►( http://goo.gl/ykSxLL )
- 220 Ohm Resistors ► ( http://goo.gl/GZfoDR )
- 1K Ohm Resistors ► ( http://goo.gl/g5grwR )
- 3 AA Battery holder ► ( http://goo.gl/q8JJ32 )
- High Performance Rechargeable AA Batteries ► ( http://goo.gl/4FssNE )
- 170 Point mini breadboard ► ( http://goo.gl/p92XcX )
- Flexible mini tripod stand ► ( http://goo.gl/t3Dk4b )
- Third hand soldering stand ► ( http://goo.gl/xsrEKg )
- Enameled copper (no need to remove lacquer) wire ► ( http://goo.gl/tshk24 )
EXTERNAL CONNECTIONS
The camera has two push-buttons to set up the different operating modes, like video recording or still pictures taking. Usually one of the two buttons, when pressed for some amount of time powers on the camera , and if pressed again for the same amount of time, the camera powers off . The on/off process is all in software because the power of the camera is never cut (to preserve the time and date).
The other push-button is used as camera shutter to take still pictures if pressed and released quickly. If kept pressed for some amount of time, the camera enters into a continuous video recording mode, and it will be in that mode until the button is pressed again or battery is depleted. If the camera isn't recording video it will shut down automatically after some time, if there is no other action like taking still pictures. Push-button quantity, time intervals to turn on/off, take pictures, start/stop video recording may vary depending on camera model and manufacturer, but generally speaking, tends to work in the way mentioned earlier. To control and power the camera externally (in case of defective battery or to give more autonomy), wires must be soldered into the circuit board to the push-button contacts and battery PCB pads. Use enameled wire as thin as possible.
AUTOMATE BUTTON PRESS
To automate the picture taking process, a simple 555 or transistor based circuit is enough. However, if more complex things are required like taking pictures with varying time intervals, or the time interval is longer than the automatic shut down camera timer, or if a flash is needed in low light conditions, a "smart device" is needed.
To complete this task, whatever embedded programmable platform could be used, in this case a Digispark will be used, thanks to its small size, very low cost (clones available for around 1USD/EUR/GBP worldwide shipment included),plugs directly into USB port so no cable is required, and also with a bit of effort supported in the Arduino suite.
The cyclic steps executed by the microcontroller are the following:
Press power button, keep pressing and then release (camera power on)
Wait while the camera initializes
Observe light conditions (using toy solar panel) to turn on "flash" if needed
Press shutter button, keep pressing and release quickly (to avoid entering into video recording mode)
Turn off flash
Wait until the picture is written into the micro SD card
Press power button, keep pressed and then release (camera power off)
Enable watchdog and put microcontroller in sleep mode
The different waiting times, like button presses, initialization, turn on, turn off, should be found experimentally because they tend to vary according to the camera used. Usually one of the push-button works in "pull-up" mode and the other in "pull-down" mode. Verify this with a multimeter to know the proper way to connect each optocoupler.
The system was programmed in C using AVR GCC, Micronucleus drivers must be installed to program the Digispark module.
IMAGE PROCESSING
The camera stores the images on a removable Micro SD card. Every image is stamped with the programmed date time. This could be a potential problem if the images would be used to make a video, because there is no official way to remove the date time in every frame. There are some alternatives in the 808 forum, like to modify the firmware (only for very specific camera models), or to apply virtual dub filters, etc.
A much simpler approach to remove the timestamp from the image is to use imagemagick, cropping the area of the photo where the timestamp lies, also could be necessary to resize the image to match the aspect ratio of standard video formats in the following way:
mogrify -crop 1280x720+0+64 *.*
The bottom 64 pixel lines from the image were cropped, also the resulting image is 1280 x 720 pixels matching 720p video resolution.
Finally to generate a 30 fps video from multiple images, with their filenames in sequence starting from zero (i.e. EKEN0000.jpg, EKEN0001.jpg, EKEN0002.jpg...) avconv could be used:
avconv -r 30000/1001 -i EKEN%04d.jpg -r 30000/1001 video.mp4
Schematic, code and instructions in the PDF
For more info, visit: Absolutelyautomation.com