Electronics & Design Projects

Enter Your Electronics & Design Project to earn a $100 Shopping Cart to any element14 transactional site!

Back to The Project14 homepage

Project14 Home
Wacky Automation Devices
Solar Powered Yard Gadgets

 

I'd hate to let the Going Green  theme go to waste without multiple entries, so I created a (solar powered) video streamer for my chicken coop as a little weekend project

 

 

Hardware

 

The idea is to use a Pi Zero with Pi NoIR and a set of IR LEDs which can be enabled/disabled on demand. An external wifi dongle ensures better connectivity from the back of the garden. Using a solar panel and battery pack, the circuit can remain powered and automatically charge during the day.

 

The hardware required for this project is:

 

* Solar panel with charging circuit and battery

* Raspberry Pi Zero

* Wifi dongle for extra range

* Raspberry Pi NoIR Camera v2Raspberry Pi NoIR Camera v2

* Official Pi Zero case with camera lid

* Pi-Supply Bright Pi

 

The gallery below serves as a build log for this project

 

{gallery} My Gallery Title

IMG_4812.JPG

IMG_4816.JPG

IMG_4818.JPG

IMG_4823.JPG

IMG_4825.JPG

IMG_4829.JPG

IMG_4830.JPG

IMG_4831.JPG

IMG_4835.JPG
IMG_4842.JPG

 

Software

 

On the software side of the project, I went for the all-in solution provided by MotionEyeOS, a streaming OS compatible with the Raspberry Pi.

 

After downloading the software image for my device, I flashed it onto an SD card using Etcher. I copied my "wpa_supplicant.conf" file to the SD card, before ejecting and inserting it in the Pi.

Upon first boot, the Pi automatically connected to the wireless network and set up the camera. I honestly didn't expect it to be this easy

 

Browsing to the web interface, various options are available to configure frame rate, resolution, camera name, etc ...

Screen Shot 2017-07-29 at 19.13.22.png

 

MotionEye also allows the creation of "action buttons". Just what I need in order to enable/disable the BrightPi's IR LEDs.

 

In the "/data/etc" folder, I created two files called "light_on_1" and "light_off_1".

 

[root@meye-1d01a2ec etc]# pwd
/data/etc

 

[root@meye-1d01a2ec etc]# ls -l light_o*
-rwxrwxrwx    1 root     root            83 Jul 29 20:02 light_off_1*
-rwxrwxrwx    1 root     root            83 Jul 29 20:02 light_on_1*

 

Inside those files, a short bit of code to control the Bright Pi via I2C.

 

[root@meye-1d01a2ec etc]# cat light_off_1
#!/usr/bin/env python

from os import system

system("i2cset -y 1 0x70 0x00 0x00")

 

[root@meye-1d01a2ec etc]# cat light_on_1
#!/usr/bin/env python

from os import system

system("i2cset -y 1 0x70 0x00 0xa5")

 

MotionEye detects these scripts, and adds the button overlays to the video streams.

Screen Shot 2017-07-30 at 14.07.13.png

 

Testing

 

Long duration testing will have to determine if the 10W solar panel is sufficient to keep the battery charged, but some measures to lower the power consumption can already be taken.

 

Power Saving

 

Every bit helps when using battery powered applications. And though the Pi Zero isn't the most efficient choice, some tricks can be applied to lower its power consumption.

 

The first easy change, is to disable the onboard LED by editing the "/boot/config.txt" file and appending the following:

 

# Disable the ACT LED on the Pi Zero.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

 

The same can be done for the camera's LED, though that option exists within MotionEye, making it even easier:

Screen Shot 2017-07-30 at 14.39.30.png

 

As the Pi is running without monitor attached, the HDMI output can be disabled. This is done by adding a cronjob using "crontab -e" to execute the command upon reboot:

 

# Disable HDMI
@reboot /usr/bin/tvservice -o

 

Disabling any services that are not used may help as well. By default, MotionEye, enables things like Samba and FTP. These can be disabled via the GUI:

Screen Shot 2017-07-30 at 14.48.50.png

It's worth going through all options and disabling anything you don't require. The streaming settings can be adapted as well, as the camera doesn't necessarily need to stream all the time, or at full resolution.

 

Infrared

 

I also performed a test in total darkness, with the IR LEDs. They aren't super powerful, but it's enough to keep an eye on the chickens