AC plug with power monitoring

I would like to make a wireless switch for AC plug with power monitoring feature. How can I make a webpage from sketch
that i can display the power consumption in real time graph and also control button to turn ON or turn OFF the plug?

If you want to show a graph over extended time you probably want to use some external storage for it.

For the current current usage you can send it to the agent on some fixed interval and store the value on the agent to be displayed when accessed over http.

One way to make a on/off switch is a submit button, and handle the value on the agent, then send on/off to imp.

Have you picked out an AC current sensor? Something compact that will fit into your box? The On-Off part can be either a SSR (solid state relay) or mechanical relay.

What kind of load are you expecting to measure? 120VAC residential appliance, HVAC unit, industrial?

You’ll need some sort of power supply for the imp and the relay/sensor components. Most likely it will be 12-24VDC. That means a small power supply has to also fit into your box.

If I were you, I would get the relay and sensor working before you even hook-up the Imp. Build the box with sensor, relay, power supply and manually switch the relay to test it. Measure sensor output (depending on what sensor you use). When all is OK, the Imp will then be used to do what you did manually.

If you want the website part, you’ll either need your own website or use a service to host your scripts. That part all depends on the data collection portion of your project.

With the website, consideration for security is important. You don’t want ‘anyone’ to be able to control your Imp. That will require some login scripting, JQuery, and PHP scripting.

Another method would be to use an App for the Imp. It won’t be custom to your project, but it will be a way to view/control your imp from anywhere.

Thanks for the responses.

I make this for the consumer residential appliances. I already built the circuit, and it is working. I used triac for controlling part and shunt resistor for current measurement.

The problem now for me is that i am totally new to webserver and scripting. If i do not have own website, how could i make it possible? What you meant by the services to host the code?

You could try going through this reference

Xively

In this case you do not need any web hosting service. The electric imp agent performs this function and Xively gives you a place to log the data and a bit of charting functions.

You should probably look at this thread too: http://forums.electricimp.com/discussion/2529/electric-imp-watt-meter

…surprised you didn’t plug it yourself @mjkuwp94 :slight_smile:

Is this just a project for yourself, or is this something other people will use?

If it’s just monitoring and logging, that doesn’t require much security or interaction. But as soon as you allow an online button to turn it on and off, that changes the whole ballgame. You can’t just let anyone control it. How much security is required, and who is in control?

If control is not human, but a program or event, that is also a different set of rules.

Tell us about who or what is going to be in control, and who accesses it.

Also …
Xively can display data … I don’t know if it can deal with your on/off control.