Connect with us

Trouble with multiple voltage dividers

Discussion in 'General Electronics Discussion' started by AndyFe, Jun 10, 2016.

  1. AndyFe

    AndyFe

    5
    1
    Jun 10, 2016
    I’m using an ESP8266-DEV to measure battery voltage and control some LED lights.

    The first 2 voltage dividers are used to get the voltage bellow 1V, required by the ADC GPIO – it is working fine.

    The third voltage divider lower the voltage bellow 0.4V, in order to power down the Pololu S10V2F12 12V step-up, by keeping the SHDN pin powered during sleep cycles of the ESP.
    By setting GPIO12 on HIGH, the 12V module activates, and through IRL510 MOSFET I can control the LED light.

    In my prototype the circuit works fine, but on my PCB design the third divider either not give me any voltage, or give me the same voltage as input, and the MOSFET is behaving glitchy – every couple of seconds it turn off and on. I’ve even managed to burn one ESP...

    I’ve measure all wirings and connections, I do not have any shorts or wrong voltages... What am I missing? What else can I measure to identify the source of the problem?
     

    Attached Files:

  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    Firstly, multiple voltage dividers like that will give you a lower voltage than you expect. Secondly, the diode drop will probably exceed the remaining voltage.

    However, you're seeing a higher voltage. I expect the ground connection(s) to your voltage divider are failing in some way (poor solder joint perhaps).
     
  3. pgib8

    pgib8

    99
    22
    Jul 26, 2015
    I just did a quick math and maybe I messed up, but I'm getting 0.14V coming out of the 3rd divider at full battery.

    So your step-up is shut down when SHDN is low? Why not pull it low via a resistor?
     
  4. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Keep in mind... your voltage divider is multiple dividers chained together... you end up getting a number of components in parallel with each other which is going to through off your math.
    If you want 'multiple' voltages from a divider, it would be best to make a *single* series string of resistors.

    IE...
    VBatt -> 27KΩ -> 5.6KΩ -> 3.9KΩ -> GND
    The junction between the resistors will provide you with 0.96V, and 0.40V respectively .

    *Special Note:
    These voltage WILL change if current is drawn from the 0.96V, or 0.40V tap! (You have already done this by daisy chaining multiple voltage dividers... End result is additional current draw, and the lower resistor in parallel with the other dividers)
     
  5. AndyFe

    AndyFe

    5
    1
    Jun 10, 2016
    So true...I've tried to figure out a formula out of them and not much precision...I'll replace them with one separate voltage divider for ADC and another for SHDN, using only 2 resistor for each. Thank you!
    I'm using 1N4001 diodes, and they have a voltage drop of ~0.2V. At the end of third divider I have 0.15V, so with the diode I have no output. Evrika! :)
    I've made some handmade PCB's, using marker and etching solution, and the quality of the traces is not great. I'm moving to a PCB manufacturer as soon I fix this issue.

    Many thanks, Steve!
     
  6. AndyFe

    AndyFe

    5
    1
    Jun 10, 2016
    You are absolutely right! My diode at the end of the third voltage divider is cutting all current...
    This is what I've tried to do - to have <0.4V always on SHDN, thus the regulator be disabled, and feed 3.3V through GPIO when I need to activate it... what do you mean by pull it low via a resistor?
     
  7. AndyFe

    AndyFe

    5
    1
    Jun 10, 2016
    Yeah, I start to understand that now :) And your solution is more elegant - I just have to add into equation the diode voltage drop...
     
    Gryd3 likes this.
  8. BobK

    BobK

    7,642
    1,662
    Jan 5, 2010
    From the datasheet:

    So, there is a 10K resistor between ~SHDN and Vin. To control it you want to connect it to a GPIO pin, and output low to shut it down, output either high or high impendance to enable it.

    I have no idea what you are trying to do with the voltage divider, it is redundant, as is the diode between the output from the micro and the ~SHDN pin.

    Bob
     
  9. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    I missed that xD

    Take a look at Bob's reply.
    The idea is that you can 'ground' the pin to turn it off... you don't need a *tiny* voltage on it.

    The solution would be to use a 'Pull-Up resistor' as suggested.
    When the MCU pin is 'low' it will pull the voltage of the regulator to 0V (Or close enough) and shut it down.
    When the MCU pin is 'high' or set as an 'input' (high impedance) then the regulator will see the full (or close enough) voltage and turn on.

    Remember MCU pins *can* have 3 states.
    High, Low, High-Impedance.
    High/Low is when the pin is set as an output, and will be similar to connecting the pin directly to Vcc, or ground. (with some restrictions.)
    When the pin is set as an 'input', the pin is similar to being connected to a really high Ω value resistor. Or similar to being 'disconnected' really... This gives you the option to forcefully drive the Regulator pin High, Low, or let the 'pull-up' resistor do it's work.
     
  10. BobK

    BobK

    7,642
    1,662
    Jan 5, 2010
    The pull up is built in to the module. Unfortunately, that was not the best choice, since we probably want the unit shut down when the MCU is booting, which would have happened with a pull down.

    Bob
     
    Gryd3 likes this.
  11. AndyFe

    AndyFe

    5
    1
    Jun 10, 2016
    @BobK and @Gryd3 - thank you a lot for clarifications with the functionality of SHDN. I will try your solutions, specially when the MCU is in sleep mode. I'll let you know my results...
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-