Anything direction that you can me on this?

Good Morning/Evening everyone

My first time here and my first post of course :slight_smile:

I do hope that all those that read this are having a great day!!

I work for an IT software company and we are looking to run with a new device or work on a new device that has been in our project board for some time.

So we are looking back into it and after some research online Arduino name popped up and I decided to have a look and get some information on this :slight_smile:

We are looking to have a device that can detect when there has been a power outage which can send a signal to a machine which will in turn tell the other machines on the network to shut down.

We already have the idea on what we can and will be doing for the 2nd half of the project but we are looking for the actual device that we will be connecting to the actual wall power with a serial output which we will be connecting to a machine.

I had a look on the products page and there are various boards there so I am here to ask if there is a board here that makes this possible for us? and which board would be what we would want to be looking at to work with to accomplish our goal?

Any advice or suggestions would be greatly appreciated :slight_smile:

Thank you,
Dezireal

Would this be to clean shut down equipment that is running on UPS?

What means do you propose to notify equipment to shut down?

How long after mains fail do you have before shutdown necessary? Do you need instant shutdown as in turning mains power off or a delay to see if a glitch rather than power loss.

Weedpharma

Hey there

That is correct, basically we have a UPS that doesn't connect to a PC directly but more to provide power to a whole network we are looking for a way to provide a way of saying okay the power is now on UPS power and we need to shut down the PCs.

We currently have a delphi app that can handle that we simply need to be able to send a signal from a device to our application/ or another application if we must that will say okay we have the signal and sends the shut down commands through the network.

We do have our application working that way.

Grace period we are looking for is 5 mins which the machines can shut down safely.

We have UPS setups that their software handles this and they are UPS that are connected via serial to a machine which works no problem.

But one a bigger setup we have a bigger UPS that doesn't work that same way and we need to improvise our own method in doing this.

Simple way to detect a power outage is to use an Arduino to measure the voltage from a mains adapter that produces 5v DC (or less).

If you want the Arduino to be immune from the power outage you could power it from a 12v lead-acid battery that is trickle charged from the mains. With a diode to prevent the battery back-feeding to the mains converter you can measure the voltage from the mains converter upstream of the diode - use a voltage divider to bring the measured voltage below 5v.

...R

Alright thank you for that and that is definitely something that is helpful to me on this thank you very much robin! :slight_smile:

Then to my understanding that we can program it (with the adruino software) to then send what ever signal to windows through a usb/serial output? and our program take it from there?

Like say our program listens on the serial/usb port for a string of data? which will then continue with the graceful shutdown?

dezireal:
Then to my understanding that we can program it (with the adruino software) to then send what ever signal to windows through a usb/serial output? and our program take it from there?

Like say our program listens on the serial/usb port for a string of data? which will then continue with the graceful shutdown?

Do you know anything about the program that will monitor the USB to receive shutdown signal?

What does it expect to receive?

Weedpharma

We have considered that as well and we have come to two main ways of doing it?

Either have a data string which can be anything even if its a byte just sending data through the port we will be able to intercept that of course we would like it to be something we can have sent that in the event of the mains failing that a code word could be sent through the USB/Serial port so that we wouldnt just have a random shut down taking place.

Which leads us to our second thought but was originally our first one was to have it that our program on windows watches the port and pings/sends data on that port and the second that the detects that data is not being sent it then proceeds with the shut down which means the device we have connected to the USB/Serial is no longer live and has failed along with the mains.

There are a few other methods we are brain storming over but the first method is our primary direction we would like to take on this.

Dezireal

With a 2x6V transformer and the attached circuit you can monitor the mains voltage. the 10m capacitor will hold it charge long enough to sen a message over serial or even ethernet. Or if you want you can insert a lipo powerbank immediately after the regulator. In that case you can use a much smaller capacitor

I would use a mobile phone charger via an opto isolator to monitor the supply with the Arduino powered from the UPS supply.

If mains present
Send "ok" via serial
Delay 5 sec
Else
Send "failed" via serial

This gives the option of monitoring the loss of signal for a period of time, or waiting for a definite signal.

Weedpharma

What about a normally closed relay powered by mains that turns on USP power to Arduino once the mains go down?

dezireal:
Either have a data string which can be anything even if its a byte just sending data through the port we will be able to intercept that of course we would like it to be something we can have sent that in the event of the mains failing that a code word could be sent through the USB/Serial port so that we wouldnt just have a random shut down taking place.

Which leads us to our second thought but was originally our first one was to have it that our program on windows watches the port and pings/sends data on that port and the second that the detects that data is not being sent it then proceeds with the shut down which means the device we have connected to the USB/Serial is no longer live and has failed along with the mains.

In either case you need a program running full-time on the PC to communicate with the Arduino.

It seems to me there are at least 3 modes - everything is working, something has crashed even though the power is OK, and the programs are working but the power has failed.

Do you want to cause a shutdown just because of a software crash?

I think an active signal from the Arduino would be better than the absence of a signal.

Routine "pings" would be a good way to ensure the Arduino is alive. Maybe you could organize the ping frequency so that missing one or two pings is acceptable - the time it would take the Arduino to do a watch-dog reset if it crashed.

Another issue to consider is how to re-establish communication with the Arduino if the Arduino crashes and causes a loss of the normal USB serial connection. Even with the watch-dog timer to restart the Arduino it may come back on a different serial port. I suspect it would be better to communicate with the Arduino using either bluetooth or a USB-TTL cable. As far as I know neither of these would notice an Arduino crash - apart from loss of data.

...R