Detecting AC power

Go To Last Post
33 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey all, i am looking to do a little project and was needing some help with figuring how to go about it.

What i am looking to do is this:

I would like for my TV to come on automatically when the power goes out then comes back on. Normally, when the power goes out and you had the TV on, it would not come back on when the power comes back. I am thinking of setting up some TV "billboards" in a few retail places and i need a way to keep them on 24/7 without any need for users to interact with it (turning it back on if the power goes out, etc).

I am just looking for a simple schematic for an AVR-type (ATMEGA, Arduino) chip that i can hook up, detect the AC once it comes back on and send a signal to 2 wires to "click" the power button to turn the TV back on. (of course, only once would be needed after the power comes back).

Any help/ideas would be great! :)

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could detect power fail by coupling magnetically to the mains cable, and looking for peaks that correspond to your local line frequency. Power-on could be done through a non-invasive method via IR, if available.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

KISS technique.
A wire link across the ON/OFF switch, or glues in the ON position with Super Glue, so that the switch is always effectively operated, will do the trick.
Alternatively a momentary break switch wired across the ON/OFF switch will do the same but, still give OFF functionality.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey thanks for the feedback timgoh0 & LDEVRIES.

timgoh0: Do you happen to have a drawing/schematic of this of which you speak? Is all this being detected by one of the analog inputs or digital inputs of the Arduino?

LDEVRIES: Yeah, i would still need to be able to turn it off/on with the factory switch still so the second option you have listed would be the most idea for my situaton. One problem though, doesn't the Arduino output 5v from each of its outputs? Wouldn't that not short circuit the two tires going to the TV switch?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
A wire link across the ON/OFF switch,
Old fashioned guy. :wink: I don't think that works with nefangled TVs etc. Good idea for valve TVs.

You can get gadgets off the shelf that tells you if the TV is on or off by measuring the mains current used. Then you should hack into the on/off fuction of a remote control (infrared??) and only send a on command after a few seconds that power is on and the TV is still off.

Some TVs have separate on/off codes, many have toggle code only, so you must make sure that the TV is really off before sending the command otherwise it MAY turn it off if already on.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well i was hoping to only have to use the main power cable for the TV to detect if its powered or not. I really dont want to have to plug something else in. The TV will probably be a Vizio 26-32" LCD TV's-if that helps any. And shouldnt the power switch on the TV be a type of momentary switch?

As timgoh0 pointed out, using "coupling magnetically to the mains cable" would work but i have no idea how to do that stuff. Never done that before and not sure even where to start :)

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Never done that before and not sure even where to start
That's why you BUY stuff already working off the shelf. We want you to keep on living for a while longer. :)

Starting from scratch I can see several weeks of intensive work IF you know what you are doing, a lot longer otherwise.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Optocoupler sensing AC supply. IR transmitter to turn the tv on when power returns ?

oddbudman

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I go with oddbudman, optocoupler sensing, vishay has some good app on that.

Just make some tests (that care with AC) and you get you sensing AC working.

But the solution of timgoh0 is interesting, I would like to hear more...

Regards,

Bruno Muswieck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Old fashioned guy. I don't think that works with new fangled TVs etc.

Works with my LCD TV set & it worked with a LCD monitor that had a dicky switch. No iron clad warranty that it will work in every case though.

Most electronic gadgets have "soft" ON/OFF switch,
with the equipment always consuming some power.

You could graft a micro into the appliance, which when it fires up sends a pulse to the soft ON/OFF switch.
You need to monitor the appliance to see if it is actually operating.
Then the following code shoudl do

for(;;)
 {
 (if APPLIANCE_NOT_RUNNING)
     pulse_soft_on_off();
 }  

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JS: Feel free to load me up with some links to these already made devices, please :o)

The Optocoupler sensing AC supply suggestion from oddbudman sounds good but i need to see how one is hooked up to the arduino in order to make it work for me :)

But for the IR, i dont think i can use the remote. I'm "trying" to keep it as factory default as possible just in case something happens to it in the place of business.

LDEVRIES: I understand your code that you posted but without knowing how to hook that up to the switch and what output on the arduino to use it really doesn't do me a lot of good :) To my knowledge (this is a 42" Vizio i'm going off of) it has a standard pushbutton power button on the side that (to me) seems like your standard momentary switch.

And i'm sure when you said "dicky switch" you meant "clicky switch" :oP

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

build a power supply for you MRC that is powered by the same AC power as the TV. Program the MCU so it sends the power on command (how ever you want to do that) after a set power on delay. The assumption is that if the power goes out for the TV, it will also go out for the MCU and when it comes back on for the TV, it will also come back on for the MCU.

Also, if you have a lot of TVs on the same circuit, you can use a single controller to turn them all (or at least, a lot of them) on instead of having to have one device per TV.

 

Clint

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would this be something that could do the trick?

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1109-ND

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Feel free to load me up with some links to these already made devices
This is an EXPENSIVE example http://www.crestron.com/products... should be able to get simpler/cheaper devices from Home Automation places. They seem to be quite common for Home Automation.

As far as not modifing the TV set you can get a cheap IR programmable remote as long as the TV has IR remote control. Then just hack into the On/Off key even with a simple relay or a 4066 type chip.

Now you will only need to concentrate on the code and the AVR side, everything else is handled by the external devices in a SAFE way.

Of course if you are planninmg on making LOTS of them then it's another story.

edit another link http://www.automatedhome.co.uk/N...

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Fri. May 21, 2010 - 05:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
"dicky switch"

