Author Topic: Arduino Reading Logger Output  (Read 2363 times)

0 Members and 1 Guest are viewing this topic.

Offline TheBushPilot

  • Senior Contributor
  • ****
  • Posts: 187
Arduino Reading Logger Output
« on: December 07, 2023, 09:45:41 AM »
Hi all,

I've seem to hit a wall recently.

My original plan was to use a legacy Campbell Scientific data logger (CR10X or CR23X) with an Arduino to push data to a database on my web server. The data logger outputs TTL ASCII serial strings to the Arduino which would in theory be able to parse the data and upload the values. That would make for a simple way to publish my data online without the need for expensive hardware/software.

The problem I am running into is with the input string resolution. When doing diagnostics to originally getting the two to communicate, I used HyperTerminal to make sure the CSI logger was actually outputting data. I found the string the logger output was formatted as "+0000.00" with space delimiters. I got the Arduino to receive the data but it seems as though it truncates the number past the tenths decimal place. Instead of "1001.84" it'll read "1001.80".

Ideally I would like the Arduino to read a string of several numbers, totalling around 60 characters.

Am I doing something wrong? Is this a limitation with the Arduino? I tried float and double to no avail. Should I look into something more robust? :?

Any feedback is appreciated


Cheers
Met Instruments Project
CHAD ASOS ID TRX001:
Camp. Sci. CR1000 Logger
R. M. Young 05103L 3M WS/WD
Apogee Inst. ST-110 2M Fast T
R. M. Young 43408 FARS
Vaisala HMT337 2M Td/Ref T
R. M. Young 41003 Gill (x2)
Setra  Sys. 270 StPr (x3)
R. M. Young 52202 Precip
Eppley Lab PSP 3M Solar Rad
PUSR USR-W630
Camp. Sci. CM110
------------------------
180 watt PV
300 Ah LiFePO4 Bank
------------------------
R. M. Young 26700

Offline rdsman

  • Senior Contributor
  • ****
  • Posts: 249
Re: Arduino Reading Logger Output
« Reply #1 on: December 07, 2023, 03:50:51 PM »
Does this help?

Serial.print(1.23456, 2) gives "1.23"
Ray

Offline TheBushPilot

  • Senior Contributor
  • ****
  • Posts: 187
Re: Arduino Reading Logger Output
« Reply #2 on: December 07, 2023, 05:00:28 PM »
Does this help?

Serial.print(1.23456, 2) gives "1.23"

Unfortunately not.

Even when giving the value multiple decimal places, it would still read only with the tenths place.

Where example would be the logger outputs "1004.395" and the Arduino when given 4 places still only receives input as "1004.4000".
Met Instruments Project
CHAD ASOS ID TRX001:
Camp. Sci. CR1000 Logger
R. M. Young 05103L 3M WS/WD
Apogee Inst. ST-110 2M Fast T
R. M. Young 43408 FARS
Vaisala HMT337 2M Td/Ref T
R. M. Young 41003 Gill (x2)
Setra  Sys. 270 StPr (x3)
R. M. Young 52202 Precip
Eppley Lab PSP 3M Solar Rad
PUSR USR-W630
Camp. Sci. CM110
------------------------
180 watt PV
300 Ah LiFePO4 Bank
------------------------
R. M. Young 26700

Offline TheBushPilot

  • Senior Contributor
  • ****
  • Posts: 187
Re: Arduino Reading Logger Output
« Reply #3 on: December 09, 2023, 11:03:55 PM »
Well turns out the data logger apparently has a hard limit for what number it can output.

Anything to "±99999." I guess. Not sure why though, I managed to get larger numbers to be received on my 26700 Young display no problem.

Regardless, what I'll end up having to do is parse the numbers into integer and decimal components and send them separately to be combined again to preserve resolution.

I'll post updates of what I am working on in the near future.


Cheers
« Last Edit: December 18, 2023, 05:19:02 PM by TheBushPilot »
Met Instruments Project
CHAD ASOS ID TRX001:
Camp. Sci. CR1000 Logger
R. M. Young 05103L 3M WS/WD
Apogee Inst. ST-110 2M Fast T
R. M. Young 43408 FARS
Vaisala HMT337 2M Td/Ref T
R. M. Young 41003 Gill (x2)
Setra  Sys. 270 StPr (x3)
R. M. Young 52202 Precip
Eppley Lab PSP 3M Solar Rad
PUSR USR-W630
Camp. Sci. CM110
------------------------
180 watt PV
300 Ah LiFePO4 Bank
------------------------
R. M. Young 26700