Jump to content

Monitoring my electrics with a Raspberry Pi


Mat B

Featured Posts

Do I have to click on the link to get any details?

Yes - output goes to a web page.

 

Look at using an arduino or a pic / picaxe. The pi will draw between 0.5 and 0.8a continuously. If nothing else it'll help flatten the batteries for you!

I realize this - solar panels will cope, even in winter.

 

m@

Link to comment
Share on other sites

Yes - output goes to a web page.

 

I realize this - solar panels will cope, even in winter.

 

m@

 

OK I clicked the link, there's some graphs showing voltage and amps etc are logged frequently, but no details on costs of the sensors, the CPU, etc etc and I'd be interested in these to see how it compares with other solutions such as BMV-702 + computer interface etc.

Link to comment
Share on other sites

 

OK I clicked the link, there's some graphs showing voltage and amps etc are logged frequently, but no details on costs of the sensors, the CPU, etc etc and I'd be interested in these to see how it compares with other solutions such as BMV-702 + computer interface etc.

It's a different kettle of fish, the Victron unit is plug and play, the Raspberry Pi route involves many happy hours of research, soldering, programming, installing and calibrating.

 

 

One of the advantages of the Raspberry is that it is fully configurable, if I want to change switching voltages, ranges, etc. I can do this through the programme. I could easily add ten more voltage/current/temp. sensors if I wanted to.

 

Here is a parts list and photos:

Circuit Board £4.74

http://www.hobbytronics.co.uk/raspberry-pi/rpi-breakout-boards/humble-pi

 

ADC £2.16

http://www.hobbytronics.co.uk/electronic-components/misc-ic/mcp3008-adc

 

4-way relay board £9.60

http://www.hobbytronics.co.uk/4-channel-relay-board

 

Current sensor £3.36

http://www.hobbytronics.co.uk/sensors/sensors-current/acs711ex-31a-current-sensor

 

Temp sensor £3.00

http://www.hobbytronics.co.uk/sensors/temp-pressure/ds18b20-temperature-sensor

 

Rasperry Pi A £20.05

http://cpc.farnell.com/raspberry-pi/raspberry-moda-256m/sbc-raspberry-pi-model-a-256mb/dp/SC12879

 

Memory Card £9.07

http://uk.farnell.com/samsung/mmctr08gubch-rmlmk-farn-kit/memory-microsd-noobs-java-8gb/dp/2428393

 

Power Supply £1.00

http://www.ebay.co.uk/itm/New-DC-12V-24V-40V-to-5V-4-USB-Step-Down-USB-Step-down-Power-Supply-Module-/400762439697

 

WiFi dongle £10.15

http://uk.farnell.com/element14/wipi/dongle-wifi-usb-for-raspberry-pi/dp/2133900

 

 

 

Capacitors, resistors, wires and connectors cost a few pence and were mostly in stock.

 

 

gallery_5236_1209_151680.jpg

 

gallery_5236_1209_73925.jpg

  • Greenie 2
Link to comment
Share on other sites

Thanks for the info, looks interesting. I think I'd personally need more than 75A current range, but the +/- 31A ones could be useful to put in strategic locations (like the solar controller, fridge, etc) and possibly use a shunt for the main domestic in/out then use a voltmeter sensor to work out current that way.

 

I bought a BMV702 though - which was a big decision since its not exactly cheap, but never regretted it since I've been able to test things and interpret the results, which revealed the domestic batteries were indeed on their way out. Since I've replaced them, I don't really pay as much attention to battery monitoring and just sit and browse the internet, watch telly etc.

Link to comment
Share on other sites

So, what's wrong with a multimeter and a bit of paper?

 

 

Just joking (though some Luddite is sure to be thinking it!). Looks the biz and having just looked, I see the Pi A's power consumption is a lot less than I thought. What did you use to write the operating software?

Link to comment
Share on other sites

It's a different kettle of fish, the Victron unit is plug and play, the Raspberry Pi route involves many happy hours of research, soldering, programming, installing and calibrating.

 

 

 

What's the chances of you saving us all the research time or a massive chunk of it and posting some instructions here or somewhere else?

Link to comment
Share on other sites

So, what's wrong with a multimeter and a bit of paper?

 

 

Just joking (though some Luddite is sure to be thinking it!). Looks the biz and having just looked, I see the Pi A's power consumption is a lot less than I thought. What did you use to write the operating software?

 

OK I've been looking for half an hour and can't find it (all I found was that it was a third of the model B ) - whats the Pi A's power consumption?

Edited by Paul C
Link to comment
Share on other sites

OK I've been looking for half an hour and can't find it (all I found was that it was a third of the model B ) - whats the Pi A's power consumption?

Looks like about 1/2 watt at idle, but a good bit of that is the resistive regulator taking the supply from 5v to 3.3v. Replacing that with a switching reg might take the idle consumption down to 0.3 watt. See eg here:

 

http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=32955

Edited by nicknorman
Link to comment
Share on other sites

So, what's wrong with a multimeter and a bit of paper?

 

 

Just joking (though some Luddite is sure to be thinking it!). Looks the biz and having just looked, I see the Pi A's power consumption is a lot less than I thought. What did you use to write the operating software?

Python.

 

 

