Maker Pro
Maker Pro

unusual signal conditioner needed

MM0TJR

Oct 2, 2012
15
Joined
Oct 2, 2012
Messages
15
I wonder if anyone can help: I'm trying to find a device (preferably DIN-rail mountable) that will accept a 0-5V analogue input signal and make a "potentiometer output"

Vsupply
¦
¦
¦**************¦
¦ ¦
¦ #----¦-----------------BATT+
0-5V------ p # ¦
analog ¦ o #<--¦----------------- OUTPUT COMMAND
input ¦ t # ¦
¦ #----¦----------------BATT-
¦__________¦
¦
¦
¦
gnd_¦____


This is for computer (arduino) control of an existing proportional hydraulic valve. I guess what I am after is really a voltage controlled potentiometer.
before I go galloping off to try to design one from scratch, I wonder if there is already an offering available!?
any help/guidance greatly appreciated.

ps unfortunately my ascii art did not work. sorry.
 

MM0TJR

Oct 2, 2012
15
Joined
Oct 2, 2012
Messages
15
heres a diagram of the application and the gadget Im trying to find!
 

MM0TJR

Oct 2, 2012
15
Joined
Oct 2, 2012
Messages
15
here it is
 

Attachments

  • variable voltage pot SC.jpg
    variable voltage pot SC.jpg
    35.4 KB · Views: 154

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Google AD5220 and AD5228 Digital Pots.

Chris
 

MM0TJR

Oct 2, 2012
15
Joined
Oct 2, 2012
Messages
15
Thanks Chris: I had discovered these actually, just wondered if there was a commercial DIN-rail offering already incorporating one....! is there?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Thanks Chris: I had discovered these actually, just wondered if there was a commercial DIN-rail offering already incorporating one....! is there?

Wow, that would be a lot of unused real estate... Nunno.

Chris
 

virtual1

Mar 29, 2012
13
Joined
Mar 29, 2012
Messages
13
IMHO that's one of the biggest limitations of the arduino. I recently got into that and have a number of the procs and accessories here. (the ardweenys are a really good deal, check them out) I find myself in need of an analog output on many occasions, and all they offer are digital and PWM. Converting PWM directly to a proportional voltage or resistance isn't too stragithforward that I've found anyway. You can usually get away with PWM for motor speed control, but the max duty cycle appears to be about 50%. You could go with a DAC but then you'd eat up a lot of digital output pins. I haven't seen any DAC that runs on serial output but I'm sure they're around, just haven't put in the work to find them.

For your application you might be able to use an optical gate and use the PWM to power the LED emitter in the pair and draw your resistances off the receiver. I was looking at your image and it looks like you've solved the problem of getting a linear voltage output from the arduino - how are you doing that?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You can get an analog voltage from PWM with a single stage RC filter. You will probably need to follow it with am opamp to get a low enough impedance. I have even made audio output using only PWM + a single stage RC filter.

Bob
 

virtual1

Mar 29, 2012
13
Joined
Mar 29, 2012
Messages
13
You can get an analog voltage from PWM with a single stage RC filter. You will probably need to follow it with am opamp to get a low enough impedance. I have even made audio output using only PWM + a single stage RC filter.

What values for R/C would you recommend? The PWM is 0 to 5v p-p at about 550 hz. Duty cycle varies from 0 to 50% when the pwm is set between minimum and maximum.

Also sorry I'm not experienced with op-amps. For use as a buffer, I assume the - is tied to ground and the input to the +, and the buffered output is the output of the op amp? (on an op amp whose power is ground and the supply voltage)
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
A higher PWM frequency would be better. Is there any reason you are using such a low frequency? Also why only 0 to 50%. If you want to use a PWM to output 0 to 5V you would use duty cycles of 0 to 100%, with 0 to 50% you would get 0 to 2.5V out.

To use a single stage RC filter, you would want it to be something like 1/16 the frequency of the PWM. That would give you -27db of ripple. But at 550Hz / 16 = 34Hz, you are limiting how fast you can change the analog output. A higher PWM frequency would allow you to use a higher cutoff low-pass filter and allow you to change the output more quickly.

Bob
 

virtual1

Mar 29, 2012
13
Joined
Mar 29, 2012
Messages
13
I'm just going by observation. The arduino's built-in PWM management dictates those figures. I just give it a pin number and an integer 0-255 and it handles the PWM. The timing and duty cycle are what I observed on an oscilloscope. I'd certainly like to have a higher frequency for other things, but that's what I have to work with on the arduino.

I was trying to make a switched regulator earlier but at that low of a frequency it's not practical. Ended up ebaying a buck regulator instead.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Well, that pretty much sucks, because the underlying chip is almost certainly capable of much better. I don't use arduino, I use PIC, and I have done audio using 50KHz pwm.

Bob
 

virtual1

Mar 29, 2012
13
Joined
Mar 29, 2012
Messages
13
one must work with the tools they have. I tend to specialize in making fuel injectors from rocks and sticks ;)
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
Well, that pretty much sucks, because the underlying chip is almost certainly capable of much better.

It is, they just need to skip the Ardunio's built in 'easy' routines and access the chips hardware PWM directly...

virtual1 said:
PWM isn't done in hardware, it's a library that runs on an interrupt

It can be and doing it with the hardware is better...

virtual1 said:
one must work with the tools they have

You have the hardware and tools to do PWM in hardware, you just need to take that road instead of the 'easy' one...

This is the problem with these user friendly developer platforms like the Arduino, they remove the user from the hardware details and make many assume there are limitations that are not really there...

Get the ATMEGA datasheet and read up on hardware PWM, and implement that...
 
Top