Hi, I'm after a bit of guidance on how to detect a 12V supply please.
Im building quite a complicated control project including 12 x digital temperature probes, a pressure monitor (0-5V), plus a 4x20 LCD display and also an ethernet shield, all being developed for a Mega.
In the case of any of a range of error conditions it will activate a 5V relay, which switches 12V across its contacts from a separate PSU. I want to ensure that the 12V is always available at the relay contacts so that if the (remote) PSU fails, the Mega will throw up an error on the display, also squrt an error message via IP. I can provide the location where the Mega and its 5V relay are located with 3 wires - 12V supply, 12V ground and the N/O output for the relay. The Mega itself will be powered with either 9V from a PSU or with 5V if the USB is in use.
I'm keen to keep the Mega and the 12V supply completely isolated from each other rather than using a voltage divider and assuming I can common the grounds from the two separate supplies. So I'm assuming that some sort of opto isolator circuit is going to be the way forward but in this case with things working back to front compared with the normal sort of configuration, where Arduino normally supplies the signal and the output of the chip controls a load. I'd also like to keep the 12V quiescent current consumption as low as possible.
What do you think and can anyone offer any suggestions for a circuit diagram please? My preferred IC would probably be CNY17-2 because these are available and cheap from my usual supplier.
No contradiction at all, maybe just a bit of inelegant wording. To clarify:
Relay contacts switch 12V, which comes from a remote PSU, with it's own 0V.
Arduino is predominantly 9V supply, again from its own PSU and its own 0V
For info, both PSU's are on the same 240V mains phase, although probably from different MCBs. Hene the desire to know if one is lost.
4.I could have used a voltage divider to drop 12V down to 5V and assumed that both PSUs have a "common" 0V by connecting them together, but want to avoid that. I think they are best kept separated.
I've re-read my question and it's all there.
Something that looks for the presence of 12V or thereabouts and puts (HIGH) or (LOW), I don't care which on a digital pin, or indeed just has an output I can read even if analog, will meet my needs.