View Full Version : voltage divider help needed
ZAGNUT
Jul 19, 2004, 07:59 PM
building a tx and i would like to use linear hall effect sensors and magnets in place of the normal pots.
problem is that the PIC firmware only supports pots fed straight from an 8 cell battery (voltage varies during discharge) and the hall sensors are limited to 4.5-5.5 volts.
so what i need to do is somehow cut the battery voltage in half. a fixed regulator won't work and because the current draw of the sensors varies a standard voltage dividing circuit won't work either.
any help would be appreciated but go easy on me as understanding electronics is not my strong point...
thanks,
dave
Happy Hobit
Jul 19, 2004, 09:24 PM
Hi Dave,
This is an adventuresome project for someone who says that an ‘understanding electronics is not my strong point...’
Why won’t a ‘fixed regulator’ work?
Jay
Bruce Abbott
Jul 19, 2004, 10:15 PM
the PIC firmware only supports pots fed straight from an 8 cell battery
Are you sure? The PIC can't handle more than 5V, so I can't see why the pots would need to be fed with a higher voltage.
If you really do need a proportion of the battery voltage, you could use a buffered voltage divider like this:-
Mr.RC-CAM
Jul 19, 2004, 10:31 PM
It doesn't get much simpler than a LM7805 Vreg (2 caps + Vreg). If you are using a PIC, then just use its existing 5VDC supply. There will be one there somewhere.
RC-CAM
zagisrule!
Jul 19, 2004, 10:36 PM
I really do not understand what you want...
Do you need a constant-voltage source? Why are the pots connected to the 8-cell battery pack instead of 5V?
What sensors are you using and how do you plan on interfacing them?
Do you have a schematic we could see, that would really help out. :)
-Matt
ZAGNUT
Jul 20, 2004, 05:03 AM
ok, here's some more info,
in the SCHEMATIC (http://www.mstar2k.com/EncoderDrawings.pdf) you can see that the PICs voltage reference for analog inputs comes straight from the battery via a simple voltage divider. this is the reason i can't use the regulated 5 volts for the hall sensors...things would get screwy as the battery voltage slowly dropped during normal discharge. the pots are adjusted so that the PIC never gets anything close to the max allowable 5 volts
in the top right of the schematic you can see that R40 was designed as an option for connecting the pots to the regulated 5 volt supply. this option is not supported in the firmware and as i understand (from the designer) even if it was it wouldn't allow regular pots (for channel 6 and 7) to be used along with the hall sensors.
here's the DATA SHEET (http://www.allegromicro.com/datafile/1321.pdf) for the hall sensor. main reason i want to use these is the small size compared to long-life precision pots and at $2 for a sensor and magnet they are also much, much cheaper. they work great in all the tests i've done. might also make a good replacement for cheap servo pots.
Bruce, any part numbers/values for your schematic would be a big help...i'm only good at following instructions and soldering :)
dave
zagisrule!
Jul 20, 2004, 08:38 AM
What are the values of R21 and R40?
I think there is an error somewhere, the pots should be taking +5V and the reference should be from that as well.
There should not be any problems if you feed BOTH the reference voltage divider and the sensors from the same regulated 5V...that is the way it should be done even with normal potentiometers.
This is what I would have done in the designer's place:
-Matt
zagisrule!
Jul 20, 2004, 08:42 AM
Delete.
GailInNM
Jul 20, 2004, 10:01 AM
While I agree with my fellow New Mexican, Matt, about the design, the designer may have had a valid reason for not using the regulated supply.
A standard way of generating a stiff half-of-supply voltage is to use a voltage divider with the output connected to the positive input of an operational amplifier. The Negative input is connected to the OpAmp output. If you need more current than the OpAmp can supply, you can include an emitter follower transistor inside the feedback loop. Good practice to put a small filter capacitor across the voltage divider resistor going to ground. Say 5nF if using divider resistors in the 10K to 50K range. OpAmp will need to be powered from the battery line.
Gail
Mr.RC-CAM
Jul 20, 2004, 12:35 PM
If you must use the unreg battery voltage as the reference (which is a strange implementation) then your Hall Sensor mod will be a bit complicated.
The sensor's allowed operating voltage is a traditional 5.0V (+/-0.5). So, you must use 5.0V and you are left with scaling its output {using some trickery} that is based on the battery voltage devised reference. There's probably going to be an OpAmp or FET in there, since you need a precise voltage controlled gain stage to handle this.
I reviewed the encoder notes and saw where the author mentioned that the software would need to be changed if the regulated 5V was used. My thoughts are that if the PIC's ref and the analog ported Pots are all sourced from the same 5VDC, then the PIC would be clueless that that optional Vreg'd voltage was in-use. But...
I have a feeling that the reason for the compatibility problem is due to the battery voltage monitor/alarm feature. It looks like the author indirectly monitors the battery by sensing the Vreg'd 5V source {attenuated first} and then determining the battery state from the ratiometric difference. If true, then a software change, and perhaps a tiny hardware change, would be needed to restore the battery test when the 5V Ref was used. Of course this is just my best guess based on peering at the schematic for a couple of minutes.
RC-CAM
ZAGNUT
Jul 20, 2004, 01:56 PM
The sensor's allowed operating voltage is a traditional 5.0V (+/-0.5). So, you must use 5.0V and you are left with scaling its output {using some trickery} that is based on the battery voltage devised reference. There's probably going to be an OpAmp or FET in there, since you need a precise voltage controlled gain stage to handle this.
RC-CAM
here's a quote from the data sheet of the previous version of the same hall sensor:
"The ratiometric feature is especially valuable when these
devices are used with an analog-to-digital converter. A/D
converters typically derive their LSB step size by ratioing off a
reference voltage line. If the reference voltage varies, the LSB
will vary proportionally. This is a major error source in many
sensing systems. The A3515xUA and A3516xUA can eliminate
this source of error by their ratiometric operation. Because their
gain and offsets are proportional to the supply voltage, if they are
powered from the A/D reference voltage, the sensor output
voltage will track changes in the LSB value"
so it seems like they should be fine as long as i can half the input voltage somehow...
and you're right about losing the voltage monitor feature if i connect the reference pin to regulated 5 volts as this is the only place where the pic sees any unregulated voltage. it is important for me to keep this feature as i can spend a few hours in the air non stop with gliders and i also use it for testing flight packs.
maybe i should just push for the software change needed for 5 volt pots and be done with it. even if i have to change all pots to hall sensors it might just be simpler in the end.
dave
Mr.RC-CAM
Jul 20, 2004, 02:07 PM
so it seems like they should be fine as long as i can half the input voltage somehow...
From what the data sheet says, it will need at least 4.5V to operate. The ratiometric behavior is a nice feature, but that won't help if the sensor will not operate correctly at lower voltages.
At 9.6V battery voltage, I estimate the PIC's reference will be about 3.5VDC. If the sensor's data sheet is taken at face value, then the sensor might not operate well at that voltage.
If you have one, then just hook it up and test its linearity and dynamic range at the operating voltages you will subject it too. If you like what you see then you are good to go. All you would need is to buffer the existing voltage reference with an OpAmp and use it as the sensor's power source.
RC-CAM
jeffs555
Jul 20, 2004, 03:41 PM
You could use an op amp buffer for power to the hall sensors like RC-CAM suggested, but feed it from a 2-1 voltage divider off the battery. Then you would need a voltage divider on the output of each sensor to feed into the pic to get it down to the 3.5 volts RC-CAM estimated. That way the inputs to the pic would see the right voltage range, and the sensors would still operate at their spec'd voltage.
zagisrule!
Jul 21, 2004, 12:20 AM
Gail, where are you at again? I think we have conversed before via the Private Messages?
I don't see any reason that regulated 5V would not work as the reference....who designed this circuit? Mr. RC-CAM has arrived at the same conclusion.
If you must run this with rail as your ref input, you might just use an op-amp to provide a voltage amplifier and run your hall sensors from their desired voltage...to put things into the proper ratio.
A high-power divider is accomplished as Gail suggests or using a transistor or MOSFET to act as the true current path, rather than the resistors.
One more thing you might think about is the relativly low input impedance of the PIC ADC's... < 2Kohms if I remember correctly...make sure that you can meet this requirement for accurate ADC. With a higher input impedance delivered, the ADC will be slow to measure and inaccurate.
-Matt
GailInNM
Jul 21, 2004, 12:37 AM
Matt -- I am on the far west side of Albuquerque in the Paradise Hills area.
Comatose
Jul 21, 2004, 01:58 PM
Zagnut, here's where you're confused. The "reference voltage" in a PIC is the regulated 5v supply, unless you have specifically requested that it be otherwise, which would make absolutely no sense. The ratiometric feature is very handy if you don't have a stable supply. Its even handy with a stable supply for that extra 1% of precision. It does not mean, however, that you can't use a regulated supply.
If it was me, I'd use the internal 5v reference for all the analog inputs, feed the pots 5v and just change the firmware.
I'd also use an analog mux instead of the slave PICs, but thats a pretty drastic redesign. You should, however, replace the PICs with the PIC18F8520. The PIC17C762 is obsolete and $12. Its replacement, the PIC18f8520 is $6, and pin/code compatible (you may have to change config bits, but thats it)
ZAGNUT
Jul 21, 2004, 03:22 PM
[QUOTE=Comatose]
If it was me, I'd use the internal 5v reference for all the analog inputs, feed the pots 5v and just change the firmware.
QUOTE]
that's just what i've decided to do, use the existing 5 volt option of the circuit and wait for the needed firmware changes from the designer.
the hall sensors must be set up for approx. 2.5 volt output at center stick in order to get a linear output but the current version is designed for a 0.5-1.5 volt output from the pots...going past 2 volts screws everything up, just tried it. one voltage divider feeding all the sensors would have been ok but if i have to put one on every output it just gets too complicated....
i know the PIC17 is old but the encoder and in-circuit programer (for upgrades to new versions) are designed around it. also the PIC18 you mention does not come in the 84 pin PLCC package needed. im sure there is some type of adapter board to fit the 80 pin part into the socket but would it still be compatible with the programer?
dave
ZAGNUT
Jul 21, 2004, 03:34 PM
I'd also use an analog mux instead of the slave PICs, but thats a pretty drastic redesign.
totaly lost me here! this radio only has a single PIC that handles all functions. are these analog mux thingies some other form of prgrammable chip?
like i said before, i'm good at following directions and soldering, but that's it :)
dave
Comatose
Jul 21, 2004, 07:46 PM
Zagnut, nevermind about the muxes I was reading the schematic as three PICs not one broken into three parts. I should have read it more closely.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.