I've been searching Google but not finding quite the answer.

I’ve been searching Google but not finding quite the answer.

I’m trying to switch a 2n2222 transistor just to blink an LED and confirm it’s all working before using it for anything grander. The exact breadboard circuit that works with an Arduino UNO won’t work with my NodeMCU esp8266.

Literally just moving my one jumper wire to the other microcontroller’s pin stops it from working.

Did I overlook something in the NodeMCU data sheet? Does it not output enough juice or something? It appears other people have it working but mine just doesn’t.

May be 5V (Arduino) vs 3.3V (esp8266) output levels. You may need to adjust the resistors in your schematic.

I assume both microcontrollers share the same power/ground input connections, or you move those too?

I assume you are also using the ground pin from the NodeMCU.

I don’t see a schematic anywhere but I agree with the two comments above.

You haven’t told us what color of led or what voltage is driving the transister’s CE junction.

My guess is that you are using a white led or a blue led and you are driving the transister from the 3.3V supply. Try a red led, or drive the transister from a 5V supply (or higher).

White and blue led’s have a voltage drop of about 3V. Add the voltage drop of the EC junction to that, and it will likely be more than 3.3V. And thats assuming you’ve got the led between supply and collector, not between emitter and ground. Red leds have a drop of around 1.6-1.7V.

2n222 needs a base voltage of 5v. Try using some other transistor or MOSFET.

This is a silicon transistor, it should switch on with Vbe of about 0.6 volts. 5v story is the max you can apply. Esp can easily supply this current.

What is the value of the pullup resistor on esp output?

I slept on it and realized I was just being dumb and hadn’t switched the ground over when I changed boards.

I knew it had to be an easy mistake but just couldn’t find it yesterday.

Thank you all!

the esp delivers 3.3v output voltage. use a low lowpower led with http://series.resistor and it will blink without the use of a transistor.

@Frans_Nissen The point of the exercise this time was to use the transistor, the LED is just a cheap test load to keep me from breaking something more expensive when I do something stupid.

I guess I should fill in broader context… I’m new to the electronics tinkering and less new to the programming/coding portion.

I was attempting the, apparently broken, example from “Make: Electronics” for introducing a transistor into the mix. I have a breadboard power supply I was using and wanted to learn this specifically to switch higher power loads from a microcontroller. I have one side of my board set to 3.3V and the other rail at 5V so there’s a noticeable difference in brightness when I have it correctly sourcing the 5V. The example from the book only ever used the 3.3V brightness no matter how many times I went over the schematic.

Searching online, I found mention of errata for that specific lesson and used the “…For Dummies” example online which finally worked properly. Conceptually I understood the transistor but having a source I trusted lead me completely astray was a bad start.

From there I attempted to switch the tactile switch for a microcontroller now that I had the circuit fixed. I wanted to work in Micropython on the ESP8266 but for reasons that I’ve since figured out could only make it work on the Arduino.

Thanks again everyone for helping me solve my brainfart.

@Kyle_Turpin Speaking as an engineer for over 40 years, dumb problems are the best kind. :slight_smile:

@Frans_Nissen That’s more or less equivalent of the circuit that actually worked.

My understanding of the failure of the other layout is that it doesn’t account for the lowered voltage coming out of the emitter “downstream” of the transistor. On a very low voltage circuit like this it’s not enough to reliably light an LED and the fix was to put it “upstream” on the collector side.