Microcontroller with switch

Thread Starter

bricke

Joined Mar 1, 2011
13
I'm trying to use a bypass resistor to divert current from a battery pack. I don't want to the resistor to always be on though. Instead, I have a switch that turns on when the battery becomes fully charged. This allows current to bypass the battery until the battery voltage falls below the full charge value. At this point the switch will turn off again. I've tried using a BJT and MOSFET and have had different issues with them.

1. With the BJT, I don't feel like I'm turning the transistor on all the way since the current through the switch is around half of what is flowing into the battery pack.

2. With the MOSFET, the switch is always on, even when the microcontroller output goes to 0V.

I have attached the schematics. Does anyone see anything I am doing wrong here?
 

Attachments

praondevou

Joined Jul 9, 2011
2,942
In the second picture there is no connection from the AT to ground.

Does the uC only have this function? If so it can be done without it. How does it measure the battery voltage?

Could you please post a complete schematic? Instead of diverting current you should be interrupting the current coming from the charger by putting a MOSFET in series with the battery.
 

Thread Starter

bricke

Joined Mar 1, 2011
13
My apologies, I forgot to add the AT's GND connection.

The problem with putting the switch in series with the battery is that the battery charges up to the voltage, but is not truly at capacity. If you give me a couple minutes, I will edit the schematic. Thanks.
 

Thread Starter

bricke

Joined Mar 1, 2011
13
Here is the full schematic. Pin 2 of the Tiny45s is an ADC. The voltage divider is used so that the battery voltage can be referenced since the VCC of thte micros are not a stable voltage.
 

Attachments

Thread Starter

bricke

Joined Mar 1, 2011
13
I want to thank you for your help on this but I figured out my problem. It wasn't a hardware problem at all. I had that pin configured as an input instead of an output in the Tiny45 code. Things like this make me realize how little things can make huge changes in electronics! :)
 
Top