Garden solar timelapse Pi

Here you can discuss things that are not directly related to running or using XBMC4XBOX.
Post Reply
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Garden solar timelapse Pi

Post by asbo »

We've recently started building phase one of our extension so I thought it'd be fun to make a timelapse video of it. So this is what I cobbled together:
Raspberry Pi model B
Raspberry Pi camera
16GB USB stick
USB wireless N dongle
40W solar panel
Buck converter (13.8v output)
12V 22AH battery
UBEC (5.5v-23v input, 5v output)
waterproof enclosure

I'm using the python script from here so all credit for that to Jim at Fotosyn. Since it connects to my wifi network I am instead starting the script via SSH and I can FTP the captured images off the Pi. So far, as a test, I've just left it since yesterday afternoon until now taking a picture every minute and its worked great, I shall now move it to a more suitable location out of the way and leave it until the building work has been completed. :)

Image
Image
Image
Image
Image
User avatar
BuZz
Site Admin
Posts: 1891
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 66 times
Been thanked: 423 times
Contact:

Re: Garden solar timelapse Pi

Post by BuZz »

Nice work! Look forward to the end result. Do you know how much everything cost in total ?
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

I've added it all up and it comes to ~£153, surprising how much money these little projects eat up! :lol:
I've been FTPing the test images off the Pi for the last hour at ~50kbps and its only about a 3rd of the way done. I might have to rethink things as that's less than 24hours of pictures and I'm going to have months of them by the end.
I've set the USB stick to mount with its UID so I think I can just pull it out and put it back in and it'll auto remount. That way I can copy the images off in a few seconds as its USB 3 :D

The FTP has just died as I'm typing this and the Pi has vanished off the network so that can't be good. I've been and checked it and its still on so hopefully it'll reappear. My conclusion from that is that FTP is not the way to go.

edit: I think the little dongle overheated with the constant use, it was only £2.99 including delivery so I suppose that's to be expected. I disconnected it, left it a bit and then plugged it back in and rebooted the Pi. It reconnect to the wifi then but now its vanished again so I dunno what's going on.
Anyway I copied the images off and turned them into a video, enjoy:

oh and I deleted the night time frames as they were 500 images of nothing :lol:
User avatar
professor_jonny
Posts: 1298
Joined: Thu Jul 05, 2012 5:41 am
Location: New Zealand
Has thanked: 66 times
Been thanked: 196 times

Re: Garden solar timelapse Pi

Post by professor_jonny »

very cool.

but you might want to vent the box with a breather of some sort?

As it says on the front of the battery :-)
User avatar
LudviG
Posts: 267
Joined: Sun Jul 15, 2012 10:05 pm
Location: Norway
Has thanked: 29 times
Been thanked: 13 times

Re: Garden solar timelapse Pi

Post by LudviG »

Nice project!
Never argue with an idiot! First he brings you down to his level, then he beats you with experience.
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

Thanks chaps :)
professor_jonny wrote: but you might want to vent the box with a breather of some sort?

As it says on the front of the battery :-)
yeah I'd been wondering about that. I forgot to mention I got the ideas for the battery etc from here. He says that the battery gassed when charged at 14.8v with a 'proper' charge controller but it doesn't at its float voltage of 13.8v. I think that means its safe without ventilation but I'll keep an eye on it. I've not noticed a hiss or anything when I've taken the lid off the enclosure although I doubt its air tight around the camera.
I'm not really sure what to do, obviously I don't want it to explode or anything but I also don't want rain or insects getting in there.
User avatar
xman
Posts: 1289
Joined: Wed Jul 04, 2012 2:30 pm
Location: Sydney, Australia
Has thanked: 55 times
Been thanked: 168 times

Re: Garden solar timelapse Pi

Post by xman »

