Detecting the state of "single" wire hall effect sensor.

I am trying to create direct ignition for my vintage Jawa 350 motorcycle, motorcycle is a twin cylinder 2 stroke, bike has 12V electrics and a ground is on chassis.

I have bought Arduino Nano board, and will use Arduino Spark Plug project as reference for the output part, of course, bike has 2 coils so I would double the following circuit.

I have also bought 2 hall sensor modules for Arduino, but since I already have two proprietary sensors manufactured for this bike specifically which are water/dirt/temp proof, I would like to use them instead.

They come of (this ignition) which has 2x "single wire" hall effect sensors, actually it's has ground connected to the chassis and and an an +5 to +12V power positive line wire. When there is no magnetic field detected it draws 6.2 mA, if it detects magnetic field it draws 13.8 mA.

Reason for not using original transistor ignition is that it has fixed timing, and I want to be able to control advance based on RPMs of the engine.

Now the question, is there a simple way to detect the state of this sensors, without using current measure module (i.e. ACS712 5A), I would need just to know if it's pulling 6.2 mA or 13.8 mA I do not need to measure it precisely or anything else, so it could be if it's more or less than 10 mA. Just 0 or 1 on an digital input pin or Arduino Nano would be perfect.

I have strong programming background but I am dumb for electronics somehow, please do not bully me if the question is silly. :slight_smile:

Put a resistor in series with the sensor ground lead, and measure the voltage across the resistor using analogRead(). Ohm's law will reveal the current, but it is not necessary to determine that.

Resistor selection depends on whether the sensor will tolerate it. Try 100 Ohms, and expect voltages of about 0.6 and 1.4V. You can go to lower resistance, but you might need to change the analog reference to INTERNAL (1.1V).

Put a 100 nF capacitor across the sensor resistor and a 10K Ohm resistor in series with the analog input, to protect from voltage spikes.

sensor.png

sensor.png

@jremington,

Thank you very much for your precise answer, have gathered all the components and just started playing around on breadboard.

Will post here as I progress.

Thanks again, very appreciated.

Try a 250 Ohm resistor as well. If that works (expected voltage levels about 1.6 and 3.5 V), you might be able to use a digital input, which is faster and more convenient than analog.

A single wire sensor is going to pick up ground loop noise, its usually best to have a sensor with
its own ground wire, grounded only at the Arduino end. Vehicle chassis's are likely to be a potent
source of ground noise alas. However if this is a hall switch (as opposed to analog sensor), it may
be OK as is. Then again the extremely noisy environment of a contact breaker may cause all
sorts of issues...

I really don't like your diagram! The high voltage ground for the coil has to go either through the 12 volt battery of the MOSFET.

Paul

@jremington, thank you, I will try the 250 ohm resistor.

@MarkT, I will isolate the ground from the chassis ground, as shown on @jremington's diagram and than run a separate ground wire back to Arduino's ground.

@Paul_KD7HB, can you please be a bit more elaborate, do you think there would be some harm done to the components or Arduino board?

At the moment it's implemented as described in Christian Liljedahl's blog post. You can see video of mine running on this video, this is 10 hits per second (600 RPMs), I managed to make it hit up to 7500 RPMs, which is enough for my motorcycle.

Oh, probably a rapid pulse of 30,000 to 50,000 volts through a battery or MOSFET would not do much harm. What do you think?

Perhaps you need to follow your schematic drawing a bit. One lead of the HV goes to the spark plug. To make a spark, a complete circuit needs to be made. The only possible way to complete that HV circuit is through the battery and through the transistor.

Paul

Paul, I am sorry but as I said, I am a bit "dumb" for electronics, this is just my free time project so I am trying to learn on the go.

By my understanding battery is getting that impulse from the spark anyhow, please take a look at attached wiring diagram for Jawa model 638, might be you could help me understand if opposite.

Arduino will be powered by guts of USB car charger (12V, 1A). I am not sure about long term damage, but I left Arduino Nano board, an STP36NF06L N-MOSFET (60V, 30A, 70W, 0,04Ohm) connected to a stock ignition coil, running over night, and in the morning - it was still running fine. Both board and MOSFET are still running today. Not sure how to determine if there is some degradation on the MOSFET side.

My hope to use the Gotronic sensors by the approach proposed by @jremington are a bit diminished as it does always returns 1.83V, and it does not change if the magnetic field is present.

However I am testing with Arduino KY-003 Hall magnetic sensor module, and this one plays really nicely and I will be able to use interrupts with them. If it turns out to be too hard to fit them on the motorcycle, might re-consider ACS712 5A module.