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?
smart power consumption monitoring system
Last edited by Fan174 on Sat Sep 01, 2018 2:12 am, edited 1 time in total.
Re: smart power consumption monitoring system
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.
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.
Re: smart power consumption monitoring system
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.
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.
Re: smart power consumption monitoring system
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
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
Re: smart power consumption monitoring system
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
Re: smart power consumption monitoring system
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.
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.
Re: smart power consumption monitoring system
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
I have found these two ADC
1. MCP30008
2 ADS1115
Suggest me Which one of ADC should I used for project
Re: smart power consumption monitoring system
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.
Re: smart power consumption monitoring system
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
Re: smart power consumption monitoring system
Okay, this will work but:
- 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.
- 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.
Re: smart power consumption monitoring system
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
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
Re: smart power consumption monitoring system
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.
Re: smart power consumption monitoring system
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
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

Re: smart power consumption monitoring system
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.
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.
Re: smart power consumption monitoring system
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.
Re: smart power consumption monitoring system
I think this $10 toy works. But I don't guarantee it won't explode!

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 (57.35 KiB) Viewed 25835 times
I am an electronics and smart home hobbyist.
Re: smart power consumption monitoring system
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.tlfong01 wrote: ↑Mon Sep 03, 2018 8:50 amPeaceFair PZEM-004T AC110/220V 100A Voltage Current Watt meter with TTL UART interface - US $10
https://www.aliexpress.com/item/PEACEFA ... 08101.html
And again what standard is this, for example:
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.5. Measurement accuracy: 1.0 grade
Re: smart power consumption monitoring system
Brandon92 wrote: ↑Mon Sep 03, 2018 7:41 pmWell, 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.tlfong01 wrote: ↑Mon Sep 03, 2018 8:50 amPeaceFair PZEM-004T AC110/220V 100A Voltage Current Watt meter with TTL UART interface - US $10
https://www.aliexpress.com/item/PEACEFA ... 08101.html
And again what standard is this, for example: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.5. Measurement accuracy: 1.0 grade
I agree, it is a trade off between performance, safety and cost.
I am an electronics and smart home hobbyist.
Re: smart power consumption monitoring system
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
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 (143.14 KiB) Viewed 21669 times
Re: smart power consumption monitoring system
I'll have a look, I have a few smartplugs I can try it with (all have Tasmota on them and power meters)