Wouldn't AC mode measure current above and below neutral, basically 2 readings and then adding them?
That might explain why your reading is twice as high on AC.
(total guess)
Robert
Wouldn't AC mode measure current above and below neutral, basically 2 readings and then adding them?
That might explain why your reading is twice as high on AC.
(total guess)
Robert
Rapidly switching DC on & off (PWM) is a square wave. It's still DC.
If you vary the duty cycle from 50% it will look different, but we still call that a square wave.
You can measure the current with LEDs running constantly for a single row like it sounds like you're doing.
If it's a POV display where you cycle rows, then no more than one row (or column depending on how you look at it)
is going to be powered at one time, so you can assume the total of the switching transistor and LEDs for a
single row is the maximum current that your display will draw.
Be careful trying to measure PWM with a digital multimeter.
The digital multimeter is a microcontoller too, and can only take samples at a certain rate that is not synced with your PWM.
I believe the best insurance against software failure is your watchdog timer.
The best place to clear it is in your display routine that cycles the rows.
Depending on complexity, I suppose some insurance against hardware failure is also prudent.
![]()
Last edited by Art; - 31st December 2013 at 02:35.
The PCB has 12 LED's in parallel. Not sure I completely follow your comment but I'm trying to validate how much current I'm saving by decreasing the duty cycle/frequency. I have an oscilliscope if there's a good way to measure the current with it.
I've never used the watchdog timer but assume it checks the continuous loop that's running inside the PIC. If so, what happens if the ULN2003 fails or my power supply fails (overvoltage or overcurrent)? The LED's aren't expensive to replace but they are a PITA to access. I want to avoid replacing them at any cost.
That's the benefit of hardware failsafe. Something could break to leave an LED on,
but the watchdog timer is still the cheapest and most effective on the software side.
If your display routine fails to cycle, the watchdog should be on an independent timer,
and fire even if, for example the chip's oscillator shorted.
If you have rows of 12 LEDs parallel, that means they can't be independently controlled
for graphics, etc. You are just cycling whole rows of LEDs?
The current can still be measured at 100% duty cycle, and as you lower the duty cycle,
the average current should lower approximately with the duty cycle.
Transistors have cut off slopes, so it's not extremely precise. Someone else may have to chime in about that.
However, just because you use say 50% duty cycle, the fact remains that the row of LEDs and hardware to drive
them are using the same current for half of the time, and no current for the other half of the time.
That's if you negate a little error for the actual switching on and off, but I don't know exactly what the cost is there.
It's not for graphics. I am testing a number and the 12 LED's are one segment of the number.
I did some testing tonight but things still aren't clear for me. I will post the results below and maybe someone can derive something useful from this information. Brightness (how the user views it) is the ultimate test so I put a photocell on top of one LED and wrapped it in black electrical tape. I took random measurements with a bunch of tests using only PWM and the other using straight DC with a resistor. For clarification, the lower the resistance the higher the brightness.
I don't see much of a difference between PWM and using a resistor.Code:LED'S ON ON TIME OFF TIME CDS Resistance DC Current AC Current Resistor 1--------- 5uS 740 uS 92.2 Ohms 36.4 mA XXXXXXXXX No XXXXXXXXX 2---------- 5uS 740 uS 94.2 Ohms 41.3 mA XXXXXXXXX No XXXXXXXXX 3---------- 5uS 740 uS 98.3 Ohms 52.6 mA XXXXXXXXX No XXXXXXXXX 1+12 LED's 5uS 740 uS 150.4 Ohms 49.9 mA 189.3 mA No XXXXXXXXX 1+12 LED's 5uS 640 uS 141.2 Ohms 57.2 mA 214.2 mA No XXXXXXXXX 1---------- 5 uS 940 uS 118.4 Ohms 27.2 mA XXXXXXXXX No XXXXXXXXX 1---------- 5 uS 1140 uS 128.6 Ohms 23.5 mA XXXXXXXXX No XXXXXXXXX 2---------- 5 uS 1140 uS 133.5 Ohms 29.6 mA XXXXXXXXX No XXXXXXXXX 3---------- 5 uS 1140 uS 133.6 Ohms 37.2 mA XXXXXXXXX No XXXXXXXXX 1+12 LED's 5 uS 1140 uS 194.8 Ohms 33.4 mA 159.7 mA No XXXXXXXXX 1+12 LED's 5 uS 1240 uS 203 Ohms 31.3 mA 154.6 mA No XXXXXXXXX 1---------- 5 uS 1240 uS 127 Ohms 21.5 mA XXXXXXXXX No XXXXXXXXX 1+12 LED'S 100 0--------- 109.2 Ohms 94.2 mA XXXXXXXXX Yes 29.6 Ohms 1+12 LED'S 100 0--------- 117.3 Ohms 79.9 mA XXXXXXXXX Yes 35.6 Ohms 1+12 LED'S 100 0--------- 136.1 Ohms 64.7 mA XXXXXXXXX Yes 44.5 Ohms 1+12 LED'S 100 0--------- 159.4 Ohms 49.3 mA XXXXXXXXX Yes 59.3 Ohms 1+12 LED'S 100 0--------- 201.6 Ohms 33.5 mA XXXXXXXXX Yes 89 Ohms 1+12 LED'S 100 0--------- 310.2 Ohms 17.1 mA XXXXXXXXX Yes 178 Ohms
Pretty much the same thing I observed.
Brightness requires current, I don't think you can get around that.
Maybe if you start tinkering with transformers?
Robert
Is this statement correct?
Even though the currents are similar, using PWM without a resistor must be more efficient since a resistor isn't being heated.
Another thing that doesn't make sense is the non-linear curve in current when adding diodes onto the PCB. One LED consumes 30mA but two doesn't equal 60.
Bookmarks