Hello.
I'm a new learner in microcontrollers, but I have a basic understanding of electronics. I want to switch between two independent 3S battery packs (11.1V - 12.6V) to power the rest of the system, alternating them when fully charged.
I've created a circuit to switch with:
ESP32 DevKit v4, which will provide the signal to open and close the circuit.
TIP122, a transistor that will act as a switch.
LED, simulating the battery pack.
I simulated the circuit in an app, and it worked perfectly.
In the image above, you can see all the components I used.
The problem arises when I try to implement it practically. The LED doesn't behave as expected. Here's a video showing what happens.
The code in the video is a simple Blink.
** Note: I found it strange that even when I change the GPIO pin without altering the code, the LED lights up. As far as I know, GPIO pins should default to the INPUT state.
As far as I know, the amount of current available between the emitter and collector is proportional to the amount of current at the transistor's base. I measured the current, and the result was in the µA range, which I found strange. So, I decided to test it by adding a 220-ohm resistor directly to the same GPIO. The result was approximately 15mA, as expected. **
Without a doubt. It's connected correctly. Base, collector, and emitter, respectively.
Base connected to GPIO33;
Collector connected to the negative side of the load;
Emitter connected to the GND of the external power supply and the ESP32.
I'm sorry, but why not to watch the video? The goal is to show what actually happens.
What happens if you turn the led around?
Your 220 ohm resistors look differently.
From the picture it is really hard to see the difference between red brown and black...
220 should be red red black black brown or red red brown gold (I guess you do not have ones with silver bands...).
It's actually a different one, 270 ohms. I was testing other configurations when I sent the photo.
Now it's correct. However, it's still in the same situation.
After switching, the LED is completely off, unlike the previous way where it was very dimly lit.
I have voltage regulators in my project. I converted 12V to 3.3V using another power source. I connected the 3.3V regulator's output to the base of the TIP, but this time, there's no light signal.
It's connected correctly. The positive terminal of the external source is directly connected to the resistor that is in series with the positive terminal of the LED. The negative terminal of the LED is connected to the Collector. Meanwhile, the negative terminal of the source is connected to the Emitter of the TIP.
Check this imagem
When the transistor is off, how does the LED consume power, considering that it's necessary to bias the transistor and power the base to enable conduction from the emitter to the collector?
The led is flickering in the video which is rather odd.
Post the code that is running on the ESP32.
Also take the end of the orange wire which is currently connected to GPIO32 and touch it on 3.3v to see if the led lights correctly.
I had tried with another external 12V source with a voltage regulator for 3.3V, and still got the same result. However, I haven't tested it with the 3.3V pin. I'll try it as soon as I get off work.
So... Because of these occasions, I was unsure if it's really in good condition.
I checked it with a multimeter in continuity (diode) mode:
Positive probe on the Base and the other probe on the Collector. It showed continuity with a voltage drop of 0.5V.
Positive probe on the Base and the other probe on the Emitter. It showed continuity with a voltage drop of 0.6V~0.7V.
Positive probe on the Collector and the other probe on the Emitter. The result was an open circuit, it didn't conduct.
Positive probe on the Emitter and the other on the Collector. It conducted with a voltage drop of 1.9V.
It's the positive and negative wires of the external 12V power source. The wire on the right (near the LED) is the positive pole. The wire on the left (near the TIP122) is the negative pole.