• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with mimicking a key switch

Not open for further replies.


New Member
Hey, for a project I am creating an auto starting fire pump. Since its been a while since i've done much electronics work i'm stumbling a bit on the design of a switching circuit to replace the key switch on the pump..

The control signal will be 5V from the microcontroller..

There are 4 contacts: Battery, Starter, Ignition, Ground..

To start the motor, Battery and Starter have to be linked.

once the motor is running none of the contacts are linked.

To stop the motor, Ignition and Ground have to be linked.

I'd be grateful if someone could suggest a circuit that would do this please.



Exactly what do you mean by 'auto' in auto starting?

It might expedite things if you could provide a circuit sketch for each of the separate switch states that are required.
Last edited:


New Member
By auto I mean I will be sending an sms to a phone attached to the PIC which will start the engine..

Yes, I have the starter circuit diagram which shows the different states and relating wire connections


That is helpful ... engine to be started with no one in attendance..... Assuming that it is an internal combustion engine running on gasoline ...

... Just trying to understand the problem here:

Possible turn on sequence:
1. activate a starter relay connecting starter and battery.
Then terminate the start relay on state, either by a time-out, or maybe an rpm detection.
....Does the engine start reliably .... on cold start conditions? If so, then just set up some reasonable starter time limit ... a second or so.

Turn off sequence:
1. Activate a relay to connect ignition to ground

Do you think that you need to confirm the crankshaft rotation when the engine is started cold? Or do you think that you can .... with some confidence ... just give the starter motor a burst?

Does anything else have to be set? Is there a cold start choke setting?

To be certain that the starter motor has succeeded in starting the engine, you will probably want to have a crankshaft rotation sensor. This would allow you to confirm that the engine is operating. If you do not receive a crank rotation confirmation signal, then then you would repeat the starter motor command ....
Seems like this would be the way to go....

To reiterate:
1. Send starter motor command burst .... maybe on for 1 second
2. Detect the number of rpm sensor pulses in a given time ... maybe 30 sec.
3. If # of detected crank pulses is less than optimal, then repeat starter motor command.
4. Count number of starter motor command that have been sent. If greater than a certain number ... maybe 5 or 10m, then terminate start-up attempt
Last edited:


New Member
I'm monitoring the RPMs of the engine to determine if its running or not.. Choke is controlled by a actuator and temp sensor.

All i'm after is a circuit to replace the key switch..


How many amps does the starter motor require?

Suggest going to an auto supply ... getting a 12V starter relay.

Then you will have to devise a circuit to drive the relay coil with the signal from the PIC. You could probably use a bipolar transistor ... but there are other ways to do it.

Similar approach for the engine off circuit .....

Not sure if I can help you out with specific information at this time, though.
Last edited:


New Member
Use 2 relays. One needs to be strong enough to handle whatever current/voltage the starter motor requires.

Wire the starter relay's normally-open contacts to the key switch's starter contacts. Wire the relay coil, using a transistor to provide enough current, to an output pin on the PIC.

Wire the 2nd relay's normally-open contacts to the ignition-off contacts on the key switch. Wire the relay coil, using a transistor to provide enough current, to an output pin on the PIC.

Also wire the RPM sensor into an input pin on the PIC. Program the PIC to start the engine by engaging the starter and monitoring the RPM signal. When the engine catches, the RPM should increase and the PIC can disengage the starter, and continue to monitor the RPM to ensure the engine continues to run. Repeat the start attempt if necessary.

To stop the engine, engage the ignition-kill relay and wait for the RPM signal to stop, meaning the engine has stopped. Then disengage the ignition-kill relay.

Alternatively, you could put the ignition-kill on the normally closed contacts of a SPDT relay and then the ignition will be "off" by default (for safety). When the PIC wants the engine to run, it would engage the relay, disconnecting the ignition-off short circuit, and then start the engine. Then disengage the ignition relay to stop the engine.


Well-Known Member
either transistors or mosfets

depending on amount of current needed to excite the starter relay.
the ignition shutoff is just a relay w/ transistor driving said relay.
some ignition systems are electrically noisy.
not to mention the automotive electrical system as well.
suggest a good LDO regulator for the PIC unless this is a kit already assembled some it already has ample regulation.
Not open for further replies.

Latest threads

EE World Online Articles