My project works quite good but some time ago i bought active subwoofer to my amplituner and found issue. There is energy saver feature on board but after taking measure it seems in standby it still uses 10W. If you multiple by 24h and 365 days a year it may be quite big electricity bill.
The best solution would be turn it on only when amplituner is on. We may monitor a current and take decision based on value.
When amplituner uses standby mode, power usage drops below 1W and this should be enough to give input to Arduino to switch off relay and the same socket where device is connected. How to do it? In project like Energy Meter they use sensors SCT-013:
Disadvantage is quite expensive cost of sensor. I do not need to track energy but just monitor if device uses power or it is in standby mode.
I found ACS712 sensor that works using Hall’s effect. If you want to learn more please check Wikipedia. I can simply say just connect to the power cord and output connects to microcontroler and rest (math) is done as Android application.
Connection diagram
Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
* Measuring AC Current Using ACS712 */ const int sensorIn = A0; int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module double Voltage = 0; double VRMS = 0; double AmpsRMS = 0; void setup(){ <strong>Serial</strong>.begin(9600); } void loop(){ Voltage = getVPP(); VRMS = (Voltage/2.0) *0.707; AmpsRMS = (VRMS * 1000)/mVperAmp; <strong>Serial</strong>.print(AmpsRMS); <strong>Serial</strong>.println(" Amps RMS"); } float getVPP() { float result; int readValue; //value read from the sensor int maxValue = 0; // store max value here int minValue = 1024; // store min value here uint32_t start_time = millis(); while((millis()-start_time) < 1000) //sample for 1 Sec { readValue = analogRead(sensorIn); // see if you have a new maxValue if (readValue > maxValue) { /*record the maximum sensor value*/ maxValue = readValue; } if (readValue < minValue) { /*record the maximum sensor value*/ minValue = readValue; } } // Subtract min from max result = ((maxValue - minValue) * 5.0)/1024.0; return result; } |
http://henrysbench.capnfatz.com/henrys-bench/acs712-arduino-ac-current-tutorial/
Hardware
- ACS712 module
- arduino (mini, nano, uno)
- prototype board and jump cables
- programming module
- power sockets where you may use ACS712.