I’m trying to connect an Arduino micro to the Pixhawk through the i2c port.
Actually it doesn’t works, I think it depends on voltage levels of the i2c bus.
The Pixhawk connections are shown on the following link:
for simplicity I transcribe them here:
1 VCC +5V
2 SCL +3.3V (pullups)
3 SDA +3.3V (pullups)
4 GND GND
How can I correctly connect it?
Every advice would be very appreciated,
You could use a level translator like this
Also has various other info on the site , such as a hookup guide covering i2c
Note. I havent tried it myself, but the reviews say it works.
Thank you very much (again) skyscraper,
do you think an Arduino mini could be a good option?
can I connect it (arduino mini) directly to the pixhawk board?
You can get a 3V Arduino mini as compared to a 5V one., then you dont need a level translator. The 3v one is the same microcontroller but it runs at 8MHz rather than 16 MHz so has a different crystal. You need to select it in the Arduino IDE to get the right timings etc
If you do that you should have no problem wiring it up. You can just wire the I2C pullups to 3.3V and it should work easy, just beware that you may need a 3v FTDI I think, you will have to chaeck that
I’m doing something similar by connecting an arduino over I2C to simulate a Maxbotix sonar (with the cheap ultrasonic distance sensor). It turned out i have to remove the bootloader from the arduino, because it booted too slow, therefore the arducopter did not recognize it.
If you have some similar issue, try powering the arduino before powering the pixhawk (or pixracer) OR restart the arducopter program from NSH shell.
Hope this helps.
thanks for sharing your experience, your project is pretty similar with what I’m doing.
Actually I’m far to get it to works, after I have tried to connect an Arduino micro through i2c, it’s bricked out and stops to work after few seconds it’s powered!
Which Arduino board are you using?
Im using special board:
Ultrasonic Sonar module dedicated for APM 2.5 2.6 2.8 flight controller, plug and play, no need to change hardware and software
(from AliExpress Android)
It has a hc sr04 and an atmega328, where i modified the software to provide i2c instead of pwm. Shared it on this forum. Please check my topics created.
Hi skyscraper, im having issues with my maxbotix mb 1202 and mb 1242, i would like connect it on my arduino mini pro, do you mind share the correct wiring of the sensor on the arduino mini pro board and the ino file for the configuration.
Hope in a your positive answer
I’ve already try i don’t know how many times, and also i saw that every
time you upload sketch on the arduino one im having errors even im
following the instructions of the site