The TFT screen I am using uses 3.3v for the backlight, I would like to use one of the PWM outputs to dim the backlight but given they are putting out 5v at full power I'm not sure how to go about it. I could probaly limit the output via the software but would leave myself open to a software glitch that might fry the backlight.
I am using the itead Studio 3.2WD with a Mega, can anyone suggest a full proof approach?
If I use a PWM output from my Mega to drive the baclight it will be giving me 5v or 0v, I can only assume the 5v will not be a good thing for the backlight even in short pulses.
Given that I'm am electronic genius I was figuring I could either put a voltage divider (2 resistors) or a regulator between the PWM output & the backlight, are these both bad ideas :~
So from 5v, you need a resistor around (5v-3.3v)/25ma=~60ohm. Pick something around that. Personally, I would pick a slightly lower value (47ohm for example) so that you have the option to get more brightness out of the led.
Simply put that resistor in serial from your pwm pin to the led, and you are done.
Before I posted I tried putting a resistor in series with a 5v supply & tested the voltage with my multimeter & it showed 5v, I'm assuming it still showed 5v because there was no load, only the multimeter?
Before I posted I tried putting a resistor in series with a 5v supply & tested the voltage with my multimeter & it showed 5v, I'm assuming it still showed 5v because there was no load, only the multimeter?
You have the right idea.
Your complete series circuit consists of the 5v supply, the resistor, and your multimeter. The multimeter has a very high 'input impedance' when set to measure voltage which means that it acts like a very large resistor as far as the power supply is concerned. This means that there is very little current flowing and therefore very little voltage drop across the series resistor. The result is that essentially all of the supply voltage is dropped across the multimeter and therefore the multimeter reads 5v.
The backlight dimming has worked, the 3.3v & 5v connections from the Mega to the Shield are still in place, the 5v goes via a relay which switches when I turn the system on.
I have bent the LED pin on the screen at 90 degrees, cut a small slot in the shield 40 pin socket so the screen still plugs all the way in. I have then soldered on a lead to the LED added 2 resistors in series/parallel, to get 54 ohms, put a plug on the end of the lead & plugged it into the Mega 7 pin.
I have written the code so the backlight turn on at a defined brightness & can be adjusted with the left button on the Apple Ring, when I put it into sleep mode the backlight dims to defined value & turns back up if the sleep function is aborted. When the system is turned off the backlight is lowered to 0 volts.
BUT, why is there always a but? For some mystical reason the addition of the backlight dimming is playing havoc with the remote reception. After much grief I finally go the remote working every time but now it is back to misbehaving, could it be something to do with the PWM voltage that is now in the system, any advice would be greatly appreciated.