This is really a followup to a previous question to provide an updated schematic and photograph at the request of a commenter on that question. I'm not sure if there is a better way to provide such an update to a question but here it is anyway...
I have the following circuit:
simulate this circuit – Schematic created using CircuitLab
When I measure the voltage across R2 I don't see the 18V being supplied into the collector of transistor scaling linearly with the value of the PWM GPIO of the NodeMCU. It ranges from 9.35V with the GPIO at 0 (i.e. off) and 17.14V with the GPIO at 1023 (on "full"). With a GPIO value of 512 it reads 13.16V.
I tried my best a photograph of my set up:
About the only thing that is not clear in the photo I think is that the resistor "above" the transistor is between the GPIO with an orange wire and connects to the base (middle pin) of the transistor.
Answer
The correct way was to edit your previous question but we're all here now ...
Figure 1. 2N2222 pinout.
Figure 2. You have the collector resistor connected to the emitter at (1). The base looks OK at (2). You have the collector grounded at (3).
Swap the emitter and collector wiring by turning the transistor 180°.
No comments:
Post a Comment