Microcontroller with switch

Discussion in 'The Projects Forum' started by bricke, Nov 14, 2011.

  1. bricke

    Thread Starter New Member

    Mar 1, 2011
    13
    0
    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?
     
  2. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    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.
     
  3. bricke

    Thread Starter New Member

    Mar 1, 2011
    13
    0
    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.
     
  4. bricke

    Thread Starter New Member

    Mar 1, 2011
    13
    0
    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.
     
  5. bricke

    Thread Starter New Member

    Mar 1, 2011
    13
    0
    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! :)
     
Loading...