External led not working

November 25, 2023, 08:13

berrygt_

I’m so stressed out rn I suck at doing this and I’ve been doing it all day! I’m trying to control my Christmas lights via Pico, the code is executing but not the lights. Is it a problem with the bread board, the lights or the code?

berrygt_

And code ⬇️⬇️⬇️

null

Current cannot flow if the system is not closed to GND!

null


null

LED1: Light-emitting diode, red, yellow or green R1: Resistor, 470 Ohm (yellow-violet-black-black) Connect the anode (long connection) of the LED to the GPIO pin. Connect the cathode (short connection) of the LED to the resistor. Connect the other side of the resistor to the GND pin.

k9t33n

search a little about "pi pico gpio layout" you need one side of the led to connect to put 20 and the other to a ground pin as melinux mentioned. and obviously have some resistor on either side

k9t33n

you could just copy mellinux's picture and it should work

k9t33n

if it doesn't tell us

oops.se

If you have a red LED and is driving it with 3.3 volt, then vould the current limiting resistor be in the range 75 - 120 ohm.

oops.se

And most likely you will need some kind of driver if you want to control a Christmas light. The reason for the need of the driver is that a Pico I/O can only drive one LED (12mA). If you need help with a controller then you need to provide details about the Christmas light.

k9t33n

it'd work the same

k9t33n

as long as the led is DC and isn't too powerful, I assume it's not so your probably fine

k9t33n

and change your code to put the led on pin 17

k9t33n

do you know how to do that?

null

You should urgently learn how electricity works. If I stand on insulation, I can touch a 240 volt cable and nothing will happen. But if I put my foot on earth (GND), the current will flow and kill me. Hope you understand it like that?

k9t33n

basically current needs a complete circuit

k9t33n

the gpio is just a pin which can control its power (among other things) it needs to be connected to the ground for the circuit to be complete

berrygt_

Ok thanks

berrygt_

Do I just plug the jumper wires into where the light would be?

k9t33n

yes