Code in setup section of a sketch

NMNeil

Oct 3, 2014
111
Joined
Oct 3, 2014
Messages
111
Can it be done?
I am learning to use the Ardunio Uno as I work on my project and believe this may be an easy way round a problem.
I am working on the ignition of my old tractor and will be using hall effect sensors to fire IGBT's.
My stumbling block is: what if when I turn on the ignition the hall sensor is over the magnet, which powers the IGBT and starts overheating the coil if it's left on too long.
My though was to put code in the setup to read the hall sensor and if it was on, to wait 20 milliseconds,(dwell at idle should only be about 4-5 milliseconds) and if it was still on to turn of the IGBT before moving into the main loop.
Don't forget I'm a complete newbie at the Ardunio;)
 

Bluejets

Oct 5, 2014
7,374
Joined
Oct 5, 2014
Messages
7,374
Then the program moves to the main loop after 20ms and finds the hall is still on so it turns the output back on again.
 

Bluejets

Oct 5, 2014
7,374
Joined
Oct 5, 2014
Messages
7,374
Probably best to use a change of state on the hall effect input pin or an interrupt on the same.

Ignitions systems can be a noisy environment though so be prepared for some unexpected interference.

I've found it best to put a small capacitor 0.01uf right on the base of the supply terminals of the hall effect switch(recommended by most manufacturers) and also protect the supply lines to the same with a 100R resistor and series zener (obviously supply to the hall coming off the zener).12v zener if using 12v supply

Hall switch I use by the way is Allegro A1120.

Many helpful and knowledgable people at the arduino forum also just as long as you are prepared to give some effort and not expect anyone to do the programming for you. Easy to join.
http://forum.arduino.cc/
 
Last edited:
Top