What's the chances of you saving us all the research time or a massive chunk of it and posting some instructions here or somewhere else?

I haven't got time to write instructions at the moment - it's all on the internet somewhere.

 

Looks like about 1/2 watt at idle, but a good bit of that is the resistive regulator taking the supply from 5v to 3.3v. Replacing that with a switching reg might take the idle consumption down to 0.3 watt. See eg here:

 

http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=32955

The new Model B+ does use a switching regulator.

 

Looks fantastic! Pi is cheap and powerful.

All I can say is wow. Did you do all the work yourself?

Bob

Yes :-)

 

Same here.

 

Could I do this with a Iphone?

I don't know, I haven't got an Iphone.

Link to comment
Share on other sites

I dont think a smartphone could do it without some home-made electronics or possibly a clever "box" of electronics which is available to purchase, because it would need to accpet inputs of current and voltage sensors.

 

IF that could be done, it would be interesting to say the least! Other possibilities include using the GPS sensor to monitor location and speed; and driving outputs to eg turn things on and off, for example if the batteries are running low then turn off something; or if you're a leisure user then turn on the fridge remotely, the day before you arrive at the boat; or turn on/off the central heating remotely.

Edited by Paul C
Link to comment
Share on other sites

I dont think a smartphone could do it without some home-made electronics or possibly a clever "box" of electronics which is available to purchase, because it would need to accpet inputs of current and voltage sensors.

 

IF that could be done, it would be interesting to say the least! Other possibilities include using the GPS sensor to monitor location and speed; and driving outputs to eg turn things on and off, for example if the batteries are running low then turn off something; or if you're a leisure user then turn on the fridge remotely, the day before you arrive at the boat; or turn on/off the central heating remotely.

Interesting stuff.

What would be the advantage of this over a commercially available system that uses SMS and a SIM card? I can see the satisfaction of building it yourself, but not sure what the potential extra features could be.

Turning the fridge on remotely isn't realy an option as most would leave the door wedged open to prevent mould growth. But then there is always the servo fridge door closing device ;-)

Steve (Eeyore)

Link to comment
Share on other sites

 

IF that could be done, it would be interesting to say the least! Other possibilities include using the GPS sensor to monitor location and speed; and driving outputs to eg turn things on and off, for example if the batteries are running low then turn off something; or if you're a leisure user then turn on the fridge remotely, the day before you arrive at the boat; or turn on/off the central heating remotely.

But you don't need fancy computing power to do any of that. I can do that with our GSM modem that has 8 digital inputs and outputs and 4 analog inputs, plus it can send rs232 data. Ok I don't have a GPS module, but only because I don't see the point.

 

It is rather nice to be able to check the battery voltage and then turn on the central heating from the airport, so the boat is cozy by the time we arrive (in winter!).

 

What the OPs system gives is powerful logging and displaying capability for power usage and generation, and that requires a fair bit of memory plus web server functionality.

  • Greenie 1
Link to comment
Share on other sites

Yeah agree they're different things for solving or helping with quite different problems or issues. I personally don't worry too much about the boat while I'm not on it, its been around for 19 years or so and seems to cope okay with things that life throws at it, we also don't have timed central heating (we have central heating off the engine, but I don't think I'd want to remote start the engine!!!) so can't really make use of that aspect. As far as the logging goes, I personally can't see a need to log in too much detail what the batteries are doing and what power is being consumed at any point in time. The BMV I fitted because I really didn't know what was going into or out of the batteries, now its been fitted I know what the general jist of things are (ie the deepest discharge through the night, we cruise every day if on the boat) and can see that the batteries are indeed being charged nicely when the engine runs (and when they need it and its sunny - via solar). Also I now know what electric devices consume what - allowing an accurate power audit to be done. BUT I don't really see a need for detailed logging of amps vs time through the discharge cycle, or amps in vs time eg for solar charging, any more than for pure interest in how they are performing.

 

Maybe if our boat had more systems on it so it placed more demands on the batteries, it would be worth looking more closely at the way power is used; or we used the boat in a different way (ie living on it whilst working leaving it unattended) then power generation would be more of an issue than the current non-issue due to driving it each day and having solar power which is nice in the summer).

 

One point worth making is that I believe the boater himself benefits from ANY kind of battery monitoring, be it a simple clamp ammeter and/or voltmeter readings, through to a cheap amp counter, to more complete battery monitors such as the NASA BM, Victron BMV, Mastervolt product (can't remember its name), Smartgauge, etc or a custom solution as offered by the OP. When there is a way of measuring battery use, the boater stops guessing and starts understanding the workings of a boat's electric system.

Link to comment
Share on other sites

Brilliant just what I needed currently building something simular to do various things mostly automate the lights and stuff but like the idea of monitoring the power too I currently have a pi as a router media server on the boat and I'm just waiting a second to do the rest

Link to comment
Share on other sites

An 'eagletree' data logger used on rc planes can log volts, amps, rpm, rudder angle, gps speed and some other parameters at different sampling rates. You then download data to a pc and display graphs. I used one to log the performance of a solar tracker recently.

 

For turning on the heating i have an old 5 pound sagem voda phone in a black box with a light dependent resistor and relay circuit. Call the phone the backlight comes on the LDR switches on the relay and the heating starts. No call costs but you do need an active sim in there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.