Weather Software > Other Weather Software
Arduino Reading Logger Output
(1/1)
TheBushPilot:
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
rdsman:
Does this help?
Serial.print(1.23456, 2) gives "1.23"
TheBushPilot:
--- Quote from: rdsman on December 07, 2023, 03:50:51 PM ---Does this help?
Serial.print(1.23456, 2) gives "1.23"
--- End quote ---
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".
TheBushPilot:
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
Navigation
[0] Message Index
Go to full version