My personal "Rock of Sysiphus". I've built two dataloggers before, but neither worked very well.
There wasn't anything particularly wrong with the other datalogger recipe projects, they just weren't suitable for my equipment.
The first was the Backshed PIClog, however the tachometer data was useless coming from my motor-conversion projects and the current measurement was far too crude.
My second was an attempt to add many features to a 28-pin PICAxe chip, but I got drowned in all the little details of building the board for the thing, which comes as a single microchip and needs all the power supply, clock, memory, interfacing, and pin impedance protection details taken care of before every thinking of hooking up an analog input! Furthermore I still didn't have a good tachometer strategy so I would have ended up with more dud RPM data.
I finally hit on the tachometer solution which I documented here:
http://www.fieldlines.com/index.php/topic,149270.0.htmlThe key was realizing that no matter what warped and scrambled waveform comes out of my motor conversions, it comes to one phase, then the second, then the third, and then repeats - so instead of trying to measure peaks or times, all I really needed to do was cycle through series of triggers, one phase at a time, until it came back to the first.
Here's an example of the messy waveform I'm dealing with:
![](https://www.fieldlines.com/proxy.php?request=http%3A%2F%2Fwww.sparweb.ca%2FDiary%2FLogger%2FTypical_WT_Scope_Trace_400RPM_6.7Hz_xVpp_Line-to-Ground_web.jpg&hash=d82e392c6fbb782a4831ea377700755bc177ee2a)
Yes this project was also an opportunity to invest in a classic Tek 422 oscilloscope. Nothing newer than 1960's technology for me!
![](https://www.fieldlines.com/proxy.php?request=http%3A%2F%2Fwww.sparweb.ca%2FDiary%2FLogger%2FTek422_Scope_Front_web.jpg&hash=b45b5315cc1688cad1b0e293ad54b894ac1f17f9)
I got that tachometer working nicely back in July, and spend the next month figuring out if I wanted to make it a real data logger and pack more stuff into the box... Yes I do!
Here are photos from July, after I "packaged" the tachometer with a pretty LCD display and everything.
![](https://www.fieldlines.com/proxy.php?request=http%3A%2F%2Fwww.sparweb.ca%2FDiary%2FLogger%2FTach_Display_2017-07-21_web.jpg&hash=c78c836d104ad412ee69a264d485264526a5b16d)
![](https://www.fieldlines.com/proxy.php?request=http%3A%2F%2Fwww.sparweb.ca%2FDiary%2FLogger%2FTach_Progress_2017-07-21_web.jpg&hash=a08329612d0ffa025a1577dae37b36ae7e2d0cd1)
![](https://www.fieldlines.com/proxy.php?request=http%3A%2F%2Fwww.sparweb.ca%2FDiary%2FLogger%2FTach_test%28speedx2%21%29_063_web.jpg&hash=911553107e187a0b8fb8e72f3d7244786c80ec5d)
I am finally able to see my way through a whole datalogger project that could actually monitor my complete system. So far I've got 4 channels of current measurement, 4 channels of "misc" analog inputs, and a LCD display. The analogs are all scaled 6:1 right now so that I can measure up to 30V anywhere in the system (eg. battery, solar, wind). The Arduino runs at 5V so these analog inputs have a 5k+1k voltage divider to scale them. At least one more (unscaled) analog input is needed so that I can measure temperature, allowing me to calibrate the current measurement somewhat. The current sensors are boxed up separately so I'll show them later in a separate post.
Since I'm using an Arduino MEGA 256, the board has lots of spare digital pins that I haven't used yet, but only a dozen or so analog inputs. I have space set aside for 2 more analog inputs but there are still some more - for anything I've forgotten! I'm running out of space anyway on the expansion board that's stacked on top. It's getting a lot more crowded than it was in July when I took that last photo.
I started this post before realizing that I haven't unloaded the most recent photos from my phone, which shows the current look of the datalogger. Updates coming shortly then!