Magnetic Motorcycle Speed Timing

Bonjour à tous,

Mon projet:
Je suis en train de fabriquer un chronomètre pour moto sur circuit de vitesse avec un Arduino. Je souhaite déclencher automatiquement le chronomètre en détectant le passage de la moto sur une bande magnétique prévue à cet effet dans le bitume de la piste. J'ai besoin d'aide pour choisir la meilleure façon (hardware et code) de réaliser cette détection.

Etat de l'art:
Les circuits de vitesse sont équipés de bandes magnétiques (aimants permanents) placées dans le bitume, traversant perpendiculairement la piste. Ces bandes sont justement prévues pour le chronométrage. On trouve dans le commerce des chronomètres qui détectent ces bandes. Notamment chez les fabricants Alfano et Starlane. Par contre cela coute environ 250€. Les fabricants de chronos utilisent un capteur à effet Hall analogique qui a une sensibilité de 4mV/Gauss (1Gauss = 0.1mT).

Mes choix techniques actuels :
Je souhaite utiliser un capteur à effet Hall A1324. Pour le moment je ne prévois pas d'électronique supplémentaire (ampli ou filtre) mais ce n'est pas exclu si besoin. Ce capteur, une fois alimenté en 5V, délivre une tensions de sortie de 2.5V à vide. Cette tension de sortie varie de 5mV/G en fonction de l'intensité du champ magnétique dans lequel il est plongé.
Le capteur sera placé au plus bas de la moto (sabot moteur) donc à environ 10-15cm du sol. A cette distance le champ est assez faible (environ 7G d'après mes mesures).

Signal à détecter:
D'après mes calculs, cela devrait nous donner lorsqu'on passe sur la bande à 200km/h un pic de tension sur la broche de sortie analogique du capteur de type gaussienne, d'une durée de l'ordre de 1ms et d'une amplitude de 35mV (ce sont vraiment des ordres de grandeur mais ça peut varier).

QUESTIONS:

  • Comment coder la détection de ce pic de tension sur une des broches analogiques de l'Arduino ?
  • Faut il envisager un traitement électronique de ce signal entre le capteur et l'Arduino ?

PS: Certains circuits ne sont équipés que d'une seule bande magnétique, mais d'autres peuvent aller jusqu'à 4 bandes magnétiques réparties sur le tracé. Cela permet de connaitre ses temps par secteur (par exemple du virage 1 au virage 4, puis du 5 au 7 et ainsi de suite). Pour le moment je ne souhaite déclencher que 1 fois par tour. C'est pour cette raison que j'utilise un Arduino, mais ce n'est pas le sujet de ce post. restons focus sur la manière de détecter le passage sur la bande magnétique.

The ADC on most Arduino has 10 bit resolution (0 to 1023) and, by default, measures voltage between 0 and 5V. It has a theoretical resolution of about 5mV like this.

The expected change from your sensor is only 35mV which is only a difference of approximately 7 points in the ADC reading. This will be a problem because analog circuits always have some electrical noise, and on a motorcycle I guess it will be much worse. So I think you will have many false detections.

The ADC can be configured to measure voltages between 0 and 1.1V on some types of Arduino. Like this, the resulting will be about 1mV, and your sensor peaks will be around 35 points difference.

The problem then will be that no voltage above 1.1V can be measured, so I think you will need to change the range of readings coming from the sensor. An Operational Amplifier ("Op Amp") may be needed to achieve this. It will be able to both amplify the sensor signal and adjust it's overall level to allow the Arduino to detect the sensor peaks to be detected more reliably.

Another option could be to use an Analog Comparator chip. These take 2 analog input signals (one from a sensor, one from a pot you can adjust to set a trigger level) and have one digital output you can connect to an Arduino digital input pin. This will be very simple and fast to react to changes in the sensor signal.

Yes, an Op-Amp can do that.

They have 2 inputs marked + and -. You can connect the + to the sensor and the - to a pot.

Connect the output of the Op-Amp back to the + input also to achieve a gain of 1. Use a resistor there to increase the gain.

Yes that was my first intention ! I purchased this component:

But the issue is that it toggles from 0 to 5v only when the magnetic field is like 100G. and the signal I want to detect is more around 5-10G...

The pot on that module should allow you to adjust the trigger threshold.

This module is essentially the analog comparator I mentioned before.

OK I will take a look if I find on the web a amp-op that can have :

  • Gain
  • Offset

All Op-Amps have those features.

Check this helpful link:

1 Like

Thanks @PaulRB for the reference
This shows exactly that application:

It will be an interesting experiment, but I dont hold much hope of valid detection.
You are seeing a change of 35mV SO I'd suggest trying a gain of about 30 to give a 1V change. So eg R2=1M and R1=33K

If you used a higher gain (R1=22k giving *50) you could even reach voltage levels (VIL <1V, VIH >3V for a 5V arduino) that would allow you to use a digital input.

After investigation it turned out that this KY024LM component has 2 modes :

  • Analogic : The output is at 2.5V without any field and goes 1.4mV/G up or down depending on the polarity and intensity of the field
  • Digital: The outpout toggles from 0V to 5V when exposed to a magnetic field. The pot adjusts the trigger value of the field, but I think the minimum trigger value is 100G and can only be increased by the pot (it can't be less than 100G).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.