Adc with basic stamp reading not stable.
mogu93
Posts: 22
-
Hi there i using Adc0931 with basic stamp to find the voltage reading for my circuit
but i found out that my reading is not stable at all ,kept on jumping .Instead the reading i want is stable and when i turn it ,
it will change stably .anybody can help me with that? how to make it stable.While i found out when i test it with a variable resistor to the input of the adc it is very stable.
[/COLOR]' {$STAMP BS2} ' {$PBASIC 2.5} ' -----[ Program Description ]--------------------------------------------- ' ' This program demonstrates reading a variable voltage with an ADC0831 ' analog-to-digital converter chip. This program uses a Vref input of ' 5.000 volts (Vdd) for a bit resolution of 19.6 millivolts. ' -----[ I/O Definitions ]------------------------------------------------- CS PIN 0 ' chip select (ADC0831.1) Clock PIN 1 ' clock (ADC0831.7) DataIn PIN 2 ' data (ADC0831.6) ' -----[ Constants ]------------------------------------------------------- Cnts2Mv CON $139C ' x 19.6 (to millivolts) ' -----[ Variables ]------------------------------------------------------- result VAR Byte ' result of conversion mVolts VAR Word ' millivolts ' -----[ Initialization ]-------------------------------------------------- Reset: DEBUG CLS, ' create report screen "ADC.... ", CR, "volts... " ' -----[ Program Code ]---------------------------------------------------- Main: DO GOSUB Read_0831 ' read the ADC mVolts = result */ Cnts2Mv ' convert to millivolts DEBUG HOME, ' report CRSRXY, 9, 0, DEC result, CLREOL, CRSRXY, 9, 1, DEC mVolts DIG 3, ".", DEC3 mVolts PAUSE 100 LOOP ' -----[ Subroutines ]----------------------------------------------------- Read_0831: LOW CS ' enable ADC SHIFTIN DataIn, Clock, MSBPOST, [result\9] ' read ADC HIGH CS ' disable ADC RETURN [COLOR=#333333]
Hi there i using Adc0931 with basic stamp to find the voltage reading for my circuit
but i found out that my reading is not stable at all ,kept on jumping .Instead the reading i want is stable and when i turn it ,
it will change stably .anybody can help me with that? how to make it stable.While i found out when i test it with a variable resistor to the input of the adc it is very stable.
Comments
You're powering the Stamp via "Vin", well and good.
You show the Stamp "Vdd" pin connected to your 7805's output - not good. Disconnect "Vdd" (it is an output, from the Stamp's on-board regulator).
Why are you connecting the 7805 output to the Stamp's 5V (Vdd) output?
Tell me what good that accomplishes.
The resistor values in your sensor circuit are very high, 3.3M and a series on 1M. That makes the circuit susceptible to noise pickup from the AC lines and also radio frequencies. That will be especially true if the sensors are out on long, unshielded wires. You might have better results by connecting a 0.1µF capacitor from the ADC031 pin 2 to ground, close to the chip.
It would also help if you can reduce the resistor values by a factor of 10 or 100. What is the nature of the sensors?
When you attach a multimeter to the circuit, it will be averaging the reading, and it will be doing so in a manner that tends to reject 50Hz and 60Hz and radio interference. The ADC0831 does not do that, and the function of the suggested 0.1µF capacitor is to provide low-pass filtering at around 1Hz. It slows down the response of the circuit.
Another thing about the multimeter. Most multimeters have an input resistance of around 10MΩ, so when you use it to measure the voltage in a high impedance circuit, that 10MΩ becomes part of the circuit and affects the reading. The ADC0831 reading too is affected by the high impedance of the circuit, but in a different way, because the ADC0831 injects a tiny pulse of electric charge into your circuit from pin2 when it takes the reading. The 0.1µF capacitor should help with that. There are other tricks, using pin 3 as a differential input.
I'm aware.
Pick one or the other (not both):
If there's Vin supplied to the Stamp then leave its Vdd disconn'd.
If Vin isn't supplied to the Stamp then 5V from some other source can be connected to its Vdd.
As this chap went and made a 7805 circuit, I had the "absurd" notion that disconnecting the Stamp's Vdd pin from the mix was the quickest means to an end.
Thanks, I guess, but here I'm looking right at the BoE Rev C drawing and the Stamp's "Vdd" pin is disconnected from everything else but a 1000uF cap. The board's "Vdd" (so-labelled) is derived from a certain VR1 (7805).
I see what you mean about BOE rev C. I was looking at the BOE rev A schematic, which has the '7805 output as Vdd for both the BS2 and the external breadboard circuits. Rev C as you point out has them separated, the BS2 Vin connected to the input 9V supply, while the LM2940 supplies System-Vdd power only to the external circuits. That plus the extra 1000µF on the BS2-Vdd rev C power supply probably gives desirable isolation from spikes that might kick back from the servos or other externals of that sort.
i'm using flexiforce sensor http://www.tekscan.com/flexible-force-sensors the long version of it .
i using a high resistance 3.3M fixed, as when i connecting using 1M fixed all the sensor can't be work.But when i used value above 2M it can be work ,
so i decided to use 3.3M ,as the range of voltage jump when pressing all the weight sensor is more .
i urgently need help in it,as i need to figure it out where went wrong and change it
as my deadline is coming soon
http://www.ti.com/lit/ds/symlink/adc0831-n.pdf
There's an example with load cells ( == "weight sensors"?) on pg 35.
This is not a simple matter of slapping some load cells on it and "Bob's your uncle."
There's a lot of low-noise construction technique involved, too, depending upon how refined a result is expected.
Can't you use RCTIME for that?
RCTIME is a Stamp/PBASIC feature made for just such a thing.
Why is that impossible?
http://emesystems.com/BS2rct.htm#RCtime
http://www.dummies.com/how-to/content/electronics-projects-how-to-read-a-value-from-a-po.navId-810973.html
Let me say this about the circuit I used. The platform consisted of a triangle with flexiforce sensors at the corners, supported on its base by thin pads centered on the sensors. (felt furniture protectors). The sensors were all three connected in parallel. The resistance in parallel is Rp = 1/(1/R1 + 1/R2 + 1/R3). Also,each resistance to first approximation is proportional to 1/Force, so Rp = K/(F1 +F2 +F3). That is the resultant force of the three sensors combined, and in a perfect world that would distribute to carry the animal's weight no matter where the animal stood on the platform, so Rp = K / Weight. Thus the parallel resistance was a direct measure of the quantity desired. It could be measured easily with a voltage divider and an ADC. Fluctuations in the reading were a great indicator that an animal was present, but made it diffiult to get a trustworthy weight reading. K is an empirical proportionality constant, and it depends somewhat on temperature.
I see that you have 4 sensors connected in series, and based on my own experience, I wondered why.
Change Vref.
I would still like an answer to my question: Why not use RCTIME?
how does RCtime works?
Do you have the code for it ?
thanks!
As I understand it, you have a maximum variation of 200mV?
The datasheet's page 23 shows two examples: "Span Adjust", to adjust full-scale
and "Zero-Shift and Span Adjust", to adjust full-scale and establish a "window"
http://www.jameco.com/Jameco/Products/ProdDS/116100.pdf
PBASIC Help is always a good place to Start.
If that's not enough information, click the links that I provided, yesterday, in Reply #15.
In post #18 you said, "I not sure why my sensor is connected in series instead of parallel as i'm given the circuit by my lecturer. Mine is square board with 4 button at the corner with flexi-force sensor .so any one of it sense the load . the value will change accordingly." This is an assignment for school, and your comment troubles me, about not being sure why the sensor is set up that way, just because the lecturer told you to do it. Ask more questions. Understand the why. Maybe the lecturer is wrong. Maybe you don't understand the assignment. There are many possible things that can be done with this circuit and your job as a student is to explore and understand.
How about this. Can you borrow the multimeter again? Also one of the flexiforce sensors, by itself? Connect the sensor to the multimeter set on ohms. Record the resistance values that you see on the multimeter screen as you apply pressure on the sensor. What does it read when there is no pressure? What does it read when you press on it hard? What does it read when the pressure is in the range that you want to detect?
Please explain more what you mean by, " ... when will full load is around 0V when all 4 sensor connected in the 4 size of the Square board."
By "connected", do you mean when a force is applied? Where is that force coming from?
In a voltage divider circuit, it will not be possible to have it go all the way from 5V to 0V. If each sensor is in parallel with 1MΩ as you have it in your first schematic, then its minimum resistance with force applied will be about 200kΩ, and the maximum will be somewhere between 500kΩ and 1MΩ. The minimum for a chain of 4 in series will be 800kΩ and the maximum between 2MΩ and 4MΩ. You can calculate the voltage range depending on the top resistor that you have, which you showed as 3.3MΩ:
Vminimum = 5V * 800k/(3.3M + 800k) = 1V
Vmaximum = 5V * 2M/(3.3M + 2M) = 2V using 2nd sensor
or 5V * 4M/(3.3M + 4M) = 2.7V using 1st sensor
Do you understand that reasoning?