Trying to make simple heated mirror control circuit with fail-safe power off

Thread Starter

cjkbarnett

Joined May 16, 2025
2
Good evening all, and such a great site for resources. Been a long time lurker, now I am asking for help.

I am retrofitting some ptc heated mirrors on my Toyota, and would like to smarten up the power control for them.

I have a push in latching style factory switch I have made, one press and it pushes in to the on position, and another press and it's off again.

I plan on using some sort of 12v auto off timed relay so they only run for a short time, 5-10 minutes.

I would like to make a circuit with relays, so that if the car is turned off while the switch is pushed in in the on position, no power will be applied to the circuit, and it would require a off and on cycle to power the circuit again.

I was looking at using an esp32 to do it, but I feel that is over complicating it a lot. I'm perfectly fine with normal automotive circuits and the likes, but smartening up a circuit like this is not my strong point, and I just can't visualise how I'd go about it.

Any help is greatly appreciated,
Cheers, Cam
 

Ya’akov

Joined Jan 27, 2019
10,226
Welcome to AAC—at least publicly.

You could do this with nothing but relays. The automotive environment is notoriously noisy and dirty from a power and signals perspective. The ESPxx is overkill, many, many times over. If I was going to to this with an MCU, I would stick to a little 8-pin device like an ATTiny13A or 95.

As far as relays go, you have to think in terms of state. That is, you need to work out which relays will be receiving power at what time. The primary mechanism for doing logic with relays is passing the power to various coils through the relays themselves, the way a simple buzzer does.

Classic doorbell buzzers (and bells that use this approach) are very simple. They have a coil, an an armature, and a single set of normally closed contacts that are attached to the armature (in the case of bells, the clapper is also attached to it.)

The power to the coil is wired through the NC contacts. As a result, energizing the coil disconnects its power supply, then when the coil stops holding the armature, the contact returns to its normal—closed—and reenergizes the coil. This goes on until power is removed from the circuit and produces the buzzing or ringing.

Similarly, if you think about which relays need to receive power when (what is the state of the system in terms of closed and open contacts at important times?) then you can use DPDT or even DPTT* 3PDT relays as need to determine what will get power at what point in the flow of states.
*A weird typo—corrected.

You can work out the design incrementally, for example first take the case of using your switch to simply operate a relay that manages power for the heater. Then, add your time delay. Then look at the state of the system when the timer elapses or power is withdrawn and work out which relays are available, to provide power to so the switch can operate as desired.

Because you need this to work after power has been removed and restored, and you don't want the on-state of the switch to immediately power up the heater, you will need to use the state of the switch as part of your logic. So, when the car is turned on, if the switch is in the on-state, it needs to energize a relay that isn't the one providing power to the heater and not until that relay has been de-energized by turning the switch off, will the switch be sending power to the heater.

If you build this up as little functional blocks—powering the heater, timing it out, locking out the switch on power up, &c, it will be far less complicated and kind of fun to work out.

I really enjoy doing relay logic, it's very basic and is the way the first digital computers were built. I love my MCUs but sometimes relays offer a straight forward and very stable solution in a tough environment like a car. If I was going to use and MCU, I would use an ATtiny because I like them and they are cheap, and could handle the entire job including the timeout. But the choice is yours, of course—I don't think, as good as they are for so many other things, the ESPs are a good choice for this.
 
Last edited:

Thread Starter

cjkbarnett

Joined May 16, 2025
2
Welcome to AAC—at least publicly.

You could do this with nothing but relays. The automotive environment is notoriously noisy and dirty from a power and signals perspective. The ESPxx is overkill, many, many times over. If I was going to to this with an MCU, I would stick to a little 8-pin device like an ATTiny13A or 95.

As far as relays go, you have to think in terms of state. That is, you need to work out which relays will be receiving power at what time. The primary mechanism for doing logic with relays is passing the power to various coils through the relays themselves, the way a simple buzzer does.

