quick & dirty datalogger

Status
Not open for further replies.

BJB

Well-known member
Need something by Monday to monitor a power grid connection, and am new at embedded stuff.

Want to record data for approx 12h, then have the Teensy 3.1 board wait, the download the logged data to my laptop thru the USB.

Attached code is what came tumbling out last nite. Would very much appreciate a sanity check and verification of basic feasibility before I continue down the rabbit hole

Thanks very much.
 

Attachments

  • PV_monitor_X1.cpp
    2.3 KB · Views: 159
Need something by Monday to monitor a power grid connection, and am new at embedded stuff. Want to record data for approx 12h, then have the Teensy 3.1 board wait, the download the logged data to my laptop thru the USB..

Could you also include a connection diagram with any sensors you're using?

The code seems somewhat self-explanatory, though you only seem to be saving uncompensated ADC values. I wonder if it wouldn't make sense to scale the read values based on measurements right inside the Teensy. Open-loop control.

You may also want to make use of the SD piggyback module, it allows you to save boatloads of data to inexpensive SD cards. You can still access via USB or simply extract and put into your computer directly. If anything, it avoids the potential problem of data getting wiped by accident if the Teensy is disconnected from power, experiences a glitch, etc. With an SD card and a watchdog feature, you can avoid the module hanging by accident and losing a days worth of data.

Last but not least, I would capture the time of day as part of your measurements. Even if you only capture the current time once at the beginning of testing and then increment on a 10s basis. Helps with analyzing the data afterwards.
 
Last edited:
Agree that the SD would be great, but is one of those things that has to get done now, so have to limit to parts currently on bench.
Do not care about 'real' time. The data values will be transmorgified to engineering units by the Python script that downloads the data thru laptop USB.

Basic block diagram and code that passes compilation stage is

Thanks much.
 

Attachments

  • PV_monitor_X1.cpp
    2.3 KB · Views: 155
  • Grid_IF_X1.pdf
    191.2 KB · Views: 175
Status
Not open for further replies.
Back
Top