Author Topic: Is it ok?  (Read 1440 times)

0 Members and 1 Guest are viewing this topic.

Offline msuffidyTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Is it ok?
« on: November 20, 2022, 05:28:17 am »
I got this idea tonight that I already wired up and I am not totally sure it is ok. I got this ESP8266 recently. So I had an Arduino nano. I had this IR LED with a resistor all soldered up with a value based on a 5V GPIIO. So I was thinking that if I connected a 5V to one side and the other to the GPIO when the GPIO is low that is a 5V path. I argued that with the 3.3V state, there would be next to nothing going through the LED and would appear off. The problem is this configuration usually has the same voltage when in the high state, like 5V. So there is a possibility of reverse flow in the high state of the GPIO. With the forward drop and a resistor like ah can't recall 100 ohms, is there any danger to this configuration?  I think how it works is the resistor basically converts any potential difference to heat, but in this case there could be a voltage divider kind of scenario in the ESP8266? Here is video recording of it:

https://www.facebook.com/100052965817466/videos/pcb.658734955902026/1338675976936546
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6093
  • Country: es
Re: Is it ok?
« Reply #1 on: November 20, 2022, 05:33:49 am »
Not ok, you'll be dumping 5V into the esp 3.3V power rail.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline msuffidyTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Is it ok?
« Reply #2 on: November 20, 2022, 06:26:29 am »
It was sort of ill conceived but I think the voltage drop of the IR led is greater than 1.5V, so 5-1.5V-3.5V which should be ok. Again the 5V I think is USB line and not outt of a regulator.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6093
  • Country: es
Re: Is it ok?
« Reply #3 on: November 20, 2022, 06:34:47 am »
Measure the drop voltage first. Needs to be 1.7V for this to be safe.
Why not use it like a normal output? Or a transistor?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: Is it ok?
« Reply #4 on: November 20, 2022, 08:26:15 am »
USB max Vbus is 5.5V.  Its rare for it to be that high, but many hosts and USB 'chargers' run their 5V supply a bit high e.g. 5.3V to compensate for typical voltage drops in USB cables.  Therefore its even worse than David suggests, and the LED Vf needs to be reliably over 2.2V (5.5V-3.3V), which makes the above circuit unsuitable for single IR LEDs (or indeed most other LEDs except ~3.0V Vf blue and white ones)
 

Online wraper

  • Supporter
  • ****
  • Posts: 17350
  • Country: lv
Re: Is it ok?
« Reply #5 on: November 20, 2022, 08:44:39 am »
It ok for high Vf LEDs such as white, blue and high brightness types of other color. However IR LEDs have the lowest Vf, so you shouldn't do this.
 

Online dietert1

  • Super Contributor
  • ***
  • Posts: 2255
  • Country: br
    • CADT Homepage
Re: Is it ok?
« Reply #6 on: November 20, 2022, 09:43:11 am »
Maybe the output to drive the LED can be configured as open collector drain. Then there will be an extra 0.7 V margin (from the output ESD protection diode).

Regards, Dieter
« Last Edit: November 20, 2022, 09:56:10 am by dietert1 »
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1661
  • Country: nl
Re: Is it ok?
« Reply #7 on: November 20, 2022, 12:04:08 pm »
It's not OK, but will probably survive for some time.

In principle for the LED it works: if you pull GPIO low, the resistor+LED has a good current path to GND and will conduct normally. However if the GPIO is driven high, assume the GPIO is at 3.3V. The resistor+LED is connected to 5V. Although the voltage drop across the LED may be say 2V, this is only at a reasonably large current of say mA's.

If the current is much less (say 50uA), then maybe the LED will only drop e.g. 1V. It's not an Ohm's law equation, but rather some exponential form, but the point is, some current will still go into the ESP32. The question is: is there somewhere for this current to go to? Well probably yes.. as the GPIO connects to the 3.3V (or otherwise through ESD diodes if the GPIO is an input), the ESP32 can "sink" this current to the 3.3V rail. Since the ESP32 in normal run mode consumes several mA, this small current leaking would mean the voltage regulator of the 3.3V rail would need to supply a bit less current (it's offset). This would not create any crazy voltages at the ESP32 chip itself that my destroy it. I bet if you measure the voltage at the GPIO set to 'high' it's still 3.3V, but I assume if you measure the voltage drop across the 100R resistor it may have some voltage drop (in mV's).

The problem with this configuration is when the ESP32 goes into sleep. If the ESP32 is in deepsleep consuming single-digit uA's, then this e.g. 50uA leaking to 3.3V will be enough to pull up that rail to a higher potential. A too high voltage will degrade the part over time. Voltage regulators may also not like it to see their output being lifted up. Worst of all: the ESP32 has a chance to enter a latch-up condition on power up, which can destroy the chip.
https://www.ti.com/lit/wp/scaa124/scaa124.pdf

Some MCUs have 5V tolerant I/O pins, but these only work for input or open-collector/drain mode. And there are no ESD protection diodes present. Those would be OK to use for this purpose, but otherwise, please don't :)  It's better to get a 5ct FET and switch the LED like that.
« Last Edit: November 20, 2022, 12:09:17 pm by hans »
 

Offline msuffidyTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Is it ok?
« Reply #8 on: November 21, 2022, 07:49:05 am »
Well thanks everyone. I was mostly just doing a general test that time with 1 of 2 of those I have. I did the test on the more scruffed up one with my soldering. I will consider these issues in the future. I am not doing anything with it until I need to then I will deal with the 5v or 3.3 volt requirements. I would probably deal with a 5v requirement by using the 3.3 gpio as a switch to the 5v line using a transistor.
 

Online wraper

  • Supporter
  • ****
  • Posts: 17350
  • Country: lv
Re: Is it ok?
« Reply #9 on: November 21, 2022, 09:35:44 am »
You can just use 3.3V for powering the LED. There cannot be much of additional load on LDO anyway since GPIO of ESP8266 is rated to 12mA max. You would need to use 5V only for high Vf LEDs.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7615
  • Country: nl
  • Current job: ATEX product design
Re: Is it ok?
« Reply #10 on: November 21, 2022, 10:05:53 am »
Your LED will never be off. Use a transistor, they are simple and cheap.
 
The following users thanked this post: woofy

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16349
  • Country: za
Re: Is it ok?
« Reply #11 on: November 21, 2022, 10:21:44 am »
If you are really wanting to do this, accept that you will need to add 3 silicon diodes (1N4148, or pretty much any cheap silicon diode) in series with the LED, and also add another schottky diode from the pin to Vcc of the microcontroller, so as to bypass the built in ESD protection diodes, which are not really rated to carry current other than ESD events, and are rated for less than 1mA in case you actually turn them on. That then makes sure the IR LED will actually stay off when the pin is high, or at least will only run at a very low forward current and light output, and that the IO pin will not conduct current to Vcc when high impedance via those ESD protection diodes. The extra voltage drop will just reduce current when the pin is low, which if you are using as optocoupler drive, or close range use, is not a worry in most cases.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf