Forum Software Ferduino code Density sampling and formula

Density sampling and formula  [SOLVED]


Post Number:#1 Post Fri Jan 19, 2018 9:40 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Hi Fernando,

can you please explain how you manage Density in Ferduino code please?
From the Atlas probe you read the SALINITY (the S parameter from the datasheet), right?

then you apply to the reading this formula, is it correct?

DEN = ((sensorstring[1] - 48) * 1000 + (sensorstring[3] - 48) * 100 + ((sensorstring[4] - 48) * 10) + (sensorstring[5] - 48));


Now I think that I have right readings and the probe is well calibrated but i see 1862 g/l on my cockpit...it seems to much to me...my expectetion is 1025 g/l...or something similar.
Where i'm wrong?

thanks
Last edited by Fernando Garcia on Sat Jan 20, 2018 8:50 am, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#2 Post Sat Jan 20, 2018 9:07 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

In fact I don't know if this code is right because I haven't an EZO stamp. This code was done with help of an user.

Add this lines:

      for (byte i = 0; i <15; i++)
      {
        Serial.print("i ");
        Serial.print(i);
        Serial.print(" = ");
        Serial.println(sensorstring[i]);
      }


Before:

      Serial3.flush();
      break;


Then show me the result on serial monitor.

BTW associate your temperature sensor to water, it's used for compensation.

Maybe you are getting wrong readings because the controller is sending -127 to the stamp.


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Sat Jan 20, 2018 12:29 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
I think you are right,
for sure the lack of temperature sensor for water is an issue! the new ones are not arrived yet.

I think i understand what you would like to see with the added part to the code but for my version is a problem to use the serial monitor fr the fact of the virtual serial port for the wifi.
However i tried to extract the infos from the test code for stamps...

it's something like this, sorry i closed the window and i cannot do copy and paste
0 = 2
1 = 6
2 = .
3 = 2
4 = 5
5 =
6 =
etc till 15.


so the reading that comes back with the output "S" active is something like this. Without temperature correction.
Last edited by Fernando Garcia on Sat Jan 20, 2018 12:59 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#4 Post Sat Jan 20, 2018 12:58 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Many things wrong here!

I think i understand what you would like to see with the added part to the code but for my version is a problem to use the serial monitor fr the fact of the virtual serial port for the wifi.


Why you can't use the serial monitor via USB cable? The virtual port is not on pins A7 and A8?



However i tried to extract the infos from the test code for stamps...

it's something like this, sorry i closed the window and i cannot do copy and paste
0 = 2
1 = 6
2 = .
3 = 2
4 = 5
5 =
6 =
etc till 15.


so the reading that comes back with the output "S" active is something like this. Without temperature correction.


It's absolutely wrong, 26.25 is not the current temperature used for compensation?

Try send first a T,? to see the current temperature;

Then send the approximated temperature with T,25

After send the R command to get the salinity.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Sat Jan 20, 2018 4:19 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
ok Fernando, sorry....let's clarify.

with the test code for stamps, i'm obtaining these data with this commands:

r --> 26.66
T ,? --> ?T,-127.00
T,27
T ,? --> ?T,27.00
r --> 34.58


so I think it works! this is the salinity of 35 ‰, right?

If I activate also SG as output:

o,SG,1 --> 34.56,1.026


there the first one is the salinity (S) and the second one is the density (specific gravity) in my opinion (in kg/l). What do you think?
Last edited by Fernando Garcia on Sat Jan 20, 2018 4:52 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#6 Post Sat Jan 20, 2018 4:52 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

You are confusing me!

Please disable SG and give me the output for S parameter only.

Again, I haven't the stamp to make test.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Sat Jan 20, 2018 4:57 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Yes, i can understand.
You have everything. Just ignore my last Line.
Look just this.

r --> 26.66
T ,? --> ?T,-127.00
T,27
T ,? --> ?T,27.00
r --> 34.58
Last edited by Fernando Garcia on Sat Jan 20, 2018 5:02 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#8 Post Sat Jan 20, 2018 5:05 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

So I think the previous code was right!

You should disable S parameter and enable SG only.

Give me the output for R command.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Sat Jan 20, 2018 5:25 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Here. Disable S. Enable SG.

o,S,0
o,SG,1
r --> 1.026
Last edited by Fernando Garcia on Sat Jan 20, 2018 5:39 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

Post Number:#10 Post Sat Jan 20, 2018 5:38 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Check this changes.

This equation should be right now.

DEN = ((sensorstring[1] - 48) * 1000 + (sensorstring[3] - 48) * 100 + ((sensorstring[4] - 48) * 10) + (sensorstring[5] - 48));


Only to explain let's use the value 1.026 as example.
sensorstring[1] = '1';

sensorstring[2] = '.';

sensorstring[3] = '0';

sensorstring[4] = '2';

sensorstring[5] = '6';


Looking to ascii table the decimal value to char '1' is 49 so: (49 - 48) * 1000 = 1000

Therefore the result for:

(49- 48) * 1000 + (48 - 48) * 100 + ((50 - 48) * 10) + (54 - 48)

Is:

(1 * 1000) + (0 * 100) + 20 + 6 = 1026.
Last edited by Fernando Garcia on Sat Jan 20, 2018 5:50 pm, edited 1 time in total.
Reason: Fix typo
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#11 Post Sat Jan 20, 2018 5:44 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
It would be impossible for me to understand without your explanation!
So:
- I’ll modify the Ferduino code activating just the SG output;
- I’ll wait for the temperature probes and i cross my fingers!

And obviously I’ll let you know.

Thank you Fernando.

Post Number:#12 Post Sat Jan 20, 2018 5:48 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Why you can't leave the current probe to water temperature for now?

Your tank is cycling and light is not needed for now.
Last edited by Fernando Garcia on Sat Jan 20, 2018 5:54 pm, edited 1 time in total.
Reason: Add info
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#13 Post Sat Jan 20, 2018 6:00 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Because i look better to those probes: there are just the transistors with heat-retractive glove on them....it’s crazy! That’s for sure why the other two, that stayed in ro water for some days, are not working anymore. I think is oxidation, as you said. Using also this one means to destroy it.

Post Number:#14 Post Sat Jan 20, 2018 6:03 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

I was thinking it was metal cap.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#15 Post Sun Jan 21, 2018 7:35 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
I was too much curious. I just tried with the metal cup ones, wanting for the plastic ones.
Everything seems to work.
Density: 1026 g/l.
Values seems stable.

I just turn everything on...let's see during next hours what will happen.
I confirm that i disabled S and I enabled SG.

Thank you Fernando!

keep you posted.




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron