hello awesome people
in my work in have a generator for the building that is turned on manually by the maintenance guy ..
the problem is during the night we have no clue when the power is out or no and the guy is claiming to turn on the generator for a long period.
i need something that gives me the exact time the power was out and back so i can be able to control it
i was thinking about main power clock but this is too basic with no logging whatsoever
maybe a smart ups connected to a pc ? maybe some monitoring device ?
what do you think ?
17 days later
I think a smart UPS would work but it's a but too expensive and not as flexible the solution I have in mind.

I'd go with either an arduino or a raspberry-pi set up to log power on/off times. Easy to do and you can always re-use them for something else later on!
I have simple ideas but I would like to understand which problem you are trying to resolve before helping you, please. By power you mean what, EDL power? Do you want to turn the generator on and off automatically? Or do you want to check that it is being turned on?
rolf wroteI have simple ideas but I would like to understand which problem you are trying to resolve before helping you, please. By power you mean what, EDL power? Do you want to turn the generator on and off automatically? Or do you want to check that it is being turned on?
i will elaborate :

i have several building sites - each has EDL and a backup generator
i would like to know when the EDL was gone and when it came back so i can monitor my generator's usage ( per example if the janitor kept it during EDL or not , etc )
i can monitor how many hours the generator worked but not when and why
This is a workaround, only if you have windows 10 and it is a laptop. This a battery report and will tell you when your battery is being used so a jump from AC power to battery will let you know when the power goes off and when it is charging again when it comes back on. No way to tell you which power is which, but at least you have a starting point.

How to generate a Battery Report in Windows 10

Hope it helps.

Edit: I guess you would need something like that at each site after reading the last post.
xazbrat wroteThis is a workaround, only if you have windows 10 and it is a laptop. This a battery report and will tell you when your battery is being used so a jump from AC power to battery will let you know when the power goes off and when it is charging again when it comes back on. No way to tell you which power is which, but at least you have a starting point.

How to generate a Battery Report in Windows 10

Hope it helps.

Edit: I guess you would need something like that at each site after reading the last post.
not bad .maybe i can connect it to a line that is only connected to EDL
if i can something cheaper or at least more usable than this , i can connect 2 , one at the generator and one at the EDL source and compare them both
Thank you. Sounds reasonable. I had the same idea but with the GSam battery monitor (or similar apps) on Android, which provide a graph of battery charge and discharge. You can dedicate and old phone (Android 4 or whatever). If you have a SIM card you may be able to do things such as access remotely or send an sms when power comes or goes using IFTTT. Here is an example of what you can do with IFTTT:
https://www.adamcolson.com/blog/10-tech/38-how-to-automatically-stop-charging-your-phone

A problem with this setup is that you can only monitor one power source.

Another idea (my 1st idea) is to film a light, maybe using using time lapse or low res video. You can have 1 light for each power source, and a clock. If you have a CCTV system just use that.

You can do something more elegant and "professional" with a Raspberry Pi, if you have some time to dedicate to get the right parts and set it up. It might be easy and fun.
rolf wroteThank you. Sounds reasonable. I had the same idea but with the GSam battery monitor (or similar apps) on Android, which provide a graph of battery charge and discharge. You can dedicate and old phone (Android 4 or whatever). If you have a SIM card you may be able to do things such as access remotely or send an sms when power comes or goes using IFTTT. Here is an example of what you can do with IFTTT:
https://www.adamcolson.com/blog/10-tech/38-how-to-automatically-stop-charging-your-phone

A problem with this setup is that you can only monitor one power source.

Another idea (my 1st idea) is to film a light, maybe using using time lapse or low res video. You can have 1 light for each power source, and a clock. If you have a CCTV system just use that.

You can do something more elegant and "professional" with a Raspberry Pi, if you have some time to dedicate to get the right parts and set it up. It might be easy and fun.
I think 2 cheap mobile phones each one connected to a different power source will be your best solution,
Hey, this might not be as helpful as I may think it is but here's my take:

We usually know when EDL is on because of the lower voltage; appliances seem weaker (fans, washing machine takes more time, etc...). I do not know if this is everywhere in Lebanon but it is common where I live. Generator power is more consistent and has a higher voltage (the correct voltage recommended by appliances). Maybe you could simply hook on something to the EDL line that indicates when it is on, and a voltmeter to a shared line in order to know whether you are receiving EDL or generator power.

Sorry if this solution is based upon my case only, and please note that I assume you have a voltmeter in order to measure initial differences in voltages between sources.
TrollFatGuy wroteHey, this might not be as helpful as I may think it is but here's my take:

We usually know when EDL is on because of the lower voltage; appliances seem weaker (fans, washing machine takes more time, etc...). I do not know if this is everywhere in Lebanon but it is common where I live. Generator power is more consistent and has a higher voltage (the correct voltage recommended by appliances). Maybe you could simply hook on something to the EDL line that indicates when it is on, and a voltmeter to a shared line in order to know whether you are receiving EDL or generator power.

Sorry if this solution is based upon my case only, and please note that I assume you have a voltmeter in order to measure initial differences in voltages between sources.
it is the other way around in my case .. EDL is more consistent as the generator is near overload
Hi
It seems that you need a custom HW (microcontroller with GUI on pc).
The hw contains real time clock to log the date and time of events and save them to local memeory.
The GUI reads from hw the data saved on memeory, and display the time and date for each event (EDL and / or Motor).
The GUI will highlight the critical events (existing electricity from both or absence from both) showing the duration for each event.
Mayyad wroteHi
It seems that you need a custom HW (microcontroller with GUI on pc).
The hw contains real time clock to log the date and time of events and save them to local memeory.
The GUI reads from hw the data saved on memeory, and display the time and date for each event (EDL and / or Motor).
The GUI will highlight the critical events (existing electricity from both or absence from both) showing the duration for each event.
any idea who can build something like this ?!
I would go with the guys who suggested the raspberry pi. You can easily get a 3 volt DC power adapter. Connect it to the power line from one end. Strip the head from the other end and connect it to an input pin and write a script to log the time the input pin is supplied with power and the time it is not. You can do the same with the generator line. Connect a DC power adapter to the generator line from one end. Connect the other to a second input pin on the pi and have the script record the times the power on the second pin went on and off.
new_user wroteI would go with the guys who suggested the raspberry pi. You can easily get a 3 volt DC power adapter. Connect it to the power line from one end. Strip the head from the other end and connect it to an input pin and write a script to log the time the input pin is supplied with power and the time it is not. You can do the same with the generator line. Connect a DC power adapter to the generator line from one end. Connect the other to a second input pin on the pi and have the script record the times the power on the second pin went on and off.
Sounds feasible... Got to try and find some scripts
If you want to record power off, you need some battery or UPS setup to keep the Pi powered.
rolf wroteIf you want to record power off, you need some battery or UPS setup to keep the Pi powered.
Good point
I think that, if you connect the Pi to a powerbank, and keep the charger connected to the powerbank- it might work. I have never tried such a thing.
new_user wroteI would go with the guys who suggested the raspberry pi. You can easily get a 3 volt DC power adapter. Connect it to the power line from one end. Strip the head from the other end and connect it to an input pin and write a script to log the time the input pin is supplied with power and the time it is not.
I read that the Pi does not have an analog input, that you have to connect it to an Arduino or AD converter to measure voltage - which you could also use for doing other cool things.
Also if it's an external voltage then you need to connect two pins (+ and -) because it's a different ground loop.

Maybe instead, you can get a relay that you can control with the 3 (or more) volt signal.

Please correct me if I'm wrong!
rolf wroteI read that the Pi does not have an analog input, that you have to connect it to an Arduino or AD converter to measure voltage - which you could also use for doing other cool things.
Also if it's an external voltage then you need to connect two pins (+ and -) because it's a different ground loop.
You are right. I just checked and found that AD conversion is needed for the raspberry pi input.
5 days later
Hey!
This seems like it is going somewhere interesting...
I've explored the same concept before(and still am) and have looked for reliable differences between EDL vs Generator electricity and so far I haven't found any. (Next stop is frequencies + noise). But I do want to mention that at some point I was able to use detect power source from two things: First, we coincidentally had a power outlet that only worked on EDL power (we did it for our AC), so I could use that to tell if EDL power is on or not. The next point I used was wi-fi/internet connection that I had an esp8266 wi-fi module connected to.
Hence the wi-fi told me if there's power in the house , whether it be EDL or Generator, and the lucky power outlet told me the source (EDL or not).

I never made the setup permanent as I felt there has to be a better way to do it, and thus I continue on my never ending, ever lasting, annoyingly interesting, finger-tip soldering-iron burning, losing tiny pieces in a carpet frustrating journey......

EDIT: Forgot to mention, the power outlet was monitored with an ATmega328 chip (the same chip from the Arduino) that was powered from a phone charger plugged to the outlet. Hence when power would come on and power the outlet, the chip would take note of the time at startup.

Looking back at it, I could replace the ATmega chip with an esp8266 as in to send the data to some cool GUI I could host on one of the esp chips being used.