Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Scale AnalogInput from Vref 1.8v - 30v

Signal Conditioning scale voltage divider digital pot op amp Vref Aref

  • Please log in to reply
9 replies to this topic

#1 slomobile

slomobile

    New Member

  • Members
  • Pip
  • 5 posts

Posted 11 July 2013 - 10:35 PM

I am building a generic user interface intended to connect to several different types of systems in different ways.

The netduino plus 1 inside the handheld control box is supposed to capture the position of 5 potentiometer based controls and send a packet out the ethernet port representing the state of the user interface.  

At the same time, each pot in the interface needs to deliver a voltage proportional to its position, relative to ground and an EXTERNALLY SUPPLIED Vref.  The tricky part is that the Vref could be 1.8, 3.3, 5, 12, or 30v, or potentially some arbitrary voltage in between.  In case it matters, there are 3 5kOhm pots and 2 100kOhm pots.  They all share the common ground and Vref.

 

My question is, what do I need to add between the pot wiper outputs, Vref and the analogInputs of the netduino so that

a) I always have a meaningful 10bit range between Vref and ground regardless of what Vref is

B) the maximum voltage ever seen by a netduino pin is 3.3v

c) whatever it takes to achieve a and b, does not mess with the impedance so much that it invalidates the voltage divider output.

d) the add on solution cannot occupy more than 1.8"x2.2"x0.5" volume inside the controller.

 

I suppose a critical part of any solution is going to be measuring Vref.  So a simple voltage divider to scale 30v down to 3.3v gives 30/1024 = 29mV resolution.  

I thought an elegant solution might be to put an identical 10 bit digital pot on every analog input.  Default to max resistance at power on reset(except the digi pot for scaling Vref which is fixed).  Then once the netduino samples the Vref, set each pot wiper to the same value returned from reading Vref.  The problem I had with that  is most digipots can only accept up to 5.5v.  The few that could handle 30v or more had a minimum Vdd of 10v.  So does anyone know of a part that would work?  Or am I barking up the wrong tree entirely?  1.8v Vref is a problem because Aref can only go down to 2.5v, but as long as we measure Vref accurately(to apply a mathematical scale factor) and reduce Aref to its min, the loss of sample points isn't that bad.



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 July 2013 - 09:14 PM

As you said your self, you need to scale down with respect to different Acc while maintaining full dynamics. Obviously, a voltage divider would do the trick if Acc was fixed. As it is not, I was thinking to use a ladder of different valued voltage deviders and a corresponding suitably valued zener diode for each input(x) and voltage of 1.8, 3.3, 5, 12 or 30V, i.e the 5 different voltages. For each such input x you would use two analogue multiplexers in series with a single analogue input of your Netduino. You would lead down the excess voltage of each zener to ground via a resistor.

You would then strobe each primary input multiplexer x of a total of N actual inputs, scanning for the first seconday multiplexer channel i not maxing out through the corresponding zener:

int volt[N];
for(int x = 0; x < N; x++)
for(int i; i < 4 && mux[x, i] > max[i]; i++)
volt[x] = mux[x, i];
// now mux[x, i] contains the correct voltage for input x

You'd need 2 analogue multiplexers and 5 different zener diodes.

Complex perhaps but I think it could work :-)

#3 slomobile

slomobile

    New Member

  • Members
  • Pip
  • 5 posts

Posted 14 July 2013 - 04:12 AM

Thanks Hanzibal, but that won't work.

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]The connection to external(not computerized) equipment is via an 8 pin cable with analog signals out of the box for X, Y, Z, Setpoint1, Setpoint2, digital button, and inputs to the box of GND, and Vref.  Vref might come from a regulated source, or it might be a battery supply that will droop several volts while operating.  In either case, the outs must remain proportional to actual Vref, not to the nearest zener voltage.[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;] For example... at time T0 all controls are midpoint and Vref = 13.8v[/color]

all signal wires should deliver 6.9v and netduino sends an ethernet packet encoding each axis as 511.

 

at T500 control X is at 25%, Y is 75%, Z is 50%, Setpoint1 is 0%, setpoint2 is 100%, Vref is 11.6v

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]signal wires are  2.9v,             8.7v,         5.8v,                0v,                   11.6v[/color]

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]netduino sends 255,               767,           511,               0,                     1023[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]the netduino has a stable power source independent of Vref, but the GND is common between all devices.[/color]



#4 BMW

BMW

    New Member

  • Members
  • Pip
  • 2 posts

Posted 14 July 2013 - 06:38 AM

can i connect 12v dc supply to netduino plus 2 board

can i use windows vs 10 environment to get values to be displayed 



#5 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 14 July 2013 - 08:56 AM

Thanks Hanzibal, but that won't work.

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]The connection to external(not computerized) equipment is via an 8 pin cable with analog signals out of the box for X, Y, Z, Setpoint1, Setpoint2, digital button, and inputs to the box of GND, and Vref.  Vref might come from a regulated source, or it might be a battery supply that will droop several volts while operating.  In either case, the outs must remain proportional to Vref. [/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;] For example... at time T0 all controls are midpoint and Vref = 13.8v[/color]

all signal wires should deliver 6.9v and netduino sends an ethernet packet encoding each axis as 511.

 

at T500 control X is at 25%, Y is 75%, Z is 50%, Setpoint1 is 0%, setpoint2 is 100%, Vref is 11.6v

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]signal wires are  2.9v,             8.7v,         5.8v,                0v,                   11.6v[/color]

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]netduino sends 255,               767,           511,               0,                     1023[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]the netduino has a stable power source independent of Vref, but the GND is common between all devices.[/color]

 

 

id add a voltage regulator into the device, than its fixed all the time, even with batteries. easier to work with.

