Problems Interfacing an NANO 33 IoT with a Speedsensor LM393


for a slotcar project I want to setup a slotcar with an integrated speedsensor.

As speedsensor, I use the GR-YM-226 from YOUMILE. It has a LM393 onboard and claims to run with 3.3V.

The read the sensor data using an interrupt like that:

pinMode(2, INPUT);
attachInterrupt(0, doCount, RISING);

Using Nano boards with an ATmega328P this works fine, but when upgrading to the faster Nano 33 IoT no interrupts are detected by the Nano 33.

Looking at the speedsensor, both indication-LEDs (one for power-on, one for detection) work fine.

Any ideas?

I have the fear, the board draws too much of power and I have no idea how to work around that, as I am not much into electronics :pensive:

Any help much appreciated.

Thanks in advance,

Interrupt 0 is not on pin 2 on the Nano 33 ioT.

Use digitalPinToInterrupt() instead of the actual interrupt number to create portable code.

pylon, thank you so much, I would never have found that.

Works a treat!!!

Thanks again,

Hi guys,

in case anyone is interested, this is the current install on a 124-scale slotcar:

Both sensor now work well, thanks to pylon!!

  • Speedsensor using the LM393 (blue board on the top)
  • Guide flag hall sensor (red board just below)

Overall goal is to setup an autonomous ghost car, learning how to go around a slot-track on it's own.
In case you like, here are some vids on how it might work (but did not really,.....)

  • 1st one with LITTLE voltage and a standard Arduino Nano
  • 2nd one using a cybernetic algorithm with different params on a standard Arduino Nano. In fact, the Nano turned out to be too slow and also got burnt later-on.

Next step is to use the built in accelerometer of the Nano 33 IoT and gather some real-time telemetrics using blynk.


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