I/O error using Piicodev Laser

My first project so just wanted to try something straightforward by following the guide on using the Piicodev Laser

Connecting the hardware and coding as described I hit an "OSError: [Errno 5] Input/Output error with full screen shot of all messages and hardware as attached images.

I’ve tried reseating and trying different slots on Piicodev GPIO board with same result. Also I2C is enabled with reboot since and I can’t see where I’ve run off the rails so quickly.

What problem have I run into?


1 Like

Hey Alex, Welcome to the forums!

What an annoying problem to have. Your error message seems to indicate that your code isn’t able to establish the I2C link to the sensor but isn’t any more specific than that from what I can make out.

Easy step first, Make sure everything is plugged in correctly and firmly.

Then try using the command: sudo i2cdetect -y 1to check whether your Raspberry Pi can detect the sensor.

This command should return a grid with all available I2C addresses. Addresses currently in-use will be marked, and you should see 0x29 if your sensor is correctly connected and responding. Feel free to share the results of this.

If the Pi can pick up the sensor correctly it may an issue with how your libraries are installed. Probably worth it to reinstall the PiicoDev Unified Library: PiicoDev_Unified.py and the device module: PiicoDev_VL53L1X.py and double check they are in the same directory as your code.

Hope this helps!

1 Like

Hi @Roving-Eye.com - thanks for the picture, it’s really helpful: I think I see your problem :smiley:
I think you’re header is not connected properly - you appear to be one pin off!
The clue for this was that there was no power LED active on the Laser Distance Sensor

Have a look from the side and I think you’ll see that the whole Adapter board is shifted out of alignment by 1 pin

Hopefully this hasn’t been destructive… fingers crossed! :crossed_fingers:

1 Like

Hi Michael, oops yes indeed… other devices worked after but it was removed and reseated a few times in those other tests and I avoided that first-ever-time error!

On another note: I saw in the 30+page doc for this device references to such as “short range” where you could limit how far it would sense for… and also be less affected by ambient light in the process. This could be handy for my project.

I used print(help(my_laser_connection)) to list all the functions available in the library but nothing like the mode the underlying device is capable of shows up in that API…

Any pointers there?


1 Like

ps: laser functioning now… seems a bit laggy and doesn’t track hand movement in real time as would like… but I will persist with more experiments to check its just not I/O bound in the print() process and not reflective of true device responsiveness…

1 Like

Good to hear!
Good catch by Michael on that one, let us know if you need any help going forward.