Hall effect sensor voltage divider circuit

Thread Starter

trav333

Joined Mar 7, 2022
44
Hi guys

I am trying to work out how to do the following

Sender ESP32 using hall effect sensor UGN3503UA and a magnet connected using ESP NOW

Receiver ESP32 output 0 - 3.3V

I have got the above part working but am stuck on how to do the next part

How can I make a circuit that uses the 10V external power to go from 0 - 10V using the output voltage of 0 - 3.3V from ESP 32

The analog input works with a 47K potentiometer as a voltage divider using 10V to make it 0V to 10V

So I want to use the 0 - 3.3V to convert the 10V input like the voltage divider with 47K pot but instead, use the ESP 32 kind of like a digital pot?

Any help would be much appreciated.

Looks like I could use a digital pot to do this but any other ideas would be great
 
Last edited:

Wolframore

Joined Jan 21, 2019
2,610
I've tried reading this several times and I'm not quite sure what you're doing. You can't output a true 0-3v3 DC from ESP because it's using PWM not true analog out. If that's the case you can switch it (like a chopper) to effectively output a lower voltage by switching the 10 with PWM... then you can low pass filter that output and get a relatively stable output. Again not sure all the details so this is the best I could do based on my poor interpretation of what you have in your head.
 

Thread Starter

trav333

Joined Mar 7, 2022
44
Thanks for the reply basically this

Use PWM signal from esp32 to control a digital pot that works as a voltage divider potentiometer that has a 10V input to make the signal 0 to 10v for signal out of the digital pot (50K)
 
Last edited:

Wolframore

Joined Jan 21, 2019
2,610
Since you're speaking vaguely, my vague answer stands... if you want more detailed answers, you should post all the details including component datasheets and such. Not the ESP32 but all the unknowns... what sort of delta t are we talking about. I'm sure you will get a lot more answers once you post a schematic and exact details including what you're controlling.
 

Thread Starter

trav333

Joined Mar 7, 2022
44
Since you're speaking vaguely, my vague answer stands... if you want more detailed answers, you should post all the details including component datasheets and such. Not the ESP32 but all the unknowns... what sort of delta t are we talking about. I'm sure you will get a lot more answers once you post a schematic and exact details including what you're controlling.
If I knew what components to use and could make the schematic I would not need to come here for help.

I feel that is not vague and tells you the parameters and shows what I am trying to do?
 

DickCappels

Joined Aug 21, 2008
10,187
You might want to try passing the PWM through a low pass filter effectively eliminating the AC portion leaving the DC portion. For example a 50% PWM signal would get you a nominal 1.65 volt DC output.

Edit: The low pass filter can look something like this:
1663647684371.png

And the to get from a 0 to 3.3 volt signal to a 0 10 10V signal:
\Edit
1663644700914.png

To get that to scale to 10 volts you use a non-inverting amplifier with a gain of 10/3.3 = 3.03. The op amp would have to be one with rail-to-rail outputs and inputs that can work down V-, which in this case could probably be 0V(ground). A little headroom on the +10V supply (like to +12V) would reduce the chance of clipping because of the tolerance of the PWM amplitude.

Is that what you were aiming for?
 
Last edited:

Thread Starter

trav333

Joined Mar 7, 2022
44
I have tried using an Op amp and was successful in doing this but it does not work in this case for the purpose.

For example this

47K POT with a 10V Input as a voltage divider outputs 0 - 10V depending on the potentiometer position.

How can I do this using the ESP 32?

ESP32 output 0 - 3.3V depending on the magnet position to the hall sensor.

Use that output of 0 - 3.3V to control a digital pot? (like how the hand-operated 47K pot works) the digital pot resistance changes the output voltage 0 - 10V to work like the manual operated 47K pot voltage diver circuit.

0 - 3.3V is to control the digital pot
10V input to the digital pot
Output 0 - 10V from the digital pot

Which model of digital pot would be suitable? or is a digital pot not the solution?
 

DickCappels

Joined Aug 21, 2008
10,187
47K POT with a 10V Input as a voltage divider outputs 0 - 10V depending on the potentiometer position.
How can I do this using the ESP 32?

Can you run the voltage from the pot's wiper through a voltage divider, the output of which is 3.3/10 = 0.33 times the wiper voltage. You can use a unity gain voltage follower to buffer the wiper from any loading effects of the voltage divider if you need very good linearity, or better yet, only put 3.3 volts across the pot.

What do you need a digital pot for if you have PWM?
 

MisterBill2

Joined Jan 23, 2018
18,586
To cover that full voltage span with an opamp without having to use a special rail to rail part you can also use a trick that is very old. Use an opamp that uses the +/- 15 volts DC supply, and the zero to ten can be provided very simply. Having a bit more power supply that is simple and stable is not such a challenge as having a very linear amplifier.
And certainly the actual purpose is not mentioned that I could see.
So without describing what is actually required the very best you will get is guesses, because the majority of those responding, including myself, lack the ability to see into the minds of other folks, especially at any distance, mind reading does not work.
 

BobTPH

Joined Jun 5, 2013
9,003
According to the datasheet, the ESP32 has two 8-bit DACs. So what we need is to translate a 0-3.3V signal to a 0-10V signal.

So all that is needed is an opamp configured as a non-inverting gain 3 amplifier.

You will need either a rail-to-rail opamp and a 10V supply, or s single supply opamp and a 13+V supply.
 

Thread Starter

trav333

Joined Mar 7, 2022
44
Yes after further investigation I cannot do this with a digi pot as they do seem to only go to 5V

I had previously made the circuit with an opamp which gave me 0 - 10V output from the 0 - 3.3V from theESP 32 using the 12V supply to the op amp. Using a LM358

The problem is how do I connect the analog input signal which has 12V (what would go to the middle pin of 50k potentiometer) if you connect this to the op-amp voltage out it damages the op-amp.

If I measure the voltage from the 12V analog input to the ground when the 50K pot is connected it will adjust this volatge 0 - 10V depending on the pot position.

I gather I need further circuitry between the op-amp and 12V from the analog input which is what I am trying to control.

Sorry I am new to all of this and still learning.
 
Last edited:

BobTPH

Joined Jun 5, 2013
9,003
Huh? If you are supplying the 0-10V signal from an opamp, there is no potentiometer involved. The opamp output connects directly to the analog input on whatever device you are controlling.

Unless I have completely misunderstood what you are trying to do, which is entirely possible, given your imprecise description.
 

BobTPH

Joined Jun 5, 2013
9,003
Okay, then why do you think there is a problem with the 0-10V signal? Just connect it where the potentiometer wiper was previously connected.
 

Thread Starter

trav333

Joined Mar 7, 2022
44
I have got the circuit working! The analog input needed a resistor on the output 0 - 10V for the non-inverting gain opamp circuit.

I will post the circuit diagram once I draw it up for review

Thank you for everyone's replies
 
Top