EcoRenovator  

Go Back   EcoRenovator > Improvements > Tools
Advanced Search
 


Blog 60+ Home Energy Saving Tips Recent Posts


Reply
 
Thread Tools Display Modes
Old 05-08-09, 12:43 PM   #1
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default DIY Data-Logger

I've been looking through several threads and have noticed interest in tracking data, also an interest of mine for my heat pump developments.

I've looked to buy data-loggers and they can be expensive. Most that I have looked at start in at $300.

Here's a cute but typical example:



TR-72U Temp/Humidity Recorder (USB) Price:$297.00

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



...nice looking product, but I was looking for a lot more functionality for a lot less money..




I did find an interesting unit ($60) at Spark Fun called the Logomatic:
SparkFun Electronics - Logomatic v2 Serial SD Datalogger

It's definitely a DIY thing. You get a tiny stuffed board that comes set up for 8 analog-to-digital channels (with micro-soldering 8 more are possible). The channels can also be configured to digital-to-analog and also digital in and out.

So the analog-to-digital channels will each read a variation in voltage from 0 to 3.5 volts and write the data to a micro SD card (user-supplied, 2 gig max), which can be read through a USB cable. The file structure is directly importable to Excel as a tab-delimited text file.

It is set up to be able to re-charge a Lithium-Polymer (AKA: LiPo) through USB and run off of that.

As it comes out of the box, it will not connect to USB and run at the same time. Running happens when only connected to battery and turned on


I bought 10 thermistors (thermally-variable resistors) to hook up to the analog-in lines. As it comes out of the box, it just writes values to the SD card, not temperatures.The ARM chip is capable of being programmed to make conversions on board, but at the present time I'm considering doing that on my PC, in Excel.

There's also a family of sensors called "1 wire" or "one wire" which actually require two or three wires, but a very large number of these can be controlled and read from and only need one I/O port.


I got 4 one wire thermometer units to experiment with. The attraction here is that compared to thermistors, they are more accurate, and do all their work within the chip, so stray voltage have little effect on them.

Another interesting item is a one wire humidity sensor that is capable of calculating dew point. I don't have one yet.

For my purposes, this unit will be ideal.
  • Most of the development work has been done,
  • the duration of most of my logging will be less than the time-to-exhaustion of the battery
  • A 2 Gig SD card will hold the data.

...But for longer logging periods this might not be the best logger. I have heard of another unit called the AVR Data Logger (AKA: Butterfly Data Logger):
Butterfly Data Logger - Google Search



This one has less power, a much lower current draw, and is reputed to be able to run for years on a coat-button sized Lithium battery.

Regards,

-AC_Hacker

Attached Thumbnails
Click image for larger version

Name:	logomatic.jpg
Views:	10996
Size:	38.5 KB
ID:	216   Click image for larger version

Name:	thermistor.jpg
Views:	21112
Size:	83.8 KB
ID:	217   Click image for larger version

Name:	thermometer.jpg
Views:	12980
Size:	22.2 KB
ID:	218   Click image for larger version

Name:	AVRButterfly.jpg
Views:	9236
Size:	70.0 KB
ID:	219   Click image for larger version

Name:	TR-72U_logger.jpg
Views:	9266
Size:	39.6 KB
ID:	222  


Last edited by AC_Hacker; 05-08-09 at 02:47 PM..
AC_Hacker is offline   Reply With Quote
Old 05-08-09, 01:06 PM   #2
Daox
Administrator
 
Daox's Avatar
 
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
Default

Thanks for posting these options. I know I was looking at loggers a while back and they are are expensive, and I'm not sure why. They aren't that complex.
Daox is offline   Reply With Quote
Old 06-29-09, 01:57 PM   #3
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default Data-Logger, Good Progress...

I have been working on my data logger and am happy to report that I now have a working unit and have been using it to do testing of hydronic floor ideas.

The log-o-matic board from Spark Fun had 8 A-to-D inputs and will digitize 8 voltage levels between 0 and 3.4 volts.

The first task was to build an interface board which consisted of a voltage divider with the thermistor being one of the resistors. The value of the fixed resistor was chosen to be about equal to the value of the thermistor, when the thermistor was at a temperature that was half-way between the range of values I expected to be measuring.

Here's the schematic:


I repeated this seven times on the interface board:


