I have a question to which I can't find any answers... I have in my possession arduino ESP8266 with which I have already programmed a lot of things but here I would like to recover leds from an old coffee machine ... The problem is that the 5V+ is connected on all the leds (printed circuit that I keep) and when I have an output with HIGH or LOW as variable it's 5V+ that comes out of my pins. So I can either turn them all on or off by linking all the GDNs but I would like to be able to control them one by one. Is there a solution to get out of the GND on the output pins and to be able to choose the ON/OFF as HIGH/LOW?
Yes, it is standard practice to use an output pin as "ground".
You must use a current limiting resistor with an LED, and obey the restrictions on pin current. Check the ESP8266 data sheet for the allowable maximum current into the pin (it may be the same as "out of the pin").
Ok, thank you for your positive response . I reused the resistors that were on the pcb and I'm sure the leds don't exceed the current limit of the arduino... Can you give me an example of a start of code for how I should I do to be able to do my ON/OFF with GND? I will understand it very quickly and will adapt it to my project but I don't know at all what I have to put to do that with the GND...
Hi,
Are you wanting to connect the LEDs that are powered by the +5V pins of the ESP8266?
I don't think it's very safe, despite the current limiting resistor, even so when in HIGH, on the pin you will have +5V,
The ESP8266 datasheet states that the maximum voltage on the ESP8266 I/O pins is 3.6V.
" I/O VIL/VIH -0.3V/0.75V 0.25V/3.6V "
Yes! Thank you very much .
The sketch looks exactly like what I have.
But how can I turn off the leds? I will not send HIGH? It will create a short circuit, right? Or do you have to send HIGH to turn off the led? Can you tell me more please?
Yes...
But I can use an external 5V+ input, I think that's what I'll do, but know that I've already tested with 5 of the 9 LEDs on and there were no problems. And I will never have more than 4 lit at the same time for my project. So no risks at this level .
I always use them in 5V and I never had any problems for my part . But I can try in 3.3V, it costs nothing to test...
Yes I know, a friend sent me the book "The Arduino for Dummies" and I'm going to read it. For the moment I haven't really learned anything yet, I watch, I analyze and I create according to my projects that come to mind. I don't have any in-depth knowledge of this .