Ultrasonic Sensor with BrickPi and Raspberry Pi 2

Hello together,

we are working at a project to setup a self parking car for our University. We’ve done this already with MATLAB and the EV3-Controller of LEGO. Everything is ok. Now we also want to do this with the Raspberry Pi 2 and the BrickPi.
All Motors are running perfectly but i don’t get any correct value of the ultrasonic sensors.

We use:

  • Raspberry Pi 2 (with 2015.11.09_Dexter_Industries_wheezy) and completly updated
  • BrickPi
  • 3 Motors from LEGO EV3 (one for steering and two for driving) ==> they work perfectly
  • 2 ultrasonic sensors from LEGO EV3
  • programming with python

I think i’ve tested all options to get the ultrasonic sensors running on the BrickPi. (I’ve tried the Rasp B+ Model, the Rasp 2 Model, different ultrasonic sensors, different sensor slots, powered by battery pack or over the rasp connection, system with updated, system without updates).
If i use the “EV3_ultrasonic_test.py” the sensor returns always 0. If it’s disconnected something about 1008.
But if i use the “LEGO_ultrasonic_test.py” the sensor always returns -1, no matter if it’s connected or not.

All sensors work. I’ve tried it with MATLAB.

So maybe you have an idea to fix that problem?

Thanks in advance
Felix

Hey Felix, this must be maddening, I’m sorry.

First, which version of the BrickPi are you using? Does it have a version number on the board?

The EV3-Ultrasonic_test.py is the correct version of the software to try with the EV3 ultrasonic sensor. Can you double check the sensor is plugged into the properly numbered port?

Hi John,
thank you very much for your fast answer!

But we just fixed the Problem. The Problem was, that we had the wrong BrickPi-Version. We had the BrickPi not the BrickPi+.

Felix

Great, thanks Felix. Glad we could get this working!