[chbot] Raspberry Pi data logger.

Mark Atherton markaren1 at xtra.co.nz
Tue Aug 17 12:15:16 BST 2021

Hi Starr,

You should be able to source a current clamp with required isolation 
voltage. Given this, I rather like Andrews idea of taking the AC output 
of the CT and either rectifying and smoothing, or (if the output is low 
amplitude) voltage doubling. This DC can then be directly fed into one 
of the PI logic inputs to indicate pump running or not.

I am happy to help with circuit design if you can find out the RMS 
voltage from the CT when it drives a 33 ohm load, and the pump is 
running. Also worth checking any residual RMS volts when the pump is idle.

Also need to know the logic threshold of the input to your PI.

Given your background as a professional electrician, I don't think we 
need to worry to much about your safety with this project.

In terms of software, have a look around for an existing data-logger 
package for the PI, and some suitable way of displaying the results that 
are meaningful to you. You can test this setup with a switch and a pull 
up resistor initially.

The PI has a built in file system, and plenty of easily accessible 
storage, but as Darren points out, you can't just pull the plug when 
switching it off. Having said that, it shouldn't be too difficult to 
float charge a small lead acid battery, then regulate the output down to 
5V (PI main power) and gracefully close down the PI if mains is lost.

One step at a time; explore the PI before changing horses !!



On 17/08/2021 7:29 PM, Starr Moffatt wrote:
> Hi All,
> Thank you for including me as a member.
> I was the person that asked for help regards using the Raspberry Pi for 
> logging electrical data.
> As I thought I might be chatting only to a few people, rather than the 
> whole group, I did not have anything prepared.
> Thank you for the suggestions. As mentioned it was too much for me to 
> remember everything so please also inform me using this list. (Or use my 
> email address  zl3custarr at gmail.com )
> Please see below more info.
> 17 AUGUST 2012
> The idea for this came about at my brothers place where it was thought 
> that maybe due to an “unseen” water leak the water pump would be 
> operating at “regular” intervals and therefore consuming electricity.
> For this to be checked the best place to monitor the pump circuit is at 
> the switchboard.
> A clip on a.c. current sensor would be the best option for detecting 
> when the pump was operating.
> For this to be logged, the current sensor could drive a 4N26 opto 
> isolator along with a storage capacitor arrangement on its output, to 
> provide a constant signal to the Raspberry Pi’s input while the current 
> was flowing to the pump. Note this would not provide a value of current, 
> instead just the indication that the pump was on or off.
> The Pi would be required to log this on/off state, at regular intervals, 
> say 1 minute, along with a time/date stamp. Therefore the Pi would need 
> to populate a suitable spread sheet with this data.
> Mark, I think you had some suggestions on this so I would appreciate you 
> written comments.
> Peter Harris suggested I look at Openenergy Monitor which I have done 
> and I have found a suitable circuit for the current sensor arrangement. 
> Thank you.
> Another idea that I am looking at is to be able to check the times that 
> a water heating circuit is enabled. This would only need a 230V coil 
> relay with a NO contact connected between a Pi supply and one of its 
> inputs. This would also require another column to be populated in the 
> spread sheet.
> In the future:
> I am also thinking that it may be of use to record the values of current 
> and voltage. Again a spreadsheet would be needed which could also have 
> columns for power and, using integration, kWh. I guess an Arduino would 
> be simpler as it has built in A to D conversion, however as I already 
> have the Pi I will persevere with it at this stage. Just looking at the 
> drawing for the current sensor for the Arduino; 
> https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/files/Arduino_AC_current_input_A.png 
> it looks as if the software determines the peak value and from there 
> calculate the RMS value. I assume the voltage RMS value will also be 
> calculated using the peak value as well. I have heard that the scan rate 
> of the Pi is slower than the Arduino so I wonder if this would have a 
> bearing  on the Pi’s ability to determine the peak value.
> Cheers,
> Starr Moffatt

More information about the Chchrobotics mailing list