Hi guys,
I'm building a circuit which controls the wing mirrors on my car. Essentially, I want the mirrors to retract and extend using 4 x relays (1A, 5V coil).
Details of the project:
- Measured resistance across the existing mirror motor to be around 180kΩ. They run off 12V.
- I'm using a 16F88 to control the relay switching sequence and timing. The signals from the micro are sent to a UDN2981 High-source driver, which then in turn drive the coils of each relay. Coil resistance of each relay = 167Ω.
- A 7805 regulator is used as voltage source for the micro and the source driver.
- A switch is used to simulate the car's accessory voltage. Conventionally, this comes on when the car is turned on.
- The circuit is simulated on a breadboard, with a separate relay board and a 1.5A/12V power supply.
See attached schematic. For simplicity I omitted two of the relays which are used in conjunction with the other relays to control the function of the motor.
During testing, I experienced some erratic behaviour from the circuit. The micro would reset and occasionally the relays would oscillate on/off rapidly. I did a quick search and found that this was common so I took the following measures to remedy the problem.
- placed resistors in between outputs from the micro and the inputs to the source driver. [made no difference]
- programmed the micro to have MCLR internally tied to Vdd. [made no difference]
- Added a 100n across 12V Rail and Gnd. [some improvement]
- Added a 100µF between 5V and GND pins on Source Driver [some improvement]
The circuit now works about 90% of the time. But occasionally the micro will reset, usually when the mirror retracts all the way in, reaches the end of its rotation, and stops suddenly, causing the motor to stall momentarily and presumably drawing maximum current. This should not exceed the circuit’s current limitations though.
Any thoughts on how to make the circuit 100% effective? More filtering capacitors? What size and where?
Would the breadboard be likely to be the cause of the problem?
Sorry for the long winded explanation! I didn’t want to omit too much detail.
Any help or suggestions would be much appreciated.
Cheers -Tom
I'm building a circuit which controls the wing mirrors on my car. Essentially, I want the mirrors to retract and extend using 4 x relays (1A, 5V coil).
Details of the project:
- Measured resistance across the existing mirror motor to be around 180kΩ. They run off 12V.
- I'm using a 16F88 to control the relay switching sequence and timing. The signals from the micro are sent to a UDN2981 High-source driver, which then in turn drive the coils of each relay. Coil resistance of each relay = 167Ω.
- A 7805 regulator is used as voltage source for the micro and the source driver.
- A switch is used to simulate the car's accessory voltage. Conventionally, this comes on when the car is turned on.
- The circuit is simulated on a breadboard, with a separate relay board and a 1.5A/12V power supply.
See attached schematic. For simplicity I omitted two of the relays which are used in conjunction with the other relays to control the function of the motor.
During testing, I experienced some erratic behaviour from the circuit. The micro would reset and occasionally the relays would oscillate on/off rapidly. I did a quick search and found that this was common so I took the following measures to remedy the problem.
- placed resistors in between outputs from the micro and the inputs to the source driver. [made no difference]
- programmed the micro to have MCLR internally tied to Vdd. [made no difference]
- Added a 100n across 12V Rail and Gnd. [some improvement]
- Added a 100µF between 5V and GND pins on Source Driver [some improvement]
The circuit now works about 90% of the time. But occasionally the micro will reset, usually when the mirror retracts all the way in, reaches the end of its rotation, and stops suddenly, causing the motor to stall momentarily and presumably drawing maximum current. This should not exceed the circuit’s current limitations though.
Any thoughts on how to make the circuit 100% effective? More filtering capacitors? What size and where?
Would the breadboard be likely to be the cause of the problem?
Sorry for the long winded explanation! I didn’t want to omit too much detail.
Any help or suggestions would be much appreciated.
Cheers -Tom