as part of our training as a state-certified electrical engineer, my team and I develop a drone based on a Raspberry Pi 4 B and a Navio2. Currently we have some difficulties integrating the ultrasonic sensors (SRF08).
We have already tried it unsuccessfully via an Arduino (Arduino to US sensors via i2c bus and via USB to RPi / Navio2) and are currently trying to implement them directly via the i2c bus (without Arduino).
Sensors work fine with the arduino (provide readings via python-script (USB-connection to RPi)) and if we connect one sensor to the RPi/Navio via i2c it is acknowledged (i2cdetect -y 1). If we run some testing scripts though we always get Errno 121.
Which connection we use doesn’t matter, but we´re losing time we don’t have…
Since we can find little up-to-date documentation, we wanted to ask if someone could give us useful advice.
Could you please provide me with the photos of your hardware setup and share the screenshot of the
sudo i2cdetect -y?
we changed the address of the SRF08 to 0x72. We tried with and without 1.
8k pullup resistors.
Thanks in advance!
We can now read the distance of a sensor on the raspberry sent from the arduino to the raspberry / navio2.
We haven’t yet managed to get the distance to the GCS.
Is it correct that in order to be able to use the distances of five sensors (srf08) for avoidance we have to use the mavlink protocol?
Does that make sense via i2c or is it better to use uart?
Most of the documentation is for PX4 and we don’t know what is possible and what is not possible with Navio2 or what is the most sensible way.
Thanks in advance
I wanted to add that a big part of our projekt is the documentation.
If we are successful (deadline January 2021), we will publish a guide on how to build a drone based on Naio2 / RPi4, flown partially autonomous (avoidance) which records various environmental data and sends these to a GCS. Since it will be written in German it could take a while to translate it.
Sorry for the delay.
You need to use the mavlink protocol to send distance values from sensors to GCS. Please, take a look at this article from Ardupilot docs to see how to do it.
As far as I see from the datasheet, SRF08 supports I2C only. Additionally, I2C is a better protocol for multiple sensors as in your setup.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.