Raspi BirdBox Advice

Hey there gurus.

I’m hoping for some advice on a little project I’m embarking on. My 6 year old son has recently become fascinated with the Rainbow Lorikeets that regularly visit our back verandah, and subsequently commissioned his pop (who’s a little more handy than his dad) to build him a nice Lorikeet bird box.

To make it a bit more fun, I was hoping to install a camera and stream live video, so we can keep an eye on who’s moved in and what they might be getting up to.

I’m pretty familiar with developing solutions with Raspberry Pi’s so I figured I’d go with a Raspi Zero 2 W, NoIR Camera and the official case which can house the Pi and the camera.

What I’m a bit unsure of is:

  1. Do I need some additional light source for the camera? - something like this perhaps Super-bright 5mm IR LED - 940nm | Buy in Australia | ADA387 | Adafruit | Core Electronics which could be triggered by the GPIO pins

  2. What is my best option to power something like this? Ideally I’d like to run this constantly off solar power, so I don’t need to run power to it (as it will be installed outdoors, up a tree). I assume I’ll need a small solar panel, battery and a controller of some sort to make this work, but any help with exactly what those parts would be (based on power requirements etc), would be greatly appreciated.

  3. What’s the best software / script / library out there to stream the live video to our local network. I (preferably) just want to be able to view the activity from a web browser on a phone, tablet or PC. If the camera setup could be triggered by someone accessing the live feed, that would be ideal, especially from a power saving perspective.

Thanks in advance.

2 Likes

Hey @Shane53869,

Welcome back to the forum!

Sounds like a brilliant project, your son is going to love it. Great idea combining some wildlife watching with a bit of fun tech.

Camera and Night Vision
The NoIR camera is great for seeing in low light or at night, but you’ll need a small infrared light to help it “see” when it’s dark. This one works well:

You can start with the IR light always on at night, which is easier than wiring it to turn on automatically. Later on, if you want to get fancy, you can set it up to turn on only when someone accesses the video feed or when motion is detected, to save power.


Powering It with Solar
Since you want to run this outdoors and off the grid, using solar power is a good choice and saves having to run cables up your tree. Instead of building a custom setup, you can use Core Electronics’ PiJuice Zero system, which is designed to make solar power for Raspberry Pi easy and plug-and-play:

This setup is basically plug-and-play, no complicated wiring needed. The solar panel charges the battery, and PiJuice safely powers your Pi Zero 2 W while managing the battery. It even has software that can turn your Pi off at night or when the battery is low to save power.

For a step-by-step guide, Core Electronics has a helpful tutorial here:


Streaming the Video
For streaming the live video over your home Wi-Fi so you can watch on a phone or computer, MJPG-streamer is simple and works well. Another option is motionEyeOS, which has extra features like motion detection.

Both let you view the live feed in a web browser.

If you want to get more advanced later, you can set up the camera and IR light to turn on only when someone is watching to save power, but starting with continuous operation will be much easier.


Other Tips

  • Make sure your case protects the Pi and battery from weather but has some airflow so it doesn’t overheat.
  • Test everything indoors before mounting in the bird box.
  • If Wi-Fi is weak where the box will go, a Wi-Fi extender might help.

Looking forward to hearing how it all goes. It’s a fun project and a great way to enjoy nature and technology together.

1 Like

Wow Ryan, thanks so much for getting back to me so quickly.

And with such comprehensive answers to all my questions there mate!!!

2 Likes

Hey @Shane53869,

No trouble at all, that’s exactly what we’re here for! Excited to see this project take shape, and we’d love to hear how it all turns out, so keep us posted.

1 Like

Hi Ryan,

Thanks again for all your help.

This might be something that’s a recent change but it looks like you guys have retired the PiJuice Zero. I just wanted to confirm that the recommended replacement, the Witty Pi 4 L3V7 will serve the same purpose in this scenario. If so, would you also recommend using this battery Polymer Lithium Ion Battery (LiPo) 18650 Cell (3.7V 2600mAh, Solder Tab) | Buy in Australia | CE04625 | Core Electronics listed on the product page.

Also, do you think would this be a suitable solar panel choice for this application - Solar Panel Charger - 10W | Buy in Australia | PRT-16835 | Sparkfun | Core Electronics. If not could you recommend a 6W and a 12W option as listed in your original message.

And finally (sorry if this is a dumb question), how does one wire up the IR LED if there is no access to the GPIO pins on the Pi zero, since the power management board plugs in on all of the headers.

Thanks

1 Like

Hey @Shane53869,

Thanks for the follow-up. You’re right, it looks like the PiJuice Zero was officially retired just yesterday. The Witty Pi 4 L3V7 is a good alternative if you’re looking for time-based power scheduling and safe shutdown functionality, though it doesn’t include solar charging like the PiJuice did.

To power your setup from solar, you’ll need a dedicated LiPo charge controller. This Solar LiPo Charger (3.7V) is a great option and is designed to safely charge 3.7V LiPo cells from a solar panel or USB input.

As for the battery, the 3.7V 2600mAh LiPo 18650 cell with solder tabs that you mentioned is a suitable choice. Just ensure it’s connected with a JST-PH 2-pin connector and that the connection is secure with appropriate strain relief.

The 10W solar panel you originally linked is compatible. For completeness, here are two other panels that also work well with the above charge controller:

If the GPIO pins are obstructed by the Witty Pi or another HAT, there are a few ways you can still connect an IR LED:

Use a stacking header
This lets you physically stack the Witty Pi while still exposing the GPIO pins underneath.

Connect directly to the Pi’s 5V and GND rails
If you don’t need to control the IR LED, you can power it directly from the 5V pin with a suitable current-limiting resistor. This keeps it on whenever the Pi is powered.

Hi all,

Thanks so much for your help and advice so far. I’ve finally managed to find some time to purchase and put together my little bird box project.

It still pretty early days, but I put the pi together with the camera in a Pi Hut Camera Case (The Pi Hut Pi Zero Camera Case | Buy in Australia | CE07178 | Core Electronics), and managed to get a stream up and running.

I’ve also managed to integrate one of these LEDs into the case. I’m just not completely sure what size resister I need to run this off one of the Pi’s GPIO pins. My basic electronic knowledge tells me that when calculated a 17 ohm resister is what I need (Forward voltage of the LED is about 1.6V and the Continuous forward current is listed as 100ma on the spec sheet).

Google says that 100 mA is quite high for a Raspberry Pi GPIO pin. Most GPIOs are rated for a maximum of 16 mA, and exceeding that can damage the Pi.

Just wondering what I should do here, to ensure that I don’t break anything but still get sufficient brightness through the LED to see in the (relative) dark.

Thanks again.

1 Like

100mA is far too high for a Pi GPIO port. A typical small LED is about 15mA, but generally you wouldn’t want to drive a Pi GPIO port at more than about 10mA. And don’t forget that there is a maximum overall figure, so you have to consider what else is connected to the Pi.

There are simple single-transistor circuits that you could assemble for driving a LED at that current, but perhaps the easiest approach is a dedicated LED constant current controller:
Adafruit TPS61169 Constant Current Boost Converter for LEDs | Buy in Australia | ADA6354 | Core Electronics

That module has the advantage that it would be usable with a range of different LED configurations so that you can experiment to get the best effect.

1 Like

Thanks Jeff, for sharing your knowledge and advice. Very much appreciated. I realise now that I didn’t provide a link to the IR LED I’m looking to use - Super-bright 5mm IR LED - 940nm | Buy in Australia | ADA387 | Adafruit | Core Electronics

Given that this will be the only LED attached to the Pi for this project, I suppose I could try running it at 10mA to see if would suffice for the application. It’s worth noting too, that it wouldn’t be powered on all the time. My intention is to start the camera stream and illuminate the LED only when a client connects to stream.

It does however, sound like the little Adafruit current booster you recommended is probably the go.

There is also the possibility that I’m not interpreting the spec sheet correctly for the iR LED which is here: Microsoft Word - IR333-A.doc

Thanks again.

2 Likes

Interpreting that data sheet is not easy. The Absolute Maximum for continuous operation is 100mA. But the absolute maximum figure for a device is usually well above the recommended operating conditions. The table has a footnote “Pulse Width≦100μs and Duty≦1%” but that appears to apply to the 1A Peak-Forward Current rating (although the asterisk is missing), so it’s not clear what typical usage at 100mA might be. The electrical parameters are provided at 20mA (presumably continuous), 100mA at a Pulse Width≦100μs with duty cycle ≦1%, and 1A at Pulse Width≦100μs with duty cycle ≦1%. Other figures are quoted at 20mA. But the operating conditions chosen for these references are often arbitrary and may not reflect the available operating envelope. The description of suitable applications and the very narrow beam angle suggest that it is primarily intended for IR detection, not IR illumination. That doesn’t mean it is not suitable for IR photography, but it does make interpreting the data sheet difficult.

The advantage of the adjustable boost converter is that you can try different settings. How hot the device gets in the actual operating conditions is a good guide to how long it is going to last.

2 Likes

Thanks again Jeff for the comprehensive response. Very informative.

I’ve gone ahead and purchased little Adafruit current booster you recommended previously, and this might sound like a dumb question but does this device provide the resistance in the circuit based on the required current you dial up on it, or do I still need to wire up a resister?

Also, I’m guessing the wiring is simple - ie. GPIO pin and GND on the Pi → + / - Terminals of the current booster (3-5Vin), then + / - (CC Out) out to the matching sides of the LED?

Thanks in advance.

Yes. The resistor is a substitute for a constant current source that works OK for simple cases but can be difficult to use with more complex configurations. The constant current source does what a resistor does but with much better control. It also gives you the ability to quickly test different configurations just by flicking the switches.

Note that the PWM input (in the header row) is described as enabling dimming for the LED, but it works just as well to simply turn it on or off - this is what you will use with the Pi. For testing without the Pi, if the LED won’t light you may need to connect this pin to either the Vin+ or Gnd pin. The input side will be a 3~5V source (+) and ground (-). This source could be the Pi 3V pin, or the 5V supply you are using for the Pi. Ground is the common ground used for the Pi and the supply. Then the LED is wired to the output terminals + and -. There is no need to connect the output - to ground.

The switch configuration is simple. With all switches off it will deliver 25mA. Each of the switches can then be turned on individually or in combination to add the indicated additional current, so with those combinations you can set it to any current between 25mA and 400mA in 25mA steps.

When connected to the PI, with the PWM header pin wired to a Pi GPIO port, you can set the GPIO output HIGH or LOW (I am not sure which is ON and which is OFF) or you could get fancy and drive it with PWM to get full control over the brightness.

1 Like