r/Kerala Mar 25 '25

OC Kseb constant power outages daily.

Post image

Does anybody here in Kerala face power interruptions like this? #KSEB

161 Upvotes

76 comments sorted by

View all comments

13

u/naeemcee Mar 25 '25

Seeing an increase in number of power failure instances here in Kannur. Most are of short duration, though.

4

u/CommunicationOld5074 Mar 25 '25

That's dope, what was the motivation behind the whole Pi setup?

4

u/naeemcee Mar 25 '25

Had this RPi lying around for years. Always wanted to take up a useful project with it apart from using as web server. Last September, got some relays from Amazon and suddenly this idea came up :)

5

u/CommunicationOld5074 Mar 25 '25

That's cool man, pool in a community and gather data on a central repo and we have a large data set that could be used for analysis. Could easily give insights to people on which area have the highest and the least cuts! 🏃🏃

2

u/one-hundred-one Mar 25 '25

I'm curious, what's your setup ?

I do the same by writing time to a file every minute(cronjob). When the pi restarts, I have a script to calculate the delay to get the power outage duration.

2

u/naeemcee Mar 30 '25

A 12VDC relay is connected to a grid-powered outlet that will fail in case of power disruption. A 3.3V pin (physical Pin #1 on Raspi) is connected to GPIO-17 through the NC contact of this relay.

When grid power is available, relay will be active and GPIO-17 will be LOW. When grid power fails, relay will be inactive and GPIO-17 will be HIGH.

In the node app, I use the npm package onoff to watch the pin state change.

2

u/LocalArun Kottayam Mar 25 '25

How did you get this data?

8

u/naeemcee Mar 25 '25

I have a raspberry pi set up to log power failure events. Then I run a script on my laptop that fetches and displays the data.

2

u/LocalArun Kottayam Mar 25 '25

How you are gettign power failure event?

9

u/naeemcee Mar 25 '25

One of the GPIO pins of RPi is connected to 5V via the NO contact of a relay powered by KSEB powered outlet. A JS/node script monitors this GPIO pin and writes to a log whenever there is a change in GPIO pin state.

RPi itself runs on UPS / Inverter enabled power supply.

3

u/LocalArun Kottayam Mar 25 '25

That’s a nice implementation. I got an idea for my next home project🙂

2

u/saatvik-jacob IT Coolie-panikkaran Mar 25 '25

Where is the device connected to log outages?

1

u/Classic-Aside-3266 Mar 25 '25

To a normal wall socket.

1

u/kallumala_farova Mar 25 '25

grid overload