Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

smart power consumption monitoring system

Fri Aug 31, 2018 1:25 pm

I am looking advice to design smart power consumption monitoring system. I want to design a system that will measure the power consumption of device such as light bulb, Fan, cooler etc and It will store the record of power consumption into database server so we can monitor the electricity usage of each devices

I have searched on internet and I found that raspberry pi can be use in this project. I think have to use ADC chip but don't know others
I don’t have idea how raspberry pi measure power consumption. I mean which circuit or sensor require to design system.

I am looking advice to design system. Do I need sensors to measure power consumption of devices ? What circuit do I need to measure power consumption of each devices?
Last edited by Fan174 on Sat Sep 01, 2018 2:12 am, edited 1 time in total.

stevend
Posts: 644
Joined: Fri Oct 11, 2013 12:28 pm

Re: smart power consumption monitoring system

Fri Aug 31, 2018 7:55 pm

Since you are monitoring mains voltages and currents, you would be well advised to buy your sensors.

And your sensors are likely to be scattered about, so you will need a means of communicating the data back to a central device. A Pi is well suited to be this central device.

For a quick start, have a look at the Energenie range. They do various devices using radio communication.
I believe Sonoff do some useful peripherals.
Look at https://openenergymonitor.org/ for ideas.
Finally, the ESP8266 has many applications in this area.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Fri Aug 31, 2018 8:06 pm

I think it would be helpfull if you tell us how much you know about electronics. I believe that we can give information what you understand. And we can skip the part that you know. As an example, do you have the knowledge about the mains connection and the safety point of view.

If you want to measure it across you house. I also won't use the Rpi for reading the sensor. Because the Rpi use to much power for this. And you can use better a (dedicated) microcontroller for this task.

As a start, you could try to measure how much energy it will take to charge a power bank.

PhatFil
Posts: 1707
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: smart power consumption monitoring system

Sat Sep 01, 2018 12:22 am

2 ways of achieving the goal spring to mind,
1) as suggested above employ one of the many esp8266/5 or esp32 development boards for a custom passive monitoring system using clamp on the cable device.
or 2) look at off the shelf options such as https://www.itead.cc/sonoff-pow.html which will work out of the box but will rely on the manufacturers remote servers, But you could reprogram the device with alternative firmware https://github.com/arendst/Sonoff-Tasmota removing the reliance on remote foreign servers and allowing you to host your own mqtt broker on your pi to handle all messages..

which ever method you adopt power consumption calculations will be based on the specifics of your supply so if you follow a roadmap for a 110v system while living with a 220 or 240 v supply you WILL need to revisit the calculations to confirm they comply with your supply to provide useful output. see this tasmota wiki article on the subject of callibration https://github.com/arendst/Sonoff-Tasmo ... and-Pow-R2

Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

Re: smart power consumption monitoring system

Sat Sep 01, 2018 1:16 am

stevend wrote:
Fri Aug 31, 2018 7:55 pm
Since you are monitoring mains voltages and currents, you would be well advised to buy your sensors.
I have knowledge of main supply and transformer. I also have knowledge of microcontroller

I am looking advice what the complete hardware required for this project design. I have been looked some information given in links.

I think I need following stuff

1) Raspberry
2) Clamp current sensor
3) Voltage sensor
4) ADC Chip

What do you think, Do I need anything else

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sat Sep 01, 2018 9:19 am

How do you want to measure it. Do you want to be fully isolated from the mains connection. Or do you want to preform the measurement directly on the wire's.

I think a fully isolated measurement is the way to go. Its saver at you end.

I found (first link) example on this. And this is a IC that you could use. But there are more out there.

End you (need) to read this. It contains the information how you could do a continuously monitors the power.

And I would only use a Raspberry, so that the other sensor, that have a microcontroller, can sent they information to one point. A microcontroller can work with uA and the Raspberry can't do that.

Edit
You also need to think about what happens when there is for example a voltage spike on the your mains.

Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

Re: smart power consumption monitoring system

Sat Sep 01, 2018 10:52 am

I have searched further details I need advice to select ADC chip

I have found these two ADC

1. MCP30008
2 ADS1115

Suggest me Which one of ADC should I used for project

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sat Sep 01, 2018 10:59 am