Vernacular for a stuffed switch!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow yeah those seem to be expensive. Was the SENSOR CURRENT 130A 5V BI 5-CB chip i posted above not able to do the same thing?

Here, i draw up something that i *think* will work?

And as for the remote, is this what you are talking about?

http://cgi.ebay.com/Universal-IR...

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The remote controller will do if it works with your TV. Maybe able to power it from the micro PS with a 3.3V regulator.

As far as the mains side is concerned I hope you realise how DANGEROUS that can be and the test you may need to get done to pass certification if it used out side your home for personal use.

If there is a chance that anyone can sue you because something goes wrong then get something already built, tested and with an approval number. May seem harsh but this is a commercial reality once you go past the hobby use.

Also if you use the sensor as you show you may need some amplification on the output side as the sensor seems to output 20-40mA per amp. So for a TV set it's output will be pretty low.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd keep the TV intact and use infrared remote commands after power up. Perhaps send IR code once every minute or so. If TVs are in multiple locations, the multiple transmitters are needed.

If a TV is to be modified, I don't know what is best. Perhaps it would be sufficient to hook up to the IR receiver wires or power button wires, putting them on a connector to backside of TV. Then make the control box external.

Some TVs can wake up to certain events, like via the european SCART connector. You can sometimes use HDMI to wake up the TV too, via CEC commands.

Another option that would need an AVR per one TV is to put the AVR inside the TV to the standby power supply, so when power comes on, AVR powers up too, and pushes the power button virtually. No external wires etc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stick a light sensor behind a red filter. Stick that to the LED that lights red when the TV is on standby and green when it's on; if it's not passing a signal the TV is either powered off at the mains or is on. Otherwise, you want to send a 'turn on' signal via a hacked remote.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess you need the compliment to the TV-B-Gone device.

As for Lee's "dicky switch", is this the one you meant Lee?

Cheers,

Ross

Attachment(s): 

Ross McKenzie, Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You may want to also consider another brand of tv. Most (if not all) LG tv's have an rs232 port which can be used to control the tv. They also have a discreet ir ON command. Go to their website, pick out a tv, and download the manual, as they have all the rs232/ir code info in them.

You could simply send an ON command via rs232 or ir every few minutes (and could easily be battery powered/portable if wanted). No need to sense anything.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You know, i was thinking last night about if the power goes out then the Arduino will go out as well. So shouldnt a simple main code like this:

int defaultOn = 1;
const int buttonPin = 13;

void setup() {
  pinMode(buttonPin, OUTPUT);  
}

void loop(){
  if (defaultOn == 1) {
    defaultOn++;
    delay(1000); //delay 1 min for power to be restored
    digitalWrite(buttonPin, HIGH); //Push on switch
    delay(500); //delay 5 secs for press
    digitalWrite(buttonPin, LOW); //Let go of switch
  }
}

That way, when the arduino comes back on it will start with a "1" again and click the TV back on. That seems logical to do, yes?

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The TV and AVR will both survive short glitches, and with the appropriate AVR power supply capacitor you might get a small window of uncertainty, but it will never be zero methinks. You are saved if the on code is different than the off code, but if that is that case you could just broadcast it once a minute.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
As for Lee's "dicky switch", is this the one you meant Lee?

Yes that is the one Ross, as you can see it is hard ON in the OFF position! :)

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
it is hard ON in the OFF position!

I still can't get the gist of how this hard ON switch work with the TV. ;-)

My idea
Purchase an induction coil & place it next to the TV power cord to pick up 50 or 60Hz hum.
Next amplify it & feed it into the AVR chip comparator input.
That way you are not touching the mains voltage at all.

(Induction coil similar for use with recording phone conversation, old dial ring ring type)

Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All good suggestions there guys, thanks. I think i will take curtvm advice and buy an LG TV with an RS232 already in place so i can send those commands with ease.

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have a remote that turns tv on to a specific channel with just a single key press, then you can just make this key always on with some glue or soldering iron or something, and use DC adapter instead of remote's battery.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
Most of my TV' will turn ON using a volume change from the remote.
Provided that there is NO sound required (you mentid billboard), you could just hack a remote to permanently transmit up volume when ever there is power. i.e. remove batteries from remote and add a plug pack (wall wart) as the power supply for the remote. When the mains power comes on the remote starts transmitting UP volume and the TV turns ON. A dummy ear phone plug could always be added in to bypass the speakers if any noise is heard from them.

Kind Regards,

Neil Wrightson.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know that SCART is a EU thing but what other kind of connections does it have?
in the scart pin 8 is ground if the TV it's off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To be honest, I'd never use a SCART if there were any other option available to me. It's a pointlessly heavy connector with a pointlessly heavy cable in most cases, and it completely lacks any concept of a lock; so many times the SCART will fall partially out of the socket under its own weight - sometimes right out.

Stupid, stupid design. And bodged, at that - different connections for different signal options and variable level signals for normal/wide/off. Horrible.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SCART is a piece of utter stinking shit. And it was so right from the beginning of its "invention" (AFAIR by French Thomson Electronic to counter the German DIN plugs).

Mechanically it is a piece of stinking shit. Bad contacts are very common and at times I literally had to glue plugs into sockets to keep them from falling out again and again.

Electrically it is a piece of stinking shit. I can't remember how often I had to cut wires in a SCART cable to fix audio crosstalk.

SCART is the furuncle on the butt of European home entertainment electronics. It just won't go away.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Come now, Arnold. Don't sit on the fence. Tell us what you *really* think!