How to make ADC with RCTIME.
stevetronik
Posts: 15
Well legitamately this is a second post, since no one reply the first one, but I'll ask a slightly different question.
Original Post : http://forums.parallax.com/showthread.php?p=875743
above post is talking about using flexiforce sensor on propeller. I have yet to solve the problem, I'll greatly appreciate anyone can advice on the problem
I want to use propeller to accept analogs input, from 'flexiforce' as well as
now a IR sensor , Sharp GP2YOA or GP2D12.
How do you use RCTIME to do that?
I'm using the above code for flexiforce, I've yet to test with IR sensor.
Advice is greatly appreciated.
Steve,
Original Post : http://forums.parallax.com/showthread.php?p=875743
above post is talking about using flexiforce sensor on propeller. I have yet to solve the problem, I'll greatly appreciate anyone can advice on the problem
I want to use propeller to accept analogs input, from 'flexiforce' as well as
now a IR sensor , Sharp GP2YOA or GP2D12.
How do you use RCTIME to do that?
long RCValue OBJ tv : "vga_text" gr : "graphics" RC : "RCTIME" Num : "Numbers" PUB start tv.start(16) 'start vga display 'Initialize RCValue RCValue := 0 RC.start(0,1,@RCValue ) repeat tv.out(1) tv.str(string("R = ")) tv.dec(RCValue)
I'm using the above code for flexiforce, I've yet to test with IR sensor.
Advice is greatly appreciated.
Steve,
Comments
I strongly suggest using the analog to digital conversion routine included in the application note on the cog counters (AN001) here:
www.parallax.com/tabid/832/Default.aspx
Seems like it is very unstable, I'm using the Demoboard which seems to have to make connections on the breadboard.
Any advice to read analog value?
Thank you
Steve
depending on the sample-rate and the resolution it might be working stable at lower frequencies and with using higher capacitances.
But I can not say which values you would have to choose.
Or using an external Chip like the MCP3208. For this chip already exists an object in the obex
best regards
Stefan
Anyway solution i can use to read and intepret Analog values
Steve,
The RCTime solution is pretty slow even compared to a slowed-down ANN001-circuit
Tell us what the maximum-speed is that you need the digital value.
If its only 5 times a second you can slow down the ANN001-circuit a lot
And at such a low speed you can wrap the wires three times around the whole demoboard before you connect it to the capacitors
best regards
Stefan
I'm using the above code, reading from pin 1, with a circuitry provided meant for BASIC stamp, the value i get from RCValue, is a long number than changes, at high force compress the value changes very fast, (rather than increase or decreas as normal analog value should be). at no force the number stop changing.
I don;t see any relation in the value produce.
This means the flexisensor IS linear. The rctime-ciruit is NON-linear.
This is the reason why you can't "see" an easy to analyse correlation. And this is the reason why Mike recommended using the ANN001-circuit which works different.
If you still want to use the rc-time-circuit, you have to measure the force and the digital values and build a lookuptable like mentioned above
to compensate the non-linearity of the rc-time-circuit.
Excel and OO-calc provide a function to calculate an aproximation-formula to any kind of curves like linear, exponential, polynomical or logarithmic curves
best regards
Stefan
You can use this to read analog voltages.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Rudy's CNC Freeware·· http://www.enter.net/~schleinkofer
I would prolly used that as a last resort, would like try Mike Green suggestion on AN001 at the moment.
Stefan: As for a look up table, I was thinking linear and non linear, hence I wouldnt be able to set a treshold level specifying 0 and 1(too much force -1 and too less force -0) in spin.
so to formulate that look up table do i use the value obtained from tv.dec(RCValue) ?
thanks guys
Steve,
I have benn using the demo board for audio applications.
Here is what I have done while working on my audio delay project.
I built the ADC by:
1.·plugging in a 100K ohm resister into P0 and P6. short wire into P0 and long wire into P6
2. pluging in a 0.001uF ceramic disk capacitor into vss and soldering to the resistor wire at P6
3. Pluging in a 0.001uF ceramic disk capacitor into vdd and sodering to the resistor wire at P6
4. Soldering a 47K ohm resistor to the resistor wire at P6 and connecting the other end to my line level audio source
5. Soldering with very small wires a 1K ohm resistor accross the 10K resistor at the RC network between the amplifier and the headphone jack. This will raise the corrner frequency from approximatly 1.59Khz to 15.9Khz.
The ADC was stable and the audio quality fantastic.
You can play with the gain by changing the 47K ohm resistor.
I still need to thank a few form members for their support with my project.
I hope this helps.
SJW
http://www.parallax.com/Portals/0/Downloads/appnt/stamps/bs1Appnotes.pdf
Practical Pulse Measurements and Using a Thermistor. You can use MS Xcell plot wizard to back out the power-series polynomial equation.
I hope this helps
SJW
forums.parallax.com
·· -> Propeller Chip
······ -> Propeller Education Kit Labs, Tools, and Applications
·········· -> Measure Resistance and Capacitance
This chapter uses RC decay/growth circuits that return measurements that are linear - directly proportional to the variable element (R or C).· The linearity is demonstrated with an ohmmeter application that's good to 1% over four decades. It's the fourth post in the thread.
Incidentally, there are more chapters like this one at:
forums.parallax.com
·· -> Propeller Chip
····· -> Propeller Education Kit Labs, Tools, and Applications
Please drop me a line if you have any suggestions to improve the material or find any typos.
Thanks, Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/3/2010 10:22:55 PM GMT