Long term solar powered time lapse camera using Arduino

Solar powered 5MP Arduino time lapse camera

After a few experiments I have a pretty decent platform for capturing long term time lapse footage. The system is designed to run for around a month and captures a photo every thirty seconds during daylight hours. It's a fairly cheap build so I'm not too worried about theft or accidental damage. This post contains build instructions and sample code to get the camera up and running. Before that, here's a quick video made from a few test runs:

On the hardware side you need an Arduino Mega 2560 REV3, the OV5642 camera module, an SD module and card, a battery and a solar panel. You'll also want a waterproof case, cables and some zip ties. Everything I used is on this Amazon list. I tried a few different power solutions and the Voltaic Systems 6W solar panel + 6,400 mAh battery combination is ideal. Their battery banks are 'always on' and continue to provide power even when the Arduino isn't doing anything. Most battery banks shut down when there is low power usage. In my testing the 6W panel managed to keep the system running with no issues.

The main limitation is that Arduino only supports up to 32GB SD cards. With the code below this allows around a month of photos. Depending on the application you could go much longer - the variables are interval (I'm shooting a frame around every 30 seconds) and file size (lower resolution and/or JPEG quality). At some point I'd like to figure out cellular upload but for now 32GB will have to do.

Assembly is pretty easy. The OV5642 camera uses both the I2C and SPI buses. For I2C connect the pins labeled SCL and SDA to SCL and SDA on the Arduino Mega (D21 and D20 pins - search Arduino Mega pinout if necessary). The SPI connections are MISO, MOSI and SCK (available at D50, D51 and D52). You also need CS (chip select) - wire this to D10. Finally wire ground and power to the GND and 5V pins. The SD module also uses SPI. Wire its MISO, MOSI and SCK to the same pins (D50, D51 and D52). SD needs a separate CS (chip select), use D7. And finally for SD connect ground and power to GND and 5V. That's it.

The box linked above is large enough to fit all the components easily. You'll need to drill two holes, one for the camera lens and one for the solar panel cable. Once assembled, seal around both as well as you can.

To program the Mega you need to install the Arduino IDE and then download and install the ArduCAM library. Make sure that the ArduCAM folder is directly under the libraries folder for your Arduino IDE (on Windows this is probably C:\Program Files (x86)\Arduino\libraries\ArduCAM). Then open the file memorysaver.h in the ArduCAM folder and make sure that only the OV5642 line is uncommented (#define OV5642_MINI_5MP_PLUS). If you get build errors it's almost certainly this step that is the problem so check carefully.

At this point I'd suggest trying the blink sample to make sure that you can connect to and program your board successfully. Once this is working create a new sketch and then copy the code below:

A few notes on the code. Near the top you can uncomment the line #define USE_SERIAL to get diagnostic messages written to the serial monitor. This can be useful for debugging if necessary. The sketch uses the built in LED to indicate problems as well - if everything is working you'll see the LED light up during setup and then switch off once the main loop starts. When a picture is written to the SD card the SD module LED will light up, so if you see that happening every 30 seconds or so then you should be in good shape. If the setup code fails to find the camera or SD module the internal LED will blink indicating that you need to fix something. Check that the OV5642 and SD modules are correctly wired. I would also try disconnecting power from the Mega for a few seconds. I have experienced connection issues with the OV5642 that are only fixed by a power cycle.

At startup there is also a check for existing files on the SD card and the file number is incremented by 1000 as needed until existing files will not be overwritten. This is useful in case the system loses power and restarts for any reason. I have included most configurable parameters for the camera module in the setup code like contrast and exposure adjustments so these should be easy to tweak based on your specific application.

Finally the startup code disables Mega features that are not used and after each photo the camera is powered down and the Mega put to sleep. Each sleep is around nine seconds. The number of sleeps depends on the size of the image - if below 200K it will sleep for around half an hour before trying again. This saves filling up the SD card with nighttime images and preserves power when the solar panel is unlikely to be helpful. This is another area to tweak depending on how you plan to use the system.

If you have any questions (or if you build this and it works for you) please leave a comment below.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Long term solar powered time lapse camera using Arduino #code #video #arduino #camera #c++ How to build and program a solar powered time lapse camera based on the Arduino Mega 2560 and a 5MP camera module. Includes full parts list and working code. )

TLOTW #6

TLOTW #6

South from Golden Gate Heights Park, a dead tree full of cormorants at Lake Merced, downtown and the Golden Gate from Grand View Park.

Add your comment...

Related Posts

(More Timelapses)

(Published to the Fediverse as: TLOTW #6 #timelapse #video #tlotw #goldengateheights #lakemerced #cormorant #grandview Timelapse of the week featuring views from Golden Gate Heights Park, Lake Merced and Grand View Park (all in San Francisco, California) )

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

Updated on Friday, June 10, 2022

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

I just want to listen to Friday Night Comedy on Radio 4.

It used to be the case that this was safely subscribed in my podcast app (I use Podkicker Pro) and so each new episode would download to my feed when released.

The BBC has decided to fix the problem of me getting the program I want to listen to automatically and conveniently. If I want my comedy I have to install My Sounds. When Spotify tried this with Science Vs I just stopped listening. I have plenty of other science podcasts but The Now Show and the News Quiz are irreplaceable. So maybe I could cope with one walled garden.

My Sounds says it will notify you when new episodes are available. It does not.

My Sounds has a My Sounds tab which lists Latest programs. I'm writing this on April 2 and the most recent episode of Friday Night Comedy is from March 25.

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

Only if I go into Subscribed, and then the program page for Friday Night Comedy does it finally admit that there is an episode from April 1.

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

So I'm forced to install an app that not only fails to notify me of new episodes of subscribed programs but actively hides them in the basement behind a beware of the leopard sign. BBC, maybe get the app working before forcing me into it? I would rather pay to subscribe to an RSS feed than deal with My Sounds.

I'd take the time to leave a one star review, but in its infinite wisdom Google doesn't allow paying customers to leave app reviews.

Updated 2022-05-06 11:32:

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

Having been forced into the excreable BBC My Sounds at least it supports downloading an episode to listen to on the plane right?

Updated 2022-05-06 11:33:

BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign.

Does it fuck. BBC, please fix this and then try asking nicely?

Add your comment...

Related Posts

(All Etc Posts)

(Published to the Fediverse as: BBC My Sounds, hiding podcasts behind a 'Beware of the Leopard' sign. #etc #bbc #radio4 #google #podcast BBC My Sounds fails to send notifications, fails to have new episodes on the Latest My Sounds Page and is therefore the worst podcasting app ever. Thanks for forcing us to use it BBC. )

Book reviews for March 2022

Rationality: What It Is, Why It Seems Scarce, Why It Matters by Steven Pinker

Rationality: What It Is, Why It Seems Scarce, Why It Matters by Steven Pinker

4/5

 

Zeroes by Chuck Wendig

Zeroes by Chuck Wendig

2/5

 

Escape from Yokai Land (Laundry Files, #7.5) by Charles Stross

Escape from Yokai Land (Laundry Files, #7.5) by Charles Stross

3/5

 

The Apollo Murders by Chris Hadfield

The Apollo Murders by Chris Hadfield

4/5

 

Add your comment...

Related Posts

(All Reviews)

ITHCWY Newsletter for March 2022

One Year of Tides Animated (with Sun and Moon)

Exclusive transcript of the speech that Biden should have delivered: Build Back Betterer.

What is the San Francisco Rent Board Fee?

Catfood WebCamSaver 3.27 is out. This has a big increase in the list of working webcams and so definitely worth upgrading (or trying for the first time).

Code: I fix a pet peeve with Todoist so the Alexa Integration sets a due date. Also, here's how to use the new Google Search Console API to monitor the index status of your pages. Both in Google Apps Script.

Timelapse: San Francisco Shoreline. Sunsets 8 (Nice Pacific view from my roof) and 9 (the March 27 storm in San Francisco). Both sides of the Golden Gate.

Hikes: I don't recommend the perimeter of Treasure Island (at least not trying the whole of it). I absolutely do endorse Mount Davidson. And San Bruno Mountain.

Previously:

Add your comment...

Related Posts

(All Etc Posts)

Sunset #9

Sunset #9

Shot as the rather moist storm of March 27, 2022 rolled into San Francisco. Some decent clouds and then a good soaking, probably the last of the season. Looking north-west from West Portal.

Add your comment...

Related Posts

(More Timelapses)

(Published to the Fediverse as: Sunset #9 #timelapse #video #sunset Time lapse of the March 27, 2022 storm in San Francisco, California. Shot looking north-west from West Portal. )

Treasure Island Perimeter

Updated on Sunday, April 24, 2022

Treasure Island Perimeter

Treasure Island Perimeter

Treasure Island Perimeter

Treasure Island Perimeter

Today, for no great reason, I decided to see if it's possible to walk the full perimeter of Treasure Island. I parked at the Treasure Island Museum and headed north up the Avenue of the Palms. I've been here many times and it offers stunning views of San Francisco and both the Bay Bridge and the Golden Gate Bridge. The path continues around the north of the island and then you need to work around a blocked off area to get back to the coast. The east side is less appealing with a lot of garbage along the path and a view of many barges and the Port of Oakland peeking out under the new section of the Bay Bridge. Finally I was fully thwarted as the entire south west corner of the island is a mess of construction (and a rather unpleasant portable toilet staging area). I had to head inland all the way to 9th Street before cutting back over to the Avenue of the Palms. Overall I'm glad I tried but I can't recommend it.

Hike starts at: 37.817257, -122.371726. View in Google Earth.

Add your comment...

Related Posts

(Hike Map)

(Published to the Fediverse as: Treasure Island Perimeter #hike #sanfrancisco #treasureisland #map 4 mile hike around the perimeter of Treasure Island in the San Francisco Bay. It's not possible to fully circumnavigate the island. )

Vernal (Spring) Equinox 2022

Spring Equinox 2022 rendered in Catfood Earth

Spring starts right now in the northern hemisphere, Autumn if you happen to find yourself south of the equator. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Vernal (Spring) Equinox 2022 #code #earth #equinox #spring #autumn #vernal Spring Equinox at 15:33 UTC on March 20, 2022 rendered in Catfood Earth. )

Both sides of the Golden Gate, a Time Lapse

Both Sides

A timelapse of the Golden Gate, shot from Kirby Cove in the Marin Headlands and then from Grand View Park in San Francisco.

Add your comment...

Related Posts

(More Timelapses)

(Published to the Fediverse as: Both sides of the Golden Gate, a Time Lapse #timelapse #video #sanfrancisco #kirbycove #grandview Shot from Kirby Cove in the Marin Headlands and Grand View Park in San Francisco, a timelapse of the Golden Gate. )

Book reviews for February 2022

Mickey7: A Novel by Edward Ashton

Mickey7: A Novel by Edward Ashton

3/5

 

The Nineties: A Book by Chuck Klosterman

The Nineties: A Book by Chuck Klosterman

4/5

 

Product-Led SEO: The Why Behind Building Your Organic Growth Strategy by Eli  Schwartz

Product-Led SEO: The Why Behind Building Your Organic Growth Strategy by Eli Schwartz

3/5

 

Add your comment...

Related Posts

(All Reviews)