GPIO of Jetson Nano not working with simple speed sensor


I am working with the Jetracer Pro for my study and I am trying to install a simple speed sensor which has a punched disk rotating through a gate. This gate then measures if there is an obstruction, and the sensor is from the company Joy-IT (Speed sensor LM393 with punched disk).
The supplied manual on their site describes how to connect the sensor to a Raspberry Pi board. This is comparable to the Jetson Nano and has the same GPIO lay-out, so I connected in the instructed way: positive to 3v3, ground to ground and digital output to GPIO 4 or board pin 7. The sensor turns on but no matter if the gate is closed or open, the value on pin 7 stays LOW.
Some tests I have done: The GPIO pin is working and I can communicate with pin 7 (using led test). Then I measured the output voltages on the digital signal, and this went from gate open, 0.2V, to gate closed, 1.1V. Now I understood that the voltage should rise above 1.25V to be switched to HIGH, and so I only receive the output LOW without any switching (using GPIO.RISING and GPIO.FALLING). Now If I remove the connection to pin 7, the sensor switches correctly from 0V to 3.3V.
I can not find any details on why this is not working with the Jetson Nano but it is working with an Raspberry Pi (not tested myself)? And what some of the possible solutions are.

ps. I only now that there is a difference, between the two board types, in current delivered by the GPIO pins, but i don’t see how that is related.

Thanks in advance for the time taken to help

hello thijs_n ,

could you please refer to Jetson-GPIO for the samples that enables the use of Jetson’s GPIOs,

hello JerryChang,

The Jetson-GPIO was installed, and was tested using some of the samples available on the Jetson-GPIO github. They were working correctly.

hello thijs_n ,

would like to confirm which pin you’re used. is it pin-7 from J41, 40-pin expansion header?
please also access pinmux spreadsheets for reference,

Hello JerryChang,

That is correct, pin-7 from J41.

I am new to working with the jetson nano board and never worked with raspberry pi. For more information: I didn’t change any pinmux settings from original. The Jetracer pro is from Waveshare and used there manual to setup, so pre-build image based on Jetpack 4.5.

hello thijs_n ,

it’s GPIO09 / GPIO3_PBB.00; this pin has by default configured as input with internal pull-up. (i.e. Int PU)
please have pin configuration, you should also check pinmux changes session for reference, thanks

Hello JerryChang,

Thank you for all the information, but isn’t that the correct pin to use. I also tried an input pin with internal pull-down but to no luck.
below the schematic for the sensor,

If I connect the vcc to 3.3V and GND, I can meassure an output on D0 of 0.244V and when the opto interrupter is blocked, 3.322V. Now I connect the D0 to pin 7 (which is configured as input), the output on D0 is now 0.232V and switches to 1.098V when interrupted.
I don’t get it why it changes so much, and maybe you have a clue?

ps. I got it semi working, maximum allowed switching of the sensor lowered, with an external pull-up scheme (using pin 7). But since I am gonna use the sensor to it’s max, I like to connect it directly to the jetson nano board

Hi, please read the 40-pin header doc first, there are some requests on how to connect an external device to GPIO pin.

Hi Trumany,

Thank you for that document, I think I now underdstand what is happening. The sensor supplies too little current (lower than 2mA) to reliably overdrive the weak output buffer which is always active as long as the OE pin is active. And therefor the output of the sensor is changed.
If I’m correct?
So i think the best option is to build an external pull-up scheme, since changing the sensor’s resistors will be too hard to do.