Fan174 wrote:
Sat Sep 01, 2018 10:52 am
I have searched further details I need advice to select ADC chip

I have found these two ADC

1. MCP30008
2 ADS1115

Suggest me Which one of ADC should I used for project
The first step that you need to take is, how do you want to sense the current an voltage. This decision will tell you later what for kind of ADC you are needing. Perhaps the sense device has for example a i2c interface. Then you don't need a ADC.

By the way. There are a lot more ADC around.

Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

Re: smart power consumption monitoring system

Sat Sep 01, 2018 12:15 pm

Brandon92 wrote:
Sat Sep 01, 2018 10:59 am
The first step that you need to take is, how do you want to sense the current an voltage. This decision will tell you later what for kind of ADC you are needing.
I am planning to use following sensor

1) Current measurement : I am planning to use this clamp current sensor https://openenergymonitor.com/100a-max- ... sensor-ct/

2) Voltage measurement : I am planning to make similar voltage sensor https://openenergymonitor.com/ac-ac-pow ... r-us-plug/

this adopter give 9v AC so I think it would be good if I design my own circuit that will give output 5 v Ac

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sat Sep 01, 2018 12:25 pm

Okay, this will work but:
  1. Thats is indeed the easiest and savest way of measuring the voltage. But, you don't need a output of 1.1A. To measure the voltage. Or are you thing of using this also as a powersupply for the controller. And do you have any idea how you want to measure a AC signal in a system that works with DC domain.
  2. You could also use this sensor. However will will not this one. Because it can measure up to 100A. And you product is probably fuses at max 16A. So, if you use a sensor with lower input current, you are increasing your resolution. On how accurate you could measure the current.

User avatar
bensimmo
Posts: 5879
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: smart power consumption monitoring system

Sat Sep 01, 2018 12:51 pm

I don't understand you choice of device to measure.

How will they measure the lightbulb, fans, fridges etc?
These probably run of mains AC and not 9V AC

Simplest, yet still a project, buy the Sonoff devices or similar with energy meters.
You either splice them into you devices power cord or they are a pass through socket, depending on style.
If using their servers, they are AWS (Amazon hosts).
Or you can keep it local with the different firmware.
https://github.com/arendst/Sonoff-Tasmota/wiki

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sat Sep 01, 2018 1:01 pm

bensimmo wrote:
Sat Sep 01, 2018 12:51 pm
I don't understand you choice of device to measure.

How will they measure the lightbulb, fans, fridges etc?
These probably run of mains AC and not 9V AC
I agree. But for the first try this is possible the safest and easiest way. Without cutting the life wire. And there are indeed better options how to measure it.

However you know the transform ratio of that transformator; 120==9, 60==3 And you could calculate this in software. But to measure to power. The current and the voltage need to have the same phase. And this might be a problem for another day.

User avatar
bensimmo
Posts: 5879
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: smart power consumption monitoring system

Sat Sep 01, 2018 2:39 pm

And transformer loss.

I guess it all depends on what you are doing, I have no idea what you want 9VAC (I have one balance at work that can use 9VAC) but then 5V AC

Is this just a demo project?

The plug through are probably the safest
http://sonoff.itead.cc/en/products/resi ... sonoff-s31

Do post back your project though, always interested in other ways :-)

Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

Re: smart power consumption monitoring system

Sat Sep 01, 2018 3:26 pm

bensimmo wrote:
Sat Sep 01, 2018 12:51 pm
I don't understand you choice of device to measure.
Just for now consider one light bulb connected to main supply 230 v and I want to measure voltage across it
Take look at this hand made circuit
IMG_20180901_200814 (1).jpg
IMG_20180901_200814 (1).jpg (211.98 KiB) Viewed 25959 times

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sat Sep 01, 2018 5:50 pm

How accurate do you want to be the power measure to the load? I also see a potential problem with this way of measuring. But we will come to that later, or do you have any idea?
By the way, the link to the transformator is the 110vac type.

So, my next question: how do you get the ac current to the ADC. Tip: you can't use the same circuit as above.

Fan174
Posts: 186
Joined: Tue Mar 20, 2018 6:10 am

Re: smart power consumption monitoring system

Sun Sep 02, 2018 10:57 am

