Asked — Edited
Resolved Resolved by ptp!

Ezb And Leds

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.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

#2  

@leonardo46 The max current of the ezb4 digital pin is 10mAh (as per Jeremie)... Jeremie has also mentioned that each digital pin has a built in current limiting resistor... My under standing is a basic 3v run-of-the-mill LED can be plugged in directly to the ezb4's digital pin without a resistor of it's own... Saying that I can't speak for the LED that you have...

PRO
USA
#3  

@Leonardo,

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)

#4  

I do not believe it is safe for him to drive that LED. It draws 70 mA which is too much for the EZB. IT will burn out the channel it is plugged into.

From what I understand don't use an LED that draws more than 10 mA unless you use a switching transistor or something.

#5  

OK. So I can even short circuit the pin without the risk of damage. 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.

PRO
USA
#6  

@Perry_S

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.

PRO
USA
#7  

Part II: Led full details

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:)

#8  

Perfect, PTP. You solved the question and provided great detail. It's useful for everybody. My tests confirm everything. By the way, how can I blink for some time the led ? EZB scripts don't have something like the "do" in basic.

PRO
USA
#9  

# forever loop
:loop
  ToggleDigital(D0)
  Sleep(500)
goto(loop)


# 10 times
REPEAT ($x, 1, 10, 1)
  ToggleDigital(D0)
  Sleep(500)
ENDREPEAT

#10  

PTP, to be precise, your calculations give a of current of 5.2 mA ( not 0.52 mA)

#11  

Thanks again PTP. I'm an hardware designer and Basic and assembler programmer, but I'm very ignorant about EZ scripts. I didn't know the existence of goto , repeat, etc. in EZB.

PRO
USA
#12  

Leonardo,

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) :)

#13  

Hi, PTP. 120 mA is an "absolute maximum rating " for the MCU power pins. 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 .

PRO
Canada
#14  

@PTP thanks for the accolades! One minor revision to your calculations. The resistors are actually 330Ohm.

@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.

PRO
USA
#15  

Jeremie:

you are the hardware authority:) so is always a pleasure when you get along in our conversations.

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.

PRO
Canada
#16  

@PTP Thanks! I should mention that I personally really appreciate your presence here in the forums, you have been extremely helpful to so many people and you deserve all the accolades!

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;)

#17  

Hi, everybody. Thanks to Jeremie. 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 fuseshttps://synthiam.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 .https://synthiam.com/emicons/emo_smile.gif bye everybody.