Yes a sweet project. I like the pics the RPi camera is capable of. What Megapixal are the cameras?. As for your total price of parts, well that is about what my trail cams cost. There about $200 each and have time lapse ability, day or night, pics or video and timers so it can only activate during set times but what fun is that when you can have the pride and pleasure of creating something yourself?. I think your route was one I'd do myself for around my house but I'd not feel good leaving it in the bush taking wildlife pics and I've had the trail cams knocked over by animals in the past too. :lol:
You could drop the size of the battery down if you need to, I'd say a 7.5 Amp/hour battery would be more than needed. Maybe the WiFi would be best sticking outside through the enclosure and a bead of silicon so as to seal but the main body of the WiFi unit in the open air and that would only help reception anyway. However I think your spoilt with WiFi anyway. :lol: What's wrong with a thumbstick you swap over when needed?. My trail cams are all on SD cards. Oww, you now know how I feel when the cams go off "because the wind made the camera trigger" and you end up with hours of "nothing pics or videos" Look forward to seeing more and the progress on the yard. Keep up the excellent development on this one because it really has me interested and I could use these as surveillance cams around the farm house. Last time I looked into the cameras, they weren't available yet however I now see Element 14 has then in stock. I'd really like to have a couple of cameras working on the one RPi time-lapsed because then I could cover completely around the farm house at the cost of one RPi being the tight arse I am. :D
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

From the raspberry pi website
The camera module is capable of up taking photos up to 5 MegaPixels (5MP) (2592×1944 pixels) and can record video at resolutions up to 1080p30 (1920x1080x30fps).
They also recently enabled some new video modes with a software upgrade :)
However I'm taking the pics at 800x600 because I feel its a happy medium between quality and file size.

Nail on the head there xman, most of the fun comes from planning it, making it and tinkering with it :)
I think there's some software called motion that will detect movement and only take pictures then, although I want to capture all the tiny movements like the grass moving too. I think it should be able to detect when its dark and stop taking the pictures, then start again when it gets light. I'm going to have a look into that.

The wifi is basically so I can tinker with it remotely :D but also so I can check its taking the pictures, stop and start it, that kind of thing. I can't just take the USB stick out whilst its still taking pictures, I'm not sure if it would crash or just start writing the image files to the mount point on the SD card, but either way it'd bugger up :lol:

They also do an infra-red camera module :) although you can only have one camera module connected as there is only one connector. You could have multiple USB webcams along with a camera module, though it would take some planning as I expect you'd need a powered USB hub.
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