Brandon92 wrote:
Sat Sep 01, 2018 5:50 pm
So, my next question: how do you get the ac current to the ADC. Tip: you can't use the same circuit as above.
I will use clamp current sensor to measure current and I will use circuit posted above to measure voltage

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Sun Sep 02, 2018 3:25 pm

Fan174 wrote:
Sun Sep 02, 2018 10:57 am
I will use clamp current sensor to measure current and I will use circuit posted above to measure voltage
First of all I think this will not work for this reason:
  • You are buying a sensor that can measure the current between this two values: 5A-100AThis means that you can measure current accurate if you apply a load of 1150 Watt. And the other sensor have a voltage output off 0-1V. So, if you are going to use that sensor. The voltage drop of the two diodes are larger that the output of you sensor.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: smart power consumption monitoring system

Mon Sep 03, 2018 8:50 am

Brandon92 wrote:
Sun Sep 02, 2018 3:25 pm
Fan174 wrote:
Sun Sep 02, 2018 10:57 am
I will use clamp current sensor to measure current and I will use circuit posted above to measure voltage
First of all I think this will not work for this reason ...

I think this $10 toy works. But I don't guarantee it won't explode! :D

PeaceFair PZEM-004T AC110/220V 100A Voltage Current Watt meter with TTL UART interface - US $10

https://www.aliexpress.com/item/PEACEFA ... 08101.html

Features:

  • Measures voltage, current, power
  • TTL UART interface
Attachments
ac_meter_2018sep0301.jpg
ac_meter_2018sep0301.jpg (57.35 KiB) Viewed 25835 times
I am an electronics and smart home hobbyist.

Brandon92
Posts: 949
Joined: Wed Jul 25, 2018 9:29 pm
Location: The Netherlands

Re: smart power consumption monitoring system

Mon Sep 03, 2018 7:41 pm

tlfong01 wrote:
Mon Sep 03, 2018 8:50 am
PeaceFair PZEM-004T AC110/220V 100A Voltage Current Watt meter with TTL UART interface - US $10

https://www.aliexpress.com/item/PEACEFA ... 08101.html
Well, this is hard to tell. Because the full specification are not showed. Especially the safety regulation / standard. For example, they are using optocouplers for isolation, I think. But there are traces under the optocoupler and that is not really what you want.

And again what standard is this, for example:
5. Measurement accuracy: 1.0 grade
For example a good design: take a look at this. And take a close look how they done the isolation barrier. And compare that by the one above.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: smart power consumption monitoring system

Fri Sep 07, 2018 1:28 pm

Brandon92 wrote:
Mon Sep 03, 2018 7:41 pm
tlfong01 wrote:
Mon Sep 03, 2018 8:50 am
PeaceFair PZEM-004T AC110/220V 100A Voltage Current Watt meter with TTL UART interface - US $10
https://www.aliexpress.com/item/PEACEFA ... 08101.html
Well, this is hard to tell. Because the full specification are not showed. Especially the safety regulation / standard. For example, they are using optocouplers for isolation, I think. But there are traces under the optocoupler and that is not really what you want.
And again what standard is this, for example:
5. Measurement accuracy: 1.0 grade
For example a good design: take a look at this. And take a close look how they done the isolation barrier. And compare that by the one above.

I agree, it is a trade off between performance, safety and cost.
I am an electronics and smart home hobbyist.

pisti81
Posts: 3
Joined: Sat Apr 06, 2019 3:07 pm

Re: smart power consumption monitoring system

Thu Jun 06, 2019 9:35 pm

HI! I use Sonoff PowR2 with tasmota firmware. It communicates via mqtt.
I have built a host system which logs all the readings into a CSV file(excel) and display all the required measurements and calculation on the dashboard.
If you familiar with node-red then you can use my flow with a little personalization, like mqtt client, currency and cost of Kwh modification.
For details see the photo attached.
Best of luck!

Flow is available from my google drive:
https://drive.google.com/file/d/1p4WLOv ... sp=sharing
Attachments
Pow cost dash.jpg
Pow cost dash.jpg (143.14 KiB) Viewed 21669 times

User avatar
bensimmo
Posts: 5879
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: smart power consumption monitoring system

Fri Jun 07, 2019 7:06 am

I'll have a look, I have a few smartplugs I can try it with (all have Tasmota on them and power meters)

Return to “General discussion”