Maker Pro
Maker Pro

Trouble with multiple voltage dividers

AndyFe

Jun 10, 2016
5
Joined
Jun 10, 2016
Messages
5
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?
 

Attachments

  • Wiring.jpg
    Wiring.jpg
    74.8 KB · Views: 174
  • PCB Wiring.jpg
    PCB Wiring.jpg
    55.2 KB · Views: 151

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
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).
 

pgib8

Jul 26, 2015
107
Joined
Jul 26, 2015
Messages
107
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?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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)
 

AndyFe

Jun 10, 2016
5
Joined
Jun 10, 2016
Messages
5
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).

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!
 

AndyFe

Jun 10, 2016
5
Joined
Jun 10, 2016
Messages
5
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?

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?
 

AndyFe

Jun 10, 2016
5
Joined
Jun 10, 2016
Messages
5
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)

Yeah, I start to understand that now :) And your solution is more elegant - I just have to add into equation the diode voltage drop...
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
From the datasheet:

The SHDN pin can be driven low (under 0.4 V) to power down the regulator. The quiescent current in this shutdown mode is dominated by the current in the 10 kΩ pull-up resistor from SHDN to VIN. With SHDN held low, this resistor will draw 0.1 mA per volt on VIN (for example, the shutdown current with a 5 V input will be 0.5 mA). This pin should only ever be driven low or left floating; this can be accomplished with a physical switch that toggles it between ground and disconnected, or electrically with something like a transistor controlled by an I/O line.
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
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
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
 

AndyFe

Jun 10, 2016
5
Joined
Jun 10, 2016
Messages
5
@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...
 
Top