Classic doorbell buzzers (and bells that use this approach) are very simple. They have a coil, an an armature, and a single set of normally closed contacts that are attached to the armature (in the case of bells, the clapper is also attached to it.)

The power to the coil is wired through the NC contacts. As a result, energizing the coil disconnects its power supply, then when the coil stops holding the armature, the contact returns to its normal—closed—and reenergizes the coil. This goes on until power is removed from the circuit and produces the buzzing or ringing.

Similarly, if you think about which relays need to receive power when (what is the state of the system in terms of closed and open contacts at important times?) then you can use DPDT or even DPTT relays as need to determine what will get power at what point in the flow of states.

You can work out the design incrementally, for example first take the case of using your switch to simply operate a relay that manages power for the heater. Then, add your time delay. Then look at the state of the system when the timer elapses or power is withdrawn and work out which relays are available, to provide power to so the switch can operate as desired.

Because you need this to work after power has been removed and restored, and you don't want the on-state of the switch to immediately power up the heater, you will need to use the state of the switch as part of your logic. So, when the car is turned on, if the switch is in the on-state, it needs to energize a relay that isn't the one providing power to the heater and not until that relay has been de-energized by turning the switch off, will the switch be sending power to the heater.

If you build this up as little functional blocks—powering the heater, timing it out, locking out the switch on power up, &c, it will be far less complicated and kind of fun to work out.

I really enjoy doing relay logic, it's very basic and is the way the first digital computers were built. I love my MCUs but sometimes relays offer a straight forward and very stable solution in a tough environment like a car. If I was going to use and MCU, I would use an ATtiny because I like them and they are cheap, and could handle the entire job including the timeout. But the choice is yours, of course—I don't think, as good as they are for so many other things, the ESPs are a good choice for this.

Thank you for the detailed response, you've really helped me understand what I need to do to get this working. I very much agree regarding the use of an Esp32 - way too overkill haha. I'm more of an analogue person, and to me it seems much more reliable, albeit a tad more bulky.

I will try draw up a diagram to help through working the logic out. The idea of making "blocks" is a good way to think of it

Again, thanks so much for the response, it's helped me immensely!
 

LowQCab

Joined Nov 6, 2012
5,101
Here's a really simple solution using several Chips if You want to go automatic and Electronic.

It "may" fit inside the Mirror-Housing.

No Button or Switch required, it's 100% automatic.

TL431 Voltage-Monitoring-Circuit, turns "On" when Car-Voltage rises above ~13.5VDC.

LM35-Temperature-Chip, set to turn "On" below ~0-degrees-C.

Generic-NFET to operate 1 or 2 Relay(s).
FET can be up-sized to completely eliminate the need for any Relays.

A few other odd and assorted parts to connect these Components together.

If you're interested in taking this route, I'll make You a Schematic with part-numbers.

More information on the Car's Wiring is required in any case, ( Pictures inside the Mirror would be a bonus ).
.
.
.
 

boostbuck

Joined Oct 5, 2017
1,032
I'm with Ya'akov (#2) on this - electromechanical relays are a good choice for home-brew in an automotive environment. Protecting electronics from transient destruction in cars is non-trivial.

For consideration, here is a relay circuit to turn a simple push-to-make button into a push-on/push-off, with power-off-reset as requested. The load as shown is a lamp, which could be changed to the on-timer for the heater.

It uses five DPDT relays, which seems like it could be simplified, but it originated as part of a larger sequencer.

1747456784427.png
 

MisterBill2

Joined Jan 23, 2018
27,159
An automatic turn-off for heated mirrors! A few of my cars have had timer shutoffs for the heated rear windows, and if you could locate one of those in an automotive salvage yard that would be an option. OR find one as a repair part at an auto parts store, or car dealer, which would be the very most expensive option.
Almost as good would be a visible indicator that you would remind you that the heaters are active. THAT could be as simple as a bright yellow LED wired in parallel with the heaters and installed in the instrument cluster. But never in the state of california, or other states where they fear any changes made to a car, and have rules against them.
 
Top