1) What's an OP?Our OP wants to see a voltage in the range of ~0v-4v from the guitar pedal in order to be able to read it using the ADC of a microcontroller.
Changing the pot is out. Our OP doesn't want to open the pedal, which is understandable. The pedal only has two conductors in the cable and phono plug.
So, see the attached.
Since the available voltage (3.3v) is less than the required output, a CMOS 555 timer is employed as a regulated charge pump to boost the supply to ~ 5.1v.
C1 & C2 are required to keep the supply relatively clean. They should be located as close to the 555 timer as possible, particularly C2; it should be across the Vcc/GND leads. C5 should also be connected directly to the 555's ground terminal.
R1/C5 provide the timing for the 555. The output frequency will be ~66kHz. When the 555 output pin 3 is low, C3 is charged via D2, when the output is high, C4 is charged by C3 via D3.
When the voltage at node "Supply" reaches ~5.1v, Q2's base starts conducting, which turns off the 555 charge pump. The pink trace on the plot shows the supply voltage stabilizing at ~3.6mS.
C4 keeps the supply voltage across the current supply constant. It would not be a bad idea to add a 100nF/0.1uF poly metal film or ceramic cap in parallel with it.
D1, D4, Q1, R4 and R9 are the constant current circuit. The collector of Q1 sources ~100uA current to the pot.
On the plot, the output voltages are shown with the Rpedal pot value at 1m Ohms (0.001 Ohms) to 40k Ohms in steps of 5k Ohms.
Output will vary a bit over temp. I didn't simulate that portion with the charge pump, as it takes a fair amount of time to run.
You will need to put a 10nF cap from the ADC input to ground. As the output from this circuit is rather high impedance, be certain to allow adequate settling time between ADC reads (at least several mS), or your ADC will deplete the charge on the input cap.
The voltage is actually read by the ADC on the chip I mentioned above. I'm not sure what you mean by Vo? There's volate coming from the GUITAR PEDAL?Maybe the OP was on the right track in the first place and that is to linearize the result. Since the voltage is read into a PC, this is easy to do:
R2/R1 = Vo/(V - Vo)
The ratio Vo/(V-Vo) will give you the ratio of R2:R1
If R2 = 40K max and R1 = 10K, the max value of Vo/(V-Vo) will be 4.
where V = supply voltage
Vo = voltage from GUITAR PEDAL (R2).
The "original poster" or the "originating poster"; the person who started the thread - in this thread, that's you.1) What's an OP?
If you have a spare pin or two, sure - why not? Use the uC I/O pin instead of the 555 pin 3.2) I'm using a Silicon Labs C8051F321 chip which has a free timer on it, can I use that instead of the 555?
True, if you don't know how to do it efficiently. I have done a dewpoint calculation from temperature and humidity to one decimal place in both C and F in less than 2K bytes of memory. I challenge anyone to beat that!Hmm - division and multiplication in microcontrollers leads to code bloat. Include math.h, start slinging those mult & div operators around, then wonder where all your memory went and why your program slowed to a crawl.
If you have to start doing multiplication & division, try to break it up into shifts and adds/subtracts instead.
OK, I've been mulling this for two days *might* have a simple solution but my math skills suck.Hmm - division and multiplication in microcontrollers leads to code bloat. Include math.h, start slinging those mult & div operators around, then wonder where all your memory went and why your program slowed to a crawl.
If you have to start doing multiplication & division, try to break it up into shifts and adds/subtracts instead.
Weesh, these values are weird, first USB has 5V power, second why do you want 0-4V range if your ADC is powered with 3.3V? What is your ADC inut range?1) The device is USB powered so it's source is constant and produces 3.3V at the VDD pin.
2) 0-4V would be awesome (but I suspect the max would be 3.3V based on VDD above)
3) I'm reading the voltage back on an ADC so at least 200 discrete points would work. In the host computer, I compute a percentage based on the max and min.
1)I'm taking power off the Vdd pin from the chip, not the USB bus itself.Weesh, these values are weird, first USB has 5V power, second why do you want 0-4V range if your ADC is powered with 3.3V? What is your ADC inut range?
After further investigation, I *do* have access to 5.0V from the VBus+ pin.1)I'm taking power off the Vdd pin from the chip, not
Ken
Yes I have, this is what I was asking for before when trying to reduce this equation to R2.weesh, I hope you have been paying attention to my posts.
R2 = R1 * Vout/(Vin -Vout)
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Theory for linearizing behaviour in circuits | Analog & Mixed-Signal Design | 11 | ||
S | JFET VCR for linearizing sensor response | General Electronics Chat | 3 | |
T | Linearizing ordinary differential equations | General Science, Physics & Math | 1 |