I am on to my next project which doesn't seem to be working as planned. At first I thought that I would find a boatload of pages on how to do this, but to my absolute surprise I couldn't find anything without having to resistor swap! I am trying to read from 9v-42v. Think its easy? Think again!

There are Chinese circuits you can buy online cheaply that do it, but wheres the fun in that, i want to build it!

Can anybody help me?

enter image description here

This is what I am trying to build (and simplify - I don't need all the features), I could buy it but I wont learn! Its a motor controller circuit. It runs 12-60v DC - why didn't he use a single resistor divider too? is he a fool like me? he obviously knew what he was doing, instead R1 has to be swapped depending on what voltage is running, 12v, 24v, 36v, 48v but this isn't the only circuit I've seen, some have op-amps or A to D converters, but why? dont they know what they are doing? A resistor divider would be just fine? this is why Im asking the question. I didn't want to hear just resistor divider, i was hoping to see something better and then understand why!


  • \$\begingroup\$ It is called "resistor divider". What to think about if you are not listing any source impedance, data acquisition speed, resolution, nor noise requirements? \$\endgroup\$ – Ale..chenski Sep 14 '18 at 3:52
  • 1
    \$\begingroup\$ "Resistor swap" is not an intelligent keyword search. Try "Voltage divider" \$\endgroup\$ – Tony Stewart EE75 Sep 14 '18 at 3:57
  • \$\begingroup\$ @TonyEErocketscientist, the OP doesn't want simple and proven engineering solution, he wants to have fun. \$\endgroup\$ – Ale..chenski Sep 14 '18 at 4:02
  • 1
    \$\begingroup\$ THen I would suggest the 4kV degenerate attenuator as he may be eligible as a Darwin Contestant \$\endgroup\$ – Tony Stewart EE75 Sep 14 '18 at 4:17
  • 1
    \$\begingroup\$ For anyone who is interested: The partial schematic in the question is taken from the full project in Everyday Practical Electronics magazine, January 2018 edition, which includes the circuit description etc. \$\endgroup\$ – SamGibson Sep 14 '18 at 12:23

Based on the limited description you have given, there is no reason why this shouldn't work:


simulate this circuit – Schematic created using CircuitLab

A few things going on here:

  • The voltage divider tones the voltage down to the appropriate level, dividing by about ~8.4 V/V
  • The zener diode clamps the voltage at 5.1V if your 42V somehow ends up being higher
  • The capacitor provides anti-aliasing / minor noise filtering for whatever ADC you are reading this into.

Enjoy :)

  • \$\begingroup\$ I know about the resistor divider, But why then do people building applications have resistor swaps when they are using microcontrollers? It Makes no sense ??? \$\endgroup\$ – Dean Hill Sep 14 '18 at 4:38
  • 1
    \$\begingroup\$ "Resistor swap" is not a thing. Not sure where you are getting that terminology from. Mind clarifying? Anyway that doesn't matter. The circuit I have provided will work. I promise you. So that's all you should need anyway. \$\endgroup\$ – DSWG Sep 14 '18 at 4:39
  • \$\begingroup\$ Im sorry, I've clarified the question better and tried to explain better, but I appreciate your help! \$\endgroup\$ – Dean Hill Sep 14 '18 at 5:07
  • \$\begingroup\$ If you want to send me your paypal I'll send you some money for attempting to help me learn while others were not so helpful. \$\endgroup\$ – Dean Hill Sep 14 '18 at 5:09
  • 2
    \$\begingroup\$ R1 is swapped in that article to vary the divider ratio so that 12V, 24V, 36V or 48V comes out as a high number on the DAC. the more DAC "steps" that are covered by the inoput voltage range the more precision you have. \$\endgroup\$ – Jasen Sep 14 '18 at 5:43

In the circuit you posted, R1 has an asterisks, and I assume a footnote that's not included. I can guess that it requires the voltage and current to be calculated due to it's function.

It's a low voltage detection circuit. The zener has a limit to how much current it can sink to regulate the voltage to 4.7V before it blows. R1 needs to be calculated so:

  1. The source voltage between 12 and 60 volts
  2. Across resistor R1
  3. Has a current that is less that the Zener's maximum current

And it's used to regulate the upper voltage of the VR3 Potentiometer. If the wiper of VR3 falls below a certain voltage to bring Pin 18 low, then the micro controller knows the input voltage is less than 4.7V and it will turn off the rest of the circuit.

  • \$\begingroup\$ by my reading R1-VR4 form a voltage divider and the zener's there for protection, else VR4 would be connected to +5 instead of involving the zener. \$\endgroup\$ – Jasen Sep 14 '18 at 5:49
  • \$\begingroup\$ @jasen may be. It's an odd arrangement, without knowing the footnote or the cut off voltage. Maybe you should post an answer. You seem to know the source. :) \$\endgroup\$ – Passerby Sep 14 '18 at 5:57
  • \$\begingroup\$ Its from an Electronics magazine, I had to ask a friend if he could screenshot what I got, let me get the rest \$\endgroup\$ – Dean Hill Sep 14 '18 at 7:21
  • 1
    \$\begingroup\$ Looking at it now, i think he changes R1 so he gets a better hysteresis per voltage for the actual trimpot adjustment ? \$\endgroup\$ – Dean Hill Sep 14 '18 at 7:44
  • \$\begingroup\$ Based on Jasen's description that's the likely reason. At 12v when your divider is scaled for 60v, you only have 20% of the adc range. \$\endgroup\$ – Passerby Sep 14 '18 at 18:22

My understanding is that you want a 4 channel voltage measurement, 12v, 24v, 36v, 48v.

There are two solution I've used in the past.

  • One solution, is the circuit given by DSWG. You can have 4 of them with the required voltage divider for each and either connect each to different AD pin of your uC or use an analog switch. The drawback is that you will draw (more) current through your voltage divider.

  • Second version (more fun IMO, but more expensive) is to have a single voltage divider that is scaled for the highest voltage and then having adjustable amplification circuit. There are several ways to achieve that. You can use digitally controllable instrumentation opamp for example.

The second implementation requires more care about noise handling as you will have lower signals.

In both cases, you can increase the values of the resistor (and reduce the current) if you lower the sensing impedance. Most A/D, especially high speed will need to have low impedance input to operate properly, as they charge small internal capacitors, and will need a follower op-amp at the input.

  • \$\begingroup\$ do you have a diagram showing how I could build solution 2 ? I am interested to see how it would work! \$\endgroup\$ – Dean Hill Sep 15 '18 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.