Pseudo-GPS using both the Ultrasonic and Compass sensors

Pardon if this topic was fully covered in the past. I have the ultrasonic sensor up and running and just ordered a Digital 3-Axis compass (Seedstudio).

A - My algorithm will first measure the room with the Ultrasonic sensor.
Then knowing what the center is, find its way to it using a combination of the compass and Ultrasound.

B - Once in the center, it could go to a waypoint (on my virtual map of the room) and again return to the home (Center) position.

Obviously, this is a precursor to autonomous maze navigation but I first need to get ‘A’ and ‘B’ fully working.

Any ideas or suggestions? I will share when it is working.


Sounds like a nice project. I had done a part of this long back. Here is the link to the project . Not sure if it still works but it was supposed to map the room using a servo and ultrasonic sensor and generate a map. Maybe you can build on top of it.

I had also played with the compass a bit and found out that the noise from the motors did interfere with the compass readings and the best results that I got was by placing the compass 6 inches above the GoPiGo. I just used a tube and taped the sensor on the top side.

All the best for the project and do keep us posted on how it goes.

By the way, which connector does the Compass go in on the GPG board?

Hi @salvideoguy,

If this is the Compass that you are using, then you should connect it to the I2C port on the GoPiGo.