3

I am working on my final project by autonomous Quadcopter. my tasks are to make a quadcopter which should do object avoidance and it should auto land using ultrasonic sensors. any possible ans to it, how should i connect HC-sr04 ultrasonic sensor to my APM 2.6 board? Even APm 2.6 has a port I2C.

2 Answers2

1

The APM has a I2C port on it (see here) (pinout here) it operates at 3.3v so you will need a 5v to 3.3v level shifting board like the one sold by sparkfun however the HC-SR04 (datasheet) does not use I2C, in order to use it over I2C you will need an additional microprocessor such as an arduino to read the data from it and send it to the APM. You could connect it up to the GPIO pins that are available and write some custom drivers for the rangefinder subroutine but it would be much simpler to simply use a supported ultrasonic sensor as described on the APM wiki.

Mark Omo
  • 1,919
  • 13
  • 23
1

HC04 not need a i2c connection just have vcc, gnd, trig and echo pins. vcc to 5v gnd to gnd trig and echo pins need digital input and output.

acs
  • 1,124
  • 11
  • 28