Microcontrollers > Data Logging

Datalogger update

<< < (3/7) > >>

SparWeb:
I've never attempted anything so complex.  This datalogger is my most complicated program and, stripped of the comments, introduction notes, and disabled segments of code, it's only 400 lines or so.

I did write a solar-system simulator, with a graphic of the planet's orbits and a buttons to control the rate of time passing.  And in school I wrote a jet engine performance calculator as a thermodynamics project.  Those did not need hundreds of lines of code, however!  Just enough to appreciate the value of comments in my code so that I can come back to it later.  It still takes me a while to remember what's going on, including this week since I hadn't touched this for a few years.

SparWeb:
Now that the logger is installed again, and I've finished some tweaks to get nice-to-have things like temperature compensation of the current sensor working, I'm getting data that looks reasonable.  I still have to calibrate it more rigorously before trusting anything it tells me.

What I'm going to enjoy a lot from now on, is the new spot for the battery shed is in a better line of sight for WiFi to work.  I can leave the laptop outside in the shed and it doesn't get disconnected from the router, so I can collect the logger's data from the comfort of my chair in the house.

The wind is coming up and the temperature is dropping, so rather than fuss about with calibrating numbers, I'm just going to let it log the data, good or bad.
I can do some sanity checks on the data - see if it's good enough to just need calibration tweaks, or whether something is so out of whack that I have to re-think the code.

SparWeb:
It is SOOO nice watching the data come in while sitting warm in the house.

Now I can't resist the urge to write a dashboard program!

DamonHD:
That's the sort of hedonism the world can cope with more of!

Rgds

Damon

SparWeb:
A little more pruning and what a silly thing to be removing, it turns out.

I have fussed about with the calibration of the current sensor for quite a while.  It was a "to-do" thing for a while when I first built the datalogger, and I got it "close enough" and then dropped it for a while.  When I came back to the project this month I chopped out hardware and tweaked the conversion from 10-bit digital to the analog current measurement, but I left it messy.  I promised myself to fix it later. 

"Later" came along today, and I spent some time looking at what the math is actually doing.  On a hunch I had the datalogger dump raw digital values to the serial port for a while until I was convinced my hunch was right.

I should also note at this point that it's been below -20C for several days and today was a toasty -14C in the sunshine.  My laptop doesn't like me.

Anyway, I basically eliminated all of the temperature compensation and strange adjustment factors in the current sensor calculation.  I needed to TRUST the voltage regulation on the Arduino board.  Which I should have been doing all these years in the first place.  All that faffing about to find the temperature compensation factor was probably caused by an earlier error in a linear slope converting the 10-bit number to a proper voltage. 

Did another logging run this afternoon, and I was rewarded by a pile of data that hugs the trend-line a little closer than it used to. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version