Here it is in its permanent location:
Image
I thought maybe the Pi was switching off the wifi as a power saving feature, I followed the instructions here and it stayed connected for several days. I thought that had fixed it but today it was gone from the network again.
So I went and opened the enclosure and disconnected the pi from the power(I can't shut it down safely without SSH), I noted the green act light was flashing so it seemed to be doing something before I cut the power. I unplugged its usb stick and copied the time lapse pics onto my PC, they're time stamped so I know it took its last pic at 8:27 this morning.

I did try to connect to the pi with a network cable and a laptop running a DHCP server but nothing happened, although I can't remember how I'd set up the ethernet on the pi I think it still should have connected anyway. But would it do that without a reboot?

So I have no idea what's up with it, but here are some things of note:
The pi was pretty hot, mostly the metal of the USB slots.
I read the CPU temperature when I was able to connect to it and it was around 45c.
From what I understand the pi can't overheat as it lowers the CPU frequency when required in order to cool down and it was definitely on and seemed alive because of the green act light.
Could the wifi adapter dying/switching itself off/overheating cause the timelapse script to halt?
Could the wifi adapter dying/switching itself off/overheating cause the pi to crash?
At 8:27am it would have been probably 10c at the most outside so why would it overheat then and not yesterday when it was 23c outside?

I plugged the USB stick back into the pi and powered it up but just the red light showed, no green act light flashing, so I cut the power again. This could be because the OS on the SD card has become corrupted, or the pi is too hot(although I've sort of ruled that out), or maybe its the wifi dongle preventing it from booting(although that makes no sense).
Anyway I've left it for a bit to cool down so I'll see what happens when I power it up later.
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

Update: It still wouldn't boot so I've taken the SD card out and its corrupted, guess who didn't make a backup image :lol:
User avatar
xman
Posts: 1289
Joined: Wed Jul 04, 2012 2:30 pm
Location: Sydney, Australia
Has thanked: 55 times
Been thanked: 168 times

Re: Garden solar timelapse Pi

Post by xman »

What are you using to regulate the 5vDC the RPi requires?. I'm thinking at 8.27am, that would be about the time the solar panel would be starting to make power for the battery charging?. Maybe the regulator is having problems shedding the extra couple of volts required to get the battery to take a charge and is to much for the regulator your using to create a stable 5vDC for the RPi to run. The regulator may be getting upset with the pulses the solar charger is creating as it tries to maintain the required battery charging voltage. If it is a linear regulator your using for the 5vDC RPi supply, try using a larger titanium cap between the input and ground terminals on the reg itself. It is recommended this be at least a 1uf cap but larger will only help. If it isn't there or is to small, it will spike the reg and make it near impossible for the reg to deliver the required stable 5vDC for the RPi causing it to run hot. I'd also be throwing heatsivks at the RPi just as a safety measure. @ $2 for 8, there cheap and won't hurt.
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

Thanks for the suggestion xman :)
Its a buck converter taking the solar panel voltage down to 13.8v which is going straight into the battery. Then I've got a UBEC in parallel converting that to 5v. A UBEC is what the RC people use as they need a nice steady voltage for their receivers, its got all sorts of protection stuff built into it so it never puts out more than 5v.
Looking at the pics the sun was up at around 6:30am , although it looks like it was completely overcast including in the last pic it took at 8:27.
The previous day the sun was out and shining brightly at that time so wouldn't it have died then if that was the problem?
So I think that rules that out?

I have a possible theory for what might have happened. The raspberry pi is limited to how much current it can supply to USB devices, perhaps the wifi dongle being an ultra cheap product is simply not designed or capable of being on 24/7, after a while it gets hotter and hotter whilst drawing more and more current until its drawing too much which makes the pi crash? I'll be trying it with a different wifi dongle so we'll see what happens.
User avatar
xman
Posts: 1289
Joined: Wed Jul 04, 2012 2:30 pm
Location: Sydney, Australia
Has thanked: 55 times
Been thanked: 168 times

Re: Garden solar timelapse Pi

Post by xman »

Have you tried a powered hub for powering the RPI and anything else you want to run and connect to it?. I'll post some pictures of how I hook up RPis. It is not the recommended or the usual way but it does have merits. First off, only have power going to the hub. The hub I use is a 3amp with 4 USB3 sockets and an input USB3 socket. It is hooked to the supplied plug Pak via a 5vDC plug in the hub as well. I use one of the USB sockets solely to power the RPI mother board using a USB to mini USB lead and it goes into the USB power input on the RPi. Then I run a USB3 lead from one of the RPi's USB sockets, (mine have two as they are the later RPi boards), and this is plugged into the hub's input USB plug so all the data coming out of the RPi goes to the hub itself. The reason I do this setup is so nothing is actually powered from the RPi mother board itself. Even the RPi draws it's power from the hub. Only data is going from the RPi to the hub as anything you plug in the hub like HDDs, thumb drives etc are all powered directly from the hub. Ow and the RPi sees anything you plug into the hub so you could be using multiple thumbdrives as your picture download and remove only the one you wish to upload your pics from without needing to shutdown you RPi. I'll get some pics so you can see exactly how it all works and it does work very well. I am just making up a simple linear power supply to replace the plug pak so the setup can run on 12vDC and I'll show some pics of this as well. These are all parts of my RPi powered Xbox that I have been testing. No problems so far.
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

ah yes I'd been wondering about a powered hub so I'd be interested to see those pics :)

Latest update is after reflashing the SD card with raspbian(the OS) several times and it not booting or only booting once I decided to test the SD card. Turns out its either faulty or fake :( and I made a point of buying a kingston one rather than a no name brand.
I'm now putting the OS on a microSD card in an adapter so we'll see what happens.
This whole thing is making my head hurt though, how did it run perfectly fine for 3 days if the SD card was buggered?
User avatar
asbo
Posts: 594
Joined: Sun Jul 08, 2012 3:38 pm
Location: Norfolk, UK
Has thanked: 17 times
Been thanked: 54 times

Re: Garden solar timelapse Pi

Post by asbo »

Its now all back up and running on the microSD card in the adapter, I made a backup image this time after setting up the wifi, ftp, mount point etc. so I can easily restore that if things go wrong again :)
I'm now thinking the whole problem was caused by a dodgy SD card, so we'll see what happens.
Post Reply