Does anyone know whether the communication protocol between the px4flow board and the MB1043 sonar sensor is normal UART-TTL protocol (TX/RX) or not(only use RX pin)? The datasheet of MB1043 sensor shows that it could connect only RX pin with the chip, for instance here. And actually I would like to replace this sonar with a laser so as to be used far away from the ground.
I get it!
there only RX pin is used on board.
here (304.7 KB) is the px4flow circuit schematic.
I am having the same problem as you. So, the solution is to only connect the TX pin of the Sonar to the RX pin of the PX4Flow?
I tried that and it didn´t work.
What am I missing?
Hi, What i used is actually the TFmini Laser rather than the Sonar. According to this doc, however, we know that this sonar is embedded with a clock, so it can be used without having to input a clock signal, you just need to connect the two pins Rx on PX4Flow and Tx on Sonar, which could be also confirmed by this. So, I don’t know what your problem is, but you need make sure that you have welded well the pins. If you are not using one of the sensors mentioned, then you need to make sure that the sensor you are using has a built-in clock, and then you can compare the source code while referring to my modifications to make it work for your sensor.
I am using a MB1043 sonar and a PX4Flow.
I solded all this pins of the sonar to the correspondents on the PX4Flow.
Is that why I can’t read the values from the sonar? What should I do instead? Connect only the first three?
Yes, this shows me that it just communicate with the chip via the wire UART4_Rx – SONAR_Tx. Therefore, soldering the rest of the pins only serves as a mechanical support. Well, if this still does not work properly, please make sure 1) the UART4 interface of PX4FLOW chip is working properly (e.g measure the voltage of the Rx interface), 2) the sonar is working properly (e.g arduino), and 3) the firmware of PX4FLOW is working properly.
Thank you for your help! I will test that!
Just one question about the firmware of PX4Flow: is there any way to test if it is working properly? The optical flow alone sends the correct data to the Flight Controller, so I assumed that it was not a problem of firmware.
Well, you don’t have to care about it if you are using the current official firmware. you could use QGroundControl to update it just like the firmware of PX4.
I tried to test the things that you told me, particularly the test with the sonar and an Arduino. I tested the TX-RX connection (figure 1) and the analog and PWM connections.
However, the first one it is not working. Am I missing something in this setup?
Well, most likely you have a bad sensor. If you are worried about any operational errors, you can refer to this article, and also to be on the safe side, you’d better keep the sensor and the PX4Flow board separate. Analog, PWM, TTl, As far as I can remember, they are three separate ports. Without the PX4Flow board, if the ttl port still does not provide any correct measurements, you need to replace a sensor.
I am having some problems connecting the MB1043 rangefinder to my PX4 controller, either directly or via a PX4Flow (optical flow), as the PX4 does not detect the sonar, so I always get 0 values for the sonarrange and sonarvoltage parameters .
The connection is made via the GPS1 port, as it appears that the I2C 2 port has a malfunction, and I can read the parameters provided by the PX4Flow, but not those of the sonar. Alsom I tried a lot of different combinations for the ports, but this is the only one that works for the Optical Flow.
In Mission Planner, I can’t directly activate either PX4Flow or the sonar (these options are grayed out) so I had to activate PX4Flow through the parameters tree. However, for sonar, I am unable to do so. I have already tried to change the various respective parameters, namely Addres and Type, but I cannot get the Flight Controller to detect the Sonar.
Can you help me one more time?
Well, in my opinion, since you have tried earlier to fail to get measurements using arduino via ttl communication protocol, it means that your sonar has broken down. If you have tested and make sure that the ttl port of the PX4FLOW is fine, I would suggest that you either buy a new sonar/laser or use the arduino to get the measurement of sonar and then transmit it to the pixhawk. As far as I know, the analog port on the pixhawk does not seem to work at the software level, at least in PX4 sys.