Dimming LEDS With a single pin

Hi! Newbie here, so please excuse any confusing wording!

I’m looking for a component with super bright white LEDs that works as a dimmer using only a single pin on the Pi. I have other things connected to some pins and I’m trying to find a solution for doing this without pulling too much, so it could be powered separately and only use a single pin to control the dimming.

This is to provide a light source for the Pi to take a well lit photo and then going back to dark.

Looked through Core’s online catalog but couldn’t find something like this.

Thanks in advance!
Daniel

Hi Daniel,

Raspberry Pi doesn’t have an onboard Analogue to Digital Converter (ADC), so you’ll have to use a workaround if you wanted to use a standard potentiometer.

As you’ve likely found by using automatic exposure/brightness modes on the camera, you won’t get any better quality without more light. I wonder then if you could tinker with methods to determine brightness (of the camera itself) and adjust an external LED/light automatically with a MOSFET such as this module (no other inbetween hardware):

Closer to your original idea and within the limitations of a RPi (no ADC) would be the use of a Rotary Encoder. You’ll never know the “start” position of the encoder, but that seldom matters. Rotating it clockwise can be made to increase brightness, vice versa.

There are plenty of guides online, such as this:

Hi Graham, thanks for your reply!

I didn’t know about the lack of an ADC, so that is going to help me a lot when think of future applications for the PI.

The MOSFET Power Control Kit seems to be a great solution for doing this, as I’m looking for a solution to drive the LED brightness from code, not by using a potentiometer or something similar.

My camera is configured to take the photo without setting up the brightness/exposure on its own, the lighting conditions are expected to be the same each time. The reason for dimming gradually is because it will take face portraits of people and thought it would be nicer if the LEDs turn on gradually.

I was wondering if there is a LED light bar or something similar with this kind of functionality already built in. If I can’t find it, the MOSFET kit will work out.

Thanks for your support!