i prefeer switching regulators. so no matter what you put in ( >=5v <=24v) it all the time puts out 3.3v (if you set it todo so) and than you can get the full range from your analog inputs w/o voltage dividier (wich adds errors, resistors have like 5-20% tolerance)



#6 slomobile

slomobile

    New Member

  • Members
  • Pip
  • 5 posts

Posted 14 July 2013 - 10:29 AM

It has regulators. I cannot put a regulator on the Vref or signal lines because that would eliminate the information they contain and defeat the entire purpose of the device.  Maybe a description of its use cases would be helpful:

A customer has an antiquated plant with control panel containing a large number of control dials.  They want me to automate their process but a mathematical model does not exist yet and I need to capture data to generate one. I quickly hook up my generic user interface in place of several control dials using whatever control voltage happens to be in the panel.  I can rapidly and simultaneously vary several control parameters more intuitively and quicker than turning several knobs. Plus now my ethernet equipped field laptop is busy charting my every input along with resulting plant output.  I am able to quickly gather the relavent info I need without reading piles of manuals that may not even exist any more.  Next week I do the same process on a completely different unknown plant which may use different control voltages.

 

It is a tool that will improve my personal workflow.  I don't expect to see one in every kids hand, but if a kid should find that he needs one, I hope this thread would help him build one.



#7 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 14 July 2013 - 12:55 PM

Welcome to the Forums!

 

I started off thinking about using relays to change the potential divider ratios, but they would be much too big.

Then I thought about using non-inverting op-amps. Here, the feedback resistor would be fixed, but several differnet resistors to ground could be selected using a set of transitors. But I think that will be too complex.

Your idea of digital pots sounds much better if you can get them with the high voltage range you need.

 

Is there a really simpe solution...

I am guessing that you have a cable between the kit with the potentiometers and the Netduino, and that the operator will know which device has which voltage for Vref:

 

(I think this idea also fails the size requirement, but) could you have a different input connector for each voltage range?

I am thinking that you could select a set of potential divider resisitors for each Maximum Vref {1.8, 3.3, 5, 12, or 30v}.

Then rather than try and do some clever electronics, just plug into a different socket which changes the resistor between the Ain and potentiometer wiper. The resistor between Ain and ground should be calculated to be common to all ranges.

 

If you can't have different sockets on the Netduino, could you have an inline adapter for the cable which just inserts a resistor on each wiper and the Vref signal?

 

I would also consider not connecting the external Vref to the Netduino Vref, and instead connecting it to the 6th Ain. This input can then be measured to determine the full scale of the wiper inputs. I know this loses some resolution when the battery drops - so this might not be acceptable. If it is not acceptable, then you are going to need some sort of active circuit because I am sure that the 1.8V Vref is too small for the Netduino Vref input.

 

Hope these random thoughts help - Paul



#8 slomobile

slomobile

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 July 2013 - 04:43 PM

Paul, 

Your idea of putting the solution in the cable would be a great way of getting around the size constraint; except that would necessitate getting the modified signals back into the box on a new connector.  There is very little room for another connector on the box but I might be able to find some place. 

I had a Duh.. moment.  The impediment to using the digipots was the requirement of a 30v supply.  So all I need is a 30v step up supply like LM2587.  Now that the pots are looking possible again I need to do some calculations to be sure I don't exceed their current rating at any point.

The external Vref was always intended to connect to [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]the 6th Ain through a divider.  The conditional( if Vref < ~3.3Vin ) connection to Aref was a way to maintain resolution if Vref drops below the Netduino Vin.  It may be a bad idea introducing that much new complexity for minimal benefit.[/color]

 

Besides my digipot idea can anyone think of a solution that works with any arbitrary and variable Vref from 3.3v - 30v and delivers 1023 meaningful ratiometric levels.  As far as I understand, any solution which switches in only 4 or so different voltage divider networks cannot deliver that; creating range limitation and ratio distortion at any Vref that does not exactly match one of the few design voltages.

 

I removed the requirement for 1.8v because it looks like an unreasonable hurdle, but if someone has a thought how to make that work too, I would love to hear it.



#9 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 18 July 2013 - 09:28 PM

Could you perhaps make a simple sketch of the scenario? I think it would make it a lot easier for others (including me) to understand what you got and what you need.

#10 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 20 July 2013 - 08:23 AM

It looks like there are three options:

1/ manually selectable resisitors to give the correct voltage division - fixed to the maximum Vref.

2/ digitally select the resistors "digipots" to give a dynamic voltage division,

3/ use a set of digitally adjustable amplifiers.

 

With option 1, any reduction in Vref can't be compensated for.

 

With options 2 and 3, the gain can be changed to keep Vref near 3.3V.

 

With options 1 and 2, you will need to be careful that the resistance you use is not so low that the current drawn into the potential divider changes the voltage being measured. For example, with a 10K joystick, making a potential divider with 100 ohm resistors would result in the voltage on the potentiometer's wiper changing drastically. Even with 10K resistors you would be changing the voltage, and this ight affect the rest of the system!

 

With option 3, you would have high impedance inputs to an amplifier whose gain is digitally controlled. This should not affect the system being monitored.

 

You might acheive option 3 by buying normal op-amps and use your digi-pots in the feedback path of a non-inverting amplifier to set the op-amp gains, or you might look for a chip that does this all in one. There are some out there, I have not had time to find a suitable candidate. (Lots of them are for profesional systems like radio receivers, and will be expensive, and have lots of surface mount pins to attach.)

 

Just some thoughts - Paul







Also tagged with one or more of these keywords: Signal Conditioning, scale, voltage divider, digital pot, op amp, Vref, Aref

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.