chandytech
Posts: 4
Joined: Sat Sep 02, 2017 12:36 pm

Need a solution for Tracking Main Power Availability Status

Sat Sep 02, 2017 5:24 pm

Hello pi-world,

I am planning for a project which lets me track when the Main Power goes off & comes back on a day. I have an inverter backup system. I would like to log how frequent & how long the actual power outages are in my place.

Please let me know what other components required for this along with the Pi.

Regards,
ChandyTech

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Need a solution for Tracking Main Power Availability Status

Sat Sep 02, 2017 11:22 pm

I guess it would be easiest to monitor the DC side, if possible. Use a resistor divider to drop the voltage to 3.3V and a zener diode to limit it, and connect directly to a GPIO pin.

If you need to measure the AC side, then you could use a simple low-current power supply like a phone charger and measure its output (again with resistor divider to drop 5V to 3.3V).
Submarine communication systems engineer and amateur robot enthusiast.

guzel
Posts: 12
Joined: Sat May 20, 2017 7:18 am

Re: Need a solution for Tracking Main Power Availability Status

Thu Sep 21, 2017 3:08 pm

Hi Chandytech as Moe posted the solution resistor divider a Zener diode usage you can go for that. A voltage divider calculator like this can, of course, help you for doing calculations. http://www.voltagedividercalculator.com/

Meanwhile, you also need a Raspberry Pi model B, an SD card of 4GB, RS 232 adapter matching your inverter a Wifi adapter, a USB hub and SD card reader. I recently checked a tutorial by Steffen who shared the method to upload data from Growatt inverter to some website using the Raspberry Pi, Here I am quoting the ingredients for the project:
1 Raspberry Pi Model B
1 SD card (4 GB or more) - preferable Class 10
1 microUSB power adapter
1 USB-RS232 adapter with the number of RS232 ports that equals your number of inverters. If you have more than 1 inverter you might additional need an extension RS232 cable. Do not buy these too cheap - cables with PL2303 chips seems ok.
1 USB WiFi adapter or Ethernet cable
1 USB keyboard and mouse
1 USB hub (if you easily need to setup the WiFi adapter up on an encrypted network)
1 SD card reader (you might have one in your laptop)
Monitor/TV with hdmi or composite video, along with cable.
You can learn full details about the project here: http://fixedbycode.blogspot.com/2014/04 ... owatt.html
This project might not be exactly the one you are looking for but hopefully you can lump Moe voltage divider solution with this to acheive something.

PietroDC
Posts: 9
Joined: Wed Sep 20, 2017 5:25 pm
Contact: Website

Re: Need a solution for Tracking Main Power Availability Status

Thu Sep 21, 2017 5:28 pm

Moe wrote:
Sat Sep 02, 2017 11:22 pm
I guess it would be easiest to monitor the DC side, if possible. Use a resistor divider to drop the voltage to 3.3V and a zener diode to limit it, and connect directly to a GPIO pin.

If you need to measure the AC side, then you could use a simple low-current power supply like a phone charger and measure its output (again with resistor divider to drop 5V to 3.3V).
Quote.. Fastest and easyest way.
An alternative is to use an AC Relay that cuts a 3.3V (coming from the RPi) that goes to a GPIO, you can monitor the status of this Input then.

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: Need a solution for Tracking Main Power Availability Status

Fri Sep 22, 2017 6:59 pm

As someone pointed out, you'd be best using a relay That makes sure you don't give dangerous voltages to the Pi GPIO pins. Using the wiringPi library makes it easy to set a GPIO pin to an input with a pullup. Connect the relay contacts between this pin and Gnd.

The software could detect the pin state every second and log the time and input state if the input pin state has changed.

User avatar
rpiMike
Posts: 1432
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Need a solution for Tracking Main Power Availability Status

Fri Sep 22, 2017 7:59 pm

What about using a current clamp meter :

https://shop.pimoroni.com/products/non- ... sensor-30a

Return to “Automation, sensing and robotics”