How to use sensors with RPi directly

Hello,

I have an old GoPiGo 2 lying around. I loved it and it was a great bridge to advanced RPi robotics, which I’ve moved on to. However, there’s a bunch of sensors on it that I’d like to use in my latest RPi robot project. They are as follows:
Distance sensor
Line following sensor
Color sensor

I’ve seen the solder holes and contact pads, but I have a few questions:

  1. How do I change the I2C logic level to 3v? I saw the solder pads to change some settings, but I’m not sure how they work. (Color sensor).
  2. What code would I use? (All of them)
  3. For the I2C ones, is there a way to do I2C addressing? I have an I2C board already on there, so I don’t want any interference.

Thanks in advance,

2231puppy

1 Like

Those sensors and libraries can be used with a simple RPi but you will need to sacrifice one cable.
Or you can order these:
https://www.amazon.com/Cables-Grove-Female-Jumper-Grove-Conversion/dp/B01CNZ9EEC

Then you can connect them to the I2C pins on the Raspberry Pi

have fun!

1 Like

Thanks for the fast reply. I actually have a few of those cables. How do I code the sensors? Is there a pin map for the cables?

1 Like

Google gave me this

And you can install the libraries as such

curl -kL dexterindustries.com/update_sensors | bash

Hope it helps!

1 Like

Hello,

I’m still a little confused as to how to code the sensors. I ran the setup script, and everything went as planned. However, I peeked at the class files for the line follower and saw a lot of references to the GoPiGo’s ports (on the red PCB). How do I establish a direct connection using the pins on the Pi and read data from the sensors?

Thanks,
2231puppy

hello @2231puppy
have you looked at the documented examples here: https://di-sensors.readthedocs.io/en/master/examples/index.html

They should be independent of the robot (or lack thereof). It’s best to use "RPI_1" as your bus when you don’t have a robot.

Cleo

1 Like