Circuit for power source selection

Connect voltage divider to 6-7V battery, 10k +10k, middle voltage 3 - 3.5 V to arduino analog pin. if middle voltage lower than 3V digitalwrite pin 1 HIGH,use that to control relay.

But the point was that your assertions on whether the relays under discussion are intended to be actuated for long periods is of no relevance. :roll_eyes:

That said, it is certainly the case that a relay is by no means the most appropriate solution. :+1:

Look carefully. It is half of “Vin” which is compared to the 3.3 V regulated reference.

This means that if “Vin” exceeds 6.6 V (which is approximately 5 V plus the dropout voltage of the regulator), the FET switches off the connection to the USB supply so the regulator takes over.

Unfortunately, the regulator on the UNO/ Mega 2560/ Leonardo/ Nano/ Pro Mini has no significant heatsink and is pretty useless, but that is another story. :grin:

Yes, as said by 79galinakorczak there is a voltage divider!

I hope this more logically component placed schematic helps.

Tom… :grinning: :+1: :coffee: :australia:

Thanks for your scheme, it is very clear! I cannot understand what is the function of this +5V…


That is a reference to the main 5 V power line inside the Arduino, which powers all the logic and also appears as the “5V” pin in the headers.

The point is that it may be a source of 5 V - indeed it is to the logic circuits - or be itself supplied by another power input such as the “USBVcc” through the FET in that circuit or from the on-board regulator - or (preferably) from the “5V” pin.

I still believe that a relay ( as opposed to a contractor) shouldn’t have to live with its coil energised for most of its service life.

You need window comparator, under load the battery voltage is drops when load is disconnected voltage is slowly rising let say up to 80% of nominal value, regular comparator will cause switching relay (after some time )ON/OFF

Don’t apply a human character to a relay.

I’ve seen thousands of relays constantly energized.

One reason to do this is for supervision purposes.

When the coil power disappears the relay drops . . .

Not having a coil energized can result in not knowing if that relay will ever energize.

Have never ever seen a relay not drop do to magnetization of the armature.

I’ll reveal you the secret: my primary source will be a 6V solar panel and my backup, as said, a 3s2p 18650 battery pack, so for my purpose the relay in the energized state won’t cause problem because the power source won’t finish (till there is sun) and because I suppose it will be online for less time than backup source (but in my intention when backup is up the system should be in low energy consumption mode)…

So, if you do use a relay, make sure that the backup source is connected to the normally closed contacts of the relay.