Can anyone Help With Atlas PH stamp on propeller
Igor_Rast
Posts: 357
Ive just recieved my ph stamp of atlas that I was waiting for for so long,
Ive tryed everything but I cant seem to get the simple code to work
if got my stamp connecter tx stamp - pin8 propeller , rx stamp - p7 propeller
And to get started I need to send a simple asci code to the stamp and wait for the reply..
hope anyone can help me with some code to send then recive the data from the stampp
here a link of the datasheet of the stamp , so you can see the simple commands
https://www.atlas-scientific.com/index.php/datasheets?task=document.viewdoc&id=1
hope to get some help soon
Igor
Ive tryed everything but I cant seem to get the simple code to work
if got my stamp connecter tx stamp - pin8 propeller , rx stamp - p7 propeller
And to get started I need to send a simple asci code to the stamp and wait for the reply..
hope anyone can help me with some code to send then recive the data from the stampp
here a link of the datasheet of the stamp , so you can see the simple commands
https://www.atlas-scientific.com/index.php/datasheets?task=document.viewdoc&id=1
hope to get some help soon
Igor
Comments
The Propeller should be able to work though. You might download the Simple_Serial I/O driver from the Propeller Object Exchange. This can do ordinary serial I/O up to 9600 Baud. Alternatively, you could download the BS2_Functions object from the Propeller Object Exchange. This provides many of the functional pieces that are implemented as statements in Parallax's Stamp Basic, but as Spin subroutines and functions. There's some explanation in the source code comments for each of the objects. If you're using the Propeller Tool for Propeller programming, these object may already be included in the installation folder.
http://www.youtube.com/watch?v=UIk6CAINpwo
... Tim
Set your teminal window to 57600 baud and let me know if this program works.
Try typing "L1" followed by enter (and without the quotes) into the terminal window. The LED on the pH Stamp should light up.
I do a lot of pH testing. I'm very curious what you think of your pH Stamp.
I hope you let us know how it works.
so this far I am
The light on the stamps blinks like it get's the command to execute a single reading
but when I try to get the reading , the program stalls at the Serin routine
can you help me whit the problem
So thank you alot
on the other hand , Im fairly new to the propeller and I struggle my way around with most code's but I don't understand a thing of how it works,
how can I get the data to be displayed in a lcd
or mean can you help me with it
im trying for some time allready to make a PH & Ec controller . to Get it wright I decided to get theres stamps.
some help would be great
you need an address symbol "@" in front of "ph".
ph also needs enough bytes to hold all the characters that are returned.
Use the above, if don't ever expect to receive more than 15 characters.
You'll also want a way of displaying the received data.
The above should display the received data.
It would probably be a good idea to zero out the byte array between reading from the pH Stamp. If the number of characters received isn't always the same, you could end up having old charaters in your array.
The following code will fill the array with zeros.
Edit: Igor, I hadn't seen your last post when I wrote this. Let me know if you're still having trouble.
This is how the controller looks like now :P
Mike's comment about Simple Serial's baud rate limited reminded me BS_Functions has the same limit.
You'll probably want to use Parallax Serial Terminal or FullDuplexSerial.
it still get's stuk at the step 5 so at the recive ?????
but recieving the data was always a problem for me , espesialy withe the timming etc.
you have any idear how a simple code looks like for the fullduplexserial
it needs to
send
step 1 send - E,13
step 2 send - R,13
step 3 recive the data
display the data
later ill adjust to let the stamp temperture compensate , I have a DS18b20 temp sensor also connected to the stamp to take care of that part for me
igor
I think this should get you started.
The program only sends the "end" command once. From the documentation, it looked like it only needed to be sent once.
I haven't tested this code and I don't use the "StrIn" method very often (if ever) but I think this code should work.
thanky you verryyy veryyy much , Ill keep you posted on how the status of the project is , scool also killing all my time ,
and im waiting on a ec probe so I can setup the ec stamp *** well
o almost forgot
I was going to use temperture dependant readings so . I have a ds1820 sensor connected also and this put's the temp on the lcd,
how can I make the code accept the temp variable to send in place of the R to get a temperture compensated reading
the temp code looks like this now in this stage , but works so far
Ill hear from you later , gonna cath a sleep now , tomorrow early scool again
thanks again
& hope to hear more from you , help like you is priceless
If you're not just sending integer values, you'll have to use some other steps.
You'll also want to calibrate the meter with buffer solutions. If your meter isn't calibrated, the temperature correction isn't going to matter since you'll likely have greater errors from not calibrating the meter than you'll have from temperature differences.
It's too bad the pH Stamp doesn't output the millivolt readings because then you could add extra calibration options into your program.
I've found my pH meter had a hard time accurately measuring pHs around 2 when just calibrated with buffer of 7.00 and 4.00. I have to use a 1.68 buffer and 4.00 buffer to calibrate the meter when I want to measure low pH levels.
It's best if you can "frame" the pH you wish to measure with buffers above and below the value to be measured.
I hope you know about using an appropriate soaking solution for your electrode. Don't soak it in distilled water. pH electrodes will go bad over time (kind of like a battery).
When you get your EC Stamp, you'll need to use a resistor of at least 3.3K between it and the Prop to protect the Prop from the 5V signal levels.
When I read some data sheets on the type of ADC used in pH meters they stressed the importance of keeping the electronics clean. They strongly suggested using finger cots when handling the chip.
pH electrodes don't provide a signal that is easy to read for just any ADC chip.
before I get to sending te temperture to the PH stamp to get a temperture compensated reading , I began to figure a way to calculate with the numbers
I want to get the difference between the mesured Ph of the stamp and a Target_PH value that I set( just a constant now, later ill add it in a lcd menu)
now the problem looks like I can't get the Ph value that is stored in message buffer to become a floating point valve , so I can make a simple subtraction
target PH - actual Ph = diference
this diference is later used to let the pumps know howmuch to dose
Can you help me with the string to float ???
hope to hear soon
igor
I thought you'd end up wanting to do something like this.
You probably don't need to use floating point numbers.
Talke a look at this thread to see what is referred to as "pseudo real" numbers.
To turn the ASCII characters to a number, take a look at the "StrToBase" method in PST. You'll want to make it a public method. Use base "10" in the conversion. You'll still need to worry about the decimal point. If the decimal point is always in the same place, you can just us a constant multiplier to know how many places your pseudo real number has been shifted.
So unless you need some complex mathematics, I'd stay away from floating point numbers for now. When you do need FP, Lonesock's "F32" is the object to use. Lawson just fixed a bug in it. The most recent version is here (post #84).
now on my attemt to send the temp to the ph stamp Ive tryed everything again to get they data alined to be send .
like 23.5 <cr>
i moved the data in diferent forms , now I got them in the right spot in the data , but there in the wrong format , there decimal number and need to make it a asci .
can someone please point out wich way I have to look for an anwserrrrrrrrrrrr
I also tryed to convert them one bye one ,like in the code below . works wel for the first digit , second digit is a diferent story sadly enough HELLLLLLLLLPPPPPPPPPPPP
after that I need to send a <cr> so 13
so the total sting is
50,55,46,53,13,0
that's somthing diferent flom that floattostring object or Am i wrong ???
in place of the R . I have to send the temp data
those are the byte's that need to be send
can't find a way out
Anyway,
but Im verry happy to say
that your the man of the night
it work like well
now it's like this
with this code I get a temperture compensated reading on my lcd , using a ph stamp of atlas and a ds1820 temp sensor
also I made some calc to get the dierance between the actual Ph and a target Ph later to set
THanks allot, Hope the code will help someone one the milestone
It looks like the only time you're using floating point math is to multiply and divide (which work fine using integer math). I still think it would be easier to convert the temperature to a pseudo real number (by multiplying it by a set amount and then use the "FRound" or "FTrunc" method to convert it to an integer) and then do the rest of the calculations in pseudo real integers.
You can then use the "DecPoint" method I linked to, to send the number to the pH Stamp.
If you stay with floating point, use the method kuroneko showed you.