How do i connect a ADC0831 to a baics stamp oem 2 board, and get results on a s
MARKYODB2
Posts: 5
Hello,
For a project i am trying to create a ph meter. As of right night i have a TLO74 connetced to a ph electrode.
The Readings i am getting from this range from 2.824 volts for a ph of 0 and 2.0425 volts for a ph of 14. giving about 1ph per 55.85mV.
I am feeding this imput into pin 2 of the ADC0831.·I have pin 4 of the ADC0831 coneceted to pin 13 of my stamp, pin 6 to pin 14 of the stamp, and pin 7 connected to pin 15 of the stamp. pin 5 and 8 oc the ADC are connevted to +5V and pins three and four to ground. I belevie i have everything hooked·up correctly, but i am not sure on how to start the coding. Any help is greatly appreciated. as to i am new with the stamp basic enviroment.
thanks
mark·
For a project i am trying to create a ph meter. As of right night i have a TLO74 connetced to a ph electrode.
The Readings i am getting from this range from 2.824 volts for a ph of 0 and 2.0425 volts for a ph of 14. giving about 1ph per 55.85mV.
I am feeding this imput into pin 2 of the ADC0831.·I have pin 4 of the ADC0831 coneceted to pin 13 of my stamp, pin 6 to pin 14 of the stamp, and pin 7 connected to pin 15 of the stamp. pin 5 and 8 oc the ADC are connevted to +5V and pins three and four to ground. I belevie i have everything hooked·up correctly, but i am not sure on how to start the coding. Any help is greatly appreciated. as to i am new with the stamp basic enviroment.
thanks
mark·
Comments
http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf
I am reveiving a number 74... although i should be getting an output voltage of about 1.4 what did i do wrong?
ADres VAR Byte ' A/D result (8 bits)
ADcs CON 13 ' A/D enable (low true)
ADdat CON 14 ' A/D data line
ADclk CON 15 ' A/D clock
Kal CON 14961 ' Constant to be determined.
txPIN CON 0
Baud19200 CON 32
START: LOW ADcs ' Enable ADC
SHIFTIN ADdat,ADclk,MSBPOST,[noparse][[/noparse]ADres\9] ' Shift in the data
HIGH ADcs ' Disable ADC
DEBUG ?ADres ' Display the result
PAUSE 1000 ' Wait a 0.1 Seconds
SEROUT txPIN, Baud19200, [noparse][[/noparse]22,12,18]
SEROUT txPIN, Baud19200, [noparse][[/noparse]148," PH",157,DEC ADres]
PAUSE 200
SEROUT txPIN, Baud19200, [noparse][[/noparse]22]
GOTO START ' Repeat forever
It's not going to bounce back with volts, but how many parts (of full-scale.)· Get it?
It does not stay at 71 all the time it fluctuates a few different numbers. Do you know how to take the average of 4 readings then display this. im not getting accurate readings by doing my division scale. as to converting to a actual ph number.
Read PBASIC Help, it's pretty easy to take a reading and sum it with another and divide it by two.· Do a couple of digits or "error" make a difference?
ADcs CON 13 ' A/D enable (low true)
ADdat CON 14 ' A/D data line
ADclk CON 15 ' A/D clock
pH VAR Byte
mV VAR Byte
Kal CON 14961 ' Constant to be determined.
txPIN CON 0
Baud19200 CON 32
DEBUG CLS
I am trying now to display the results of a ph of seven by (2.110 is 42.2% of 5V) and .422 in fraction is 211/500.
the result is displaying 0 ph. how is that possible? or is there a way to set up a calculation as to ph = ADres*55.85(ph levels)?
START: LOW ADcs ' Enable ADC
SHIFTIN ADdat,ADclk,MSBPOST,[noparse][[/noparse]ADres\9] ' Shift in the data
HIGH ADcs' Disable ADC
DEBUG ?ADres ' Display the result
PAUSE 1000 ' Wait a 0.1 Seconds
SEROUT txPIN, Baud19200, [noparse][[/noparse]22,12,18]
SEROUT txPIN, Baud19200, [noparse][[/noparse]" TEMP ","."," F",148," PH",157,DEC ADres*(211/500)]
PAUSE 200
SEROUT txPIN, Baud19200, [noparse][[/noparse]22]
GOTO START ' Repeat forever