View Full Version : Digital pot, voltage regulator or can software do the trick?
Christopher4187
- 17th December 2012, 18:55
I need to keep a voltage level at .58VDC. I was trying to get away with doing it cheaply by using PWM but the problem is I need to use a capacitor to smooth out the voltage. It works but when I remove the PWM signal, the cap takes too long to discharge so getting an accurate reading isn't possible. I was going to try and use something like a resistor ladder network but the values I need are not common (581, 650, 825...).
I've never used a digital potentiometer but I guess they can't be so difficult. Then I thought about using an adjustable voltage regulator but I wasn't sure if it's right for my application. I have a thermistor where I need to keep the value at an exact voltage level (.58VDC). The current in the circuit is less than 10mA. Could I just tie the output and feedback of the voltage regulator directly to the output of the thermistor and push the easy button? Is there a software trick I could use to accomplish this?
mister_e
- 17th December 2012, 22:48
Food for thought:
Raise the PWM frequency so you can use a smaller cap value... a buffer in between also reduce the load... smaller cap
Some PIC have DAC... 5 bits but workable
R2R network + PWM
R2R Network + DAC
External 8-12 bits DAC
And so forth
HenrikOlsson
- 18th December 2012, 06:04
A small voltage regulator is easy. A voltage divider is even easier but is highly load dependent so you propably need to buffer its output if the load current isn't stable under all conditions. Just because there is no 581ohm resistor available doesn't mean you can't do it, take a 560ohm and a 22ohm in series, 1ohm off target nominally. For 650ohm, take 680ohm and 15k in parallel etc etc. By handpicking the individual resistors you can find a combination that is spot on.
/Henrik.
Christopher4187
- 18th December 2012, 07:01
I was hoping to use zero hardware and do something in the software but we can always hope, right......
I haven't done a whole lot of testing on it but I do know that the resistance decreases as the temperature gets warmer. Lets say that 1 volt is 100 degrees and .58V is 70 degrees (the thermistor isn't linear). For this application, I will always have to pull it closer to ground. In other words, if the voltage is below .58V, it will read the normal temperature.
I know I can use different combination resistors but then I would have to have about 8 different sized resistors on my board. I will need to try this tomorrow but I wonder if I use resistors in the ones or tens of ohms, instead of the hundreds or thousands of ohms, will that be enough to overcome the thermistor voltage in order to keep the voltage steady. Like I said, the current is low in the circuit, something like a milliamp or so.
For example, instead of using high value resistors ranging from 500ohms to 6000 ohms, I can use a 23ohm and a 3 ohm. I wonder if lower value voltage divider would override the thermistor.
spcw1234
- 18th December 2012, 16:34
The problem with using an adjustible voltage regulator is most of them don't allow you to adjust the voltage that low. I know the LM317 only goes down to 1.25V. I like to use zener diodes as a cheap method to limit voltage, but that won't work for this low a voltage either. Unless you use a 1.98V zener then run through 2 standard diodes (each droping the voltage 0.7V) That would put you right at 0.58V. That's not software though :)
What size capacitor did you try with your PWM and what frequency did you use?
peterdeco1
- 18th December 2012, 17:20
Your .58V is so incredibly close to the voltage drop across a standard diode. Perhaps you can experiment with the current through it to get .58V. Use it like a zener diode.
Christopher4187
- 18th December 2012, 18:10
What size capacitor did you try with your PWM and what frequency did you use?I was able to go as low as 150uF. As far as the frequency, not really sure, I just varied the duty cycle between 230 and 255. I used DT's interrupt routine as a poor mans HPWM.
Your .58V is so incredibly close to the voltage drop across a standard diode. Perhaps you can experiment with the current through it to get .58V. Use it like a zener diode.Good idea, didn't even think about that. I'll try that along with the solution below.
I think I may have found a workable solution. It looks like I was just using resistor values too high so I tried the 23ohm and 3ohm combination mentioned in my other post and it works perfectly. The only issue, which I think can be solved quite easily, is that the voltage divider draws about 185mA. Power consumption isn't really a problem because it's not being run from a battery but who wants to waste power?
This may be the bigger issue, I was going to "simply" use one output pin from an 18F4550 to turn the voltage divider on and off but that won't work as I have it now. Obviously disconnecting either the positive or negative leg of the voltage divider will throw off the thermistor value significantly. I was thinking about connecting one end of the voltage divider to one PIC pin and the other side to another PIC pin. I would make the PIC pins inputs when I don't need to force a certain temperature and then making one pin high and the other low when I needed it to work. Do you guys think this will work?
HenrikOlsson
- 19th December 2012, 06:19
I was thinking about connecting one end of the voltage divider to one PIC pin and the other side to another PIC pin. I would make the PIC pins inputs when I don't need to force a certain temperature and then making one pin high and the other low when I needed it to work. Do you guys think this will work?
Not if the voltage divider draws 185mA... Normally the PIC I/O's can source and sink 25mA.
Seems like you're getting there some way or another but if you need a regulator you could take a look at the SC4215 (http://www.semtech.com/images/datasheet/sc4215h.pdf), it'll go down to 0.5V and is available in SO8.
Charlie
- 19th December 2012, 12:20
I've read the thread several times, and I'm not quite sure what you are really trying to do.
Are you trying to measure temperature with a thermistor?
Do you need 0.58V for some reason, and if so what is that reason (this defines source impedance, etc.)
Are you trying to detect when something reaches a certain temperature, then take some action?
Depending on your answer, there are simple, and in some cases 0 extra component, solutions...
Christopher4187
- 19th December 2012, 17:42
The .58VDC represents an optimal temperature and I want to keep the thermistor voltage at that level while the 18F4550 continually checks the analog voltage once every 5 seconds. If the voltage is between .58 and 2VDC, the 18F4550 should force the voltage level (that is the issue I'm describing in this thread) to .58VDC. Below .58VDC and above 2VDC the thermistor value will not be forced. What did you have in mind?
I've gotten two methods to work, for the most part, but there are a couple of issues. The one I like the best is using a voltage divider from the PIC. I use two outputs and those pins are connected to the 18F4550 pins. It works really well and the voltage divider I'm using only consumes 10mA. Here's the problem and hopefully someone can point me in the right direction. When I put the pins as inputs, there must be a low impedance connection within the PIC because it pulls the voltage to ground. The pins I'm using are PORTE.1 and PORTE.2. I've tried PORTB.6 and PORTB.7. Can I configure something with the pins where they are truly in a high impedance state?
I've also used a zener diode (1N5352B) but only because it's all I had laying around. It worked better than I thought but it doesn't pull the voltage low enough. I'm going to look around, perhaps even Radio Shack, to buy some different types and play with them. I don't understand how to use a zener diode correctly in this application but I suppose it's not meant for it anyway. I will try the normal diode experiment when I get my hands on some. I know I have about 30 of them somewhere.....
Christopher4187
- 19th December 2012, 18:24
Ok, I have a workable solution. I still had a ground connection on the voltage divider, which pulled it to ground. So it looks like 2 pins and 2 resistors is all that is needed for this application. If anyone has some more ideas, I'd like to hear them.
wdmagic
- 23rd December 2012, 03:44
your best bet for those low voltages and loz currents are "voltage referance" chips/ics, most are in a to-92 case or surface mount, they come in 2 types, programable and fixed.
heres one that is so close you could use it, if it will work for your circuit. it is a .6 volt with a 6mv tollerance, so its min/max = .594 - .606
http://www.onsemi.com/PowerSolutions/product.do?id=CAT102
you can always use 2 programable VR's and create a differential voltage of .58 too.
pollynrickneo
- 24th December 2012, 06:42
I was hoping to use zero hardware and do something in the software but we can always hope, right......
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.