
leonardo46

I wish to control LEDs by EZB .
I saw in a tutorial leds connected directly to digital outputs without current limiting resistors. The leds I'd use sink 70 mA at 3,3 V . I don't think EZB could withstand such currents !
EZB specs only say the pins are TTL compatible but don't say what's the allowable current (high and low level). What's the allowable current ?
I'd add current limiting resistors if necessary.
I'd be disappointed burning out my EZB controller.
25 ma
micro-controller (STM32F205RET6) datasheet:
http://www.mouser.com/ds/2/389/stm32f205rb-956262.pdf
check page 72
Richard is correct.
1) The micro-controller specs are 25 ma.
2) EZB controllers have a resistor in serie (333 330 ohm) between the micro-controller pin and the digital pin.
If you look the pcb :
(smd resistor green block) number 331 => (33 * 10^1 = 330 ohm)
For 3.3 v (digital output) you have:
I = V/R => I = 3.3 / 333 330=> I = 9.9 10 mA
So it's safe to drive the led without a resistor.
@Jeremie: Nice design !
*** Edited corrected after (post #15)
From what I understand don't use an LED that draws more than 10 mA unless you use a switching transistor or something.
I can't use the 25 mA available, but it's good to have a built-in protection.
My leds, @ 3.3 V , with a 330 ohms resistor in series, would draw only 4 mA (instead of 70 mA) making a weak light, but it could be enough.
Thanks to Richard and PTP, who was more specific in solving my problem.
There are different types of Loads, leds are pretty specific.
There are two details: forward voltage and current
It's the forward current that determines the brightness of an LED
If you have 70 ma led, means that is the limit and the peak for brightness.
Summarize:
70 mA Led to an EZB pin (10 ma) => 1/7 of brightness.
20 ma Led to an EZB pin (10 ma) => 1/2 of brightness.
5 ma Led to an EZB pin (10 ma) => will damage the led
*** Edit:
This is the simple mode (one variable = current) but there is another variable:
led forward voltage.
EZB:
Pin output: 3.3 v
Pin resistor: 330 ohm
Led Details:
Forward Voltage: 1.9 v
Max Amps: 10 ma
I = V/R
I = (3.3 - 1.9) / 330 => 0.52 mA 0.0042 A or 4.2 mA
So the current is 0.52 mA 0.0042 A or 4.2 mA
that's ok for a 10 mA led (half bright)
but it's not ok for a led with max 4 mA
1 mA = 0.001 A
*** Edited:
Leonardo post #11
Changed the numbers, the formula is ok, the numbers way off
By the way, how can I blink for some time the led ? EZB scripts don't have something like the "do" in basic.
Code:
Code:
Thanks for the correction, I've adjusted the numbers to match an example.
Another important detail from the micro-controller datasheet (page 72)
Total current out of the micro-controller should not exceed 120 mA (the value includes the micro-controller itself)
it's my interpretation, so what happens if you pull more ?
Does overheat (EZB has a heat sink). I don't know.
maybe is not a good idea to connect 12 leds (10 mA)
It must never be exceeded, or it might be destroyed at once, or availability will be impaired. Operation under these conditions is not implied.
Normal operating current is 80 mA (EZ datasheet), so there are less than 40 mA to work with. The EZB designer has provided 333 ohms resistors to limit this current.
I'm aware of this , and I'll never use more than a few leds.
There are other absolute maximum ratings for the chip concerning voltage, power dissipation and ambient temperature. But the EZB user is not likely to exceed these ones .
@Leonardo46 the normal operating current for the entire EZ-B v4 is 80mA. This means that the WiFi module, audio circuit, and main MCU all draw 80mA combined. The WiFi module draws the most since it has a radio transceiver built in. This gives you a lot more room to drive LEDs with the main MCU. With the voltage drop across LEDs the current draw in reality is less than the theoretical calculated value of 10mA. While I would definitely use a transistor to drive a 70mA LED; the EZ-B v4 can drive a bunch of standard, run of the mill, 5mm LEDs.
you are the hardware authority
Regarding the 120 mA it's from the STM32F205 datasheet.
The EZB v4 includes a heat sink.
So the question is if you hypothetically source 12 pins @ 10 mA = 120 mA, reaching that limit (without the MCU itself) what can happen to the STM32F205 MCU ?
1) Gets more heat but still works and you can damage it (if the extra heat is not dissipated) ?
2) Does the chip brownout ?
3) Turns black dust
It's pure curiosity...
like you said the proper way to drive a bunch of leds or different loads, is a switching transistor.
To answer you question:
In an over-current situation (drawing 120mA or greater) the MCU usually goes into thermal shutdown. This scenario often looks like a brown-out since we have a heatsink on the MCU that cools it quickly so that it bounces back into operation right away. In theory all should be fine, you'll just notice the MCU resetting if you draw too much.
That being said, I would not recommend depending on the internal fail safe of the MCU. As you are likely already aware, too much stress on electronic components does not produce favorable results
EZB specs say: current draw : 80 mA , including everything that's in there (wifi, etc.) with nothing connected to external pins. The current drawn by the MCU itself should be around 30-50 mA (look at the MCU specs).
So there is much current to draw from the pins before approaching 120 mA in the MCU itself.
But everybody should remember that this is a stress rating. The chip might be destroyed well before a thermal sensor could protect it. The internal wires in the chip would act as fuseshttp://www.ez-robot.com/emicons/emo_biggrin.gif ! Read MCU specs pages 71-72, ( absolute maximum ratings). The thermal protection will work for the overheathing of the whole chip.
My high luminance leds draw 70 mA @ 3.3 V without limiting resistors, but the internal 330 ohms resistors contained in EZB limit the current to 4 mA only, still producing enough light .http://www.ez-robot.com/emicons/emo_smile.gif
bye everybody.