I also wanted one of the eight analog inputs to the data logger to measure power if I was testing a newly-built heat pump, for instance. I decided to use a toroid transformer, with the primary coil being the power line that conducted current to the heat pump. The secondary would then have a current induced into it that was proportional to current in the primary. Then I would rectify the AC and use a voltage divider to bring the voltage to a mid range between 1 an 3.4 volts.

It took several tries to do this... here's a photo of the secondary coil being wound on the toroid:


I forgot to photograph the primary winding. I used 14 ga. wire.

But here's a photo of the power-sender box:


Here's a photo of the working data-logger:


The data-logger isn't completely finished yet... it needs a case to protect it from accidents, but I'm using it so much, that may never happen.

So the data-logger writes files to a micro-SD card. When I hook up a USB to the data-logger, I'm able to download the data files and open them directly in Excel. This gives me access to a large set of data analysis and graphing tools.

My cost for the functioning data-logger is under $100. This includes log-o-matic board, thermistors, misc parts, etc. There was a large amount of time involved in putting it all together, but my understanding of data acquisition has increased substantially.

And it is a very useful tool.

Regards,

-AC_Hacker
Attached Thumbnails
Click image for larger version

Name:	interface-schematic.jpg
Views:	8907
Size:	30.2 KB
ID:	228   Click image for larger version

Name:	interface-board.jpg
Views:	9099
Size:	74.9 KB
ID:	229   Click image for larger version

Name:	torroid-winding.jpg
Views:	11616
Size:	94.8 KB
ID:	230   Click image for larger version

Name:	power-sender.jpg
Views:	9137
Size:	92.8 KB
ID:	231   Click image for larger version

Name:	data-logger(labeled).jpg
Views:	9719
Size:	65.4 KB
ID:	233  


Last edited by AC_Hacker; 06-29-09 at 02:32 PM..
AC_Hacker is offline   Reply With Quote
Old 07-02-09, 10:20 AM   #4
ldjessee
Lurking Renovator
 
Join Date: Jun 2009
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default

That is really neat.

Did you account for how long the wire is? I would want the thermistors all over the house and would worry about the variable resistance of long wire runs. Oh, and those runs acting like a big antenna.

What is the sampling rate you are using?
ldjessee is offline   Reply With Quote
Old 07-02-09, 12:24 PM   #5
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default questions on data-logger...

You bring up some interesting questions...

> ...and those runs acting like a big antenna.

The data I'm collecting has a degree of 'noise'. I tried to quiet things down with tiny by-pass caps in parallel with the thermistor, but without success. I tried twisting the wire to see if that would help, not so much. I tried re-locating my setup outside my house, to an electrically quieter area, to see if that helped significantly, no love there either. At this point, I can't tell if the noise is external (stray voltage being picked up by the wires leading to the thermistors) or internal (clock noise and/or processor noise). I'm suspecting that the noise is internal. At any rate, I plan to replace the unshielded wires with 1/8 inch coax. I'd recommend the same to you.

Another approach would be to correct the noise in Excel by averaging the readings over equal intervals that are appropriate to your application. For me at this point, my tests are running about 1.5 hours, with samples every second, and the events I am measuring are temperature changes in concrete, so the change is pretty slow. If I average over every 100 samples it should be pretty good.

But even with noisy samples, the data I'm getting is quite usable.

> I would want the thermistors all over the house and would worry
> about the variable resistance of long wire runs.

You could put the thermistors in place and afterword use some reliable temperature standard, like a lab-grade thermometer or boiling water (212 at sea level) and really slushy ice water (32 at sea level) and correct your logged data to reflect the known values.

> Did you account for how long the wire is?

I used the above method.

A really big lesson for me with this project has been the massive inaccuracy of cheap digital thermometers. They can still be useful, but you need a reliable standard to compare them to.

> What is the sampling rate you are using?

As the log-o-matic ships, it will sample from about 150 samples per second (if you read all 8 inputs) to 1 sample per second. My sample rate is at 1 per second.

It would be much better if the firmware was tweaked to have the ARM processor, which has plenty of power, to average every 100 readings, and to allow much longer sampling periods, like every minute or 10 minute or so...

There are tutorials at Spark Fun that encourage firmware-tweaking. If I was more fluent in the C programming language I would take this on.

I hope this helps...

Best regards,

-AC_Hacker

Last edited by AC_Hacker; 07-02-09 at 12:26 PM..
AC_Hacker is offline   Reply With Quote
Old 07-02-09, 01:06 PM   #6
ldjessee
Lurking Renovator
 
