I want to build a motion sensing bathroom night-light. I am using a brand new redboard, protoboard, IR motion sensor and an extra bright white LED (no spec I am afraid)
I am not getting enough brightness out of the LED. The LED is connected to D7 via a trim pot. Adjusting the trim pot seems to have no effect on the dull brightness of the LED. I am measuring about 1mA thru the LED.
D6 gives the same result. D0 has a bit more brightness but still disappointing, and I discovered it is part of the serial link when upload stopped working. I have a 2nd brand new red board which behaves the same
If I put the LED across 5v VCC then 80ohms gives about 20mA and the LED is very bright
My understanding is that a digital pin is good for 20mA. So why am I not seeing it?
The trim pot is a variable resistor. So depending on its value it will reduce the current through the led. Usually the trimpot values are much higher than 80 ohms, so it will reduce the current even further. How did you wire this up? It matters how it is hooked up.
For larger currents you would want to use a transistor to supply the current to the led and switch this. For stable and fixed brightness you would need a constant current led driver circuit.
Is that 1 ma you measured with your current meter at the low end of it’s resolution scale? Or was there another significant digit lower on the display? If the pin was set as input with internal pull-up resistor then the current supplied through the pin would be even lower but might register as that.
You did’n’t use analogWrite to set a PWM pulse train, right?