11

I have a need to take photos with the Pi camera, but to illuminate the subject. The subject will be 1m or so away, but will be in total darkness most of the time. Therefore, I need a flash of some kind.

I'll only be taking a picture every hour or so. I was thinking about either:

  • A USB LED lamp (but I won't be able to turn this on/off with my Python script)
  • Some super bright LEDs linked to the GPIO pins that can be switched

Has anyone done something similar and care to share their experiences and parts list?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
fistameeny
  • 211
  • 1
  • 2
  • 3

3 Answers3

6

I'd be tempted to go for the bright (white) LED solution. It's not something I've tried and I don't know if there will be colour balance problems.

The LEDs will likely source more than the (safe) 50 mA you can take from the Pi 3.3V rail.

I suggest you use a chip such as ULN2003A or ULN2008 to actually drive the LEDs. That way you can feed the LEDs from the 5V rail and switch them on using the Pi's gpios.

You could common up a gpio output to drive more than one ULN input. However as you don't have a pressing timing problem you might as well use a separate gpio for each LED. Using separate gpios will allow you to have coarse brightness control (by changing the number of LEDs lit).

joan
  • 71,852
  • 5
  • 76
  • 108
4

I'd try using several infrared LEDs, as CMOS sensors on usb webcams are also sensitive to infrared light. Depending on the size of the surface to be photographed, it could be enough with 3 or 4 of them, so it is worth to test this configuration. This setup has these advantages:

  • Directly manageable by a single transistor driven by a GPIO pin, and a resistor per led, so the circuit to build is very simple.
  • With a reduced amount of standard LEDs, you can use the same RPi power source (count some 30mA per LED if using a 330 Ω resistors, so you need some additional 120mA).
  • There is no visible light so you don't freak out people with an intermitent light. Hey, you can even have them always on, it would be a waste of energy but that circuit would be really really simple...
  • Gerben
    • 2,420
    • 16
    • 17
    Roberto
    • 358
    • 2
    • 10
    3

    This has its own battery pack and can be triggered by providing a voltage to the hot shoe pin (centre pin) which can be driven by GPIO connected to a transistor/ buffer/ octocoupler to be safe.

    Our friends at Electronics stack exchange can provide you with more details.

    Essentially the hot shoe has a pin that says the flash is ready- in the case of LED its always ready unless battery is dead. And the hot shoe uses some kind of mechanism to close the hot pin to GND which will turn on the light.

    Here is a fairly simple example using an octocoupler.

    Some of these LED Flash rings can provide constant light while the pin is pulled. Usefull with movie mode on most cameras.

    enter image description here

    Piotr Kula
    • 17,336
    • 6
    • 66
    • 105