Join Date: Jun 2009
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Yes, going to shielded wire with the shield grounded to a separate ground would help, but have you thought of just looping the wire around a magnet a few times, one at each end?

Yes, I guess you could average over time, such as taking the 100 to 150 samples a second and then averaging them over a second.
ldjessee is offline   Reply With Quote
Old 07-03-09, 03:45 AM   #7
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default noise solutions...

Quote:
Originally Posted by ldjessee View Post
Yes, going to shielded wire with the shield grounded to a separate ground would help, but have you thought of just looping the wire around a magnet a few times, one at each end?
Yes, I did try looping the data-logger end of the cable several turns through a ferite core. No noticable help.

Regards,

-AC_Hacker
AC_Hacker is offline   Reply With Quote
Old 07-21-09, 02:07 PM   #8
NiHaoMike
Supreme EcoRenovator
 
NiHaoMike's Avatar
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 1,154
Thanks: 14
Thanked 257 Times in 241 Posts
Default

Quote:
Originally Posted by AC_Hacker View Post
I also wanted one of the eight analog inputs to the data logger to measure power if I was testing a newly-built heat pump, for instance. I decided to use a toroid transformer, with the primary coil being the power line that conducted current to the heat pump. The secondary would then have a current induced into it that was proportional to current in the primary. Then I would rectify the AC and use a voltage divider to bring the voltage to a mid range between 1 an 3.4 volts.
Actually, the voltage output is proportional to the derivative of the current. You'll need to integrate the output in order to get meaningful measurements if the load is not linear. Or use a hall effect current sensor which outputs a proportional signal.

And try adding capacitors to reduce the noise.
__________________
To my surprise, shortly after Naomi Wu gave me a bit of fame for making good use of solar power, Allie Moore got really jealous of her...
NiHaoMike is offline   Reply With Quote
Old 07-22-09, 10:39 AM   #9
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default Power & Noise

Quote:
Originally Posted by NiHaoMike View Post
Actually, the voltage output is proportional to the derivative of the current. You'll need to integrate the output in order to get meaningful measurements if the load is not linear. Or use a hall effect current sensor which outputs a proportional signal.

And try adding capacitors to reduce the noise.
Can you give me a bit more detail regarding integrating the output? Can you reduce it to an algebraic equation? If so, I can include that in the spreadsheet.

Do you know where I can get Hall effect sensors?

I've also gotten other feedback regarding the voltage/current phase shift encountered when measuring inductive loads. but I'm not sure how to proceed. I also don't know if it yields a minor error in my case or a major error.

There's a local group called "DorkBotPDX" DorkbotPDX | people doing strange things with electricity. I showed them my data logger and they were very interested in my project, especially the power measuring part. Apparently there is much interest in being able to log power in many projects.

I appreciate your response and any additional suggestions you may have.

I have tried caps, the ones I have tried do reduce the noise but only by maybe 10%. That's why I think it may be internal.

Best Regards,

-AC_Hacker
AC_Hacker is offline   Reply With Quote
Old 07-22-09, 11:23 AM   #10
NiHaoMike
Supreme EcoRenovator
 
NiHaoMike's Avatar
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 1,154
Thanks: 14
Thanked 257 Times in 241 Posts
Default

The output must be integrated before rectification. I don't know exactly what circuit or algorithm to use since I have not used inductive current sensors for precise measurement. I prefer hall effect current sensors or shunts.

And yes, you need to integrate power as vectors (not to be confused with the integration used with inductive current sensors). Which basically means to measure the voltage and current at a sampling rate of at least a few kHz, multiply the pairs individually, then take the average of them. (Not exactly the mathematical definition of integral but close enough.)

One way to make a cheap wireless power sensor is to take a cheap stereo wireless audio transmitter and receiver (such as a pair of wireless headphones), then use a voltage divider and current shunt to supply input to the transmitter (use a small power supply to power the transmitter itself and possibly the instrumentation amplifier for the shunt). Then adjust the receiver volume for the optimum precision (should be just under the maximum signal range of your A/Ds in worst case), tape it in place to prevent accidental adjustment, and calibrate it.

__________________
To my surprise, shortly after Naomi Wu gave me a bit of fame for making good use of solar power, Allie Moore got really jealous of her...
NiHaoMike is offline   Reply With Quote
Reply


Tags
butterfly, data, logger


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design