Sonar protocol and compatibility

I have an ultrasonic sensor SR04

 

$%28KGrHqJ,%21j%21E2KsrSTrGBNlKf9UMSw%7E%7E_12.JPG

 

the way it works is: you send a pulse on the leg, then it will send 8 ultrasonic waves, wait for echo, and then output a pulse on the same leg, the length of the pulse defines the distance measurement.

(you see trig and echo legs, but it can use one leg as both functions)

 

my question is - can i use this sensor for the arducopter ?

do all arducopter-official sonars works with the same protocol ?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I have solved this problem using an Arduino (Nano in my case) and made the project available on Bitbucket:

    https://bitbucket.org/albuckley/alx_hc-sr04_pixhawk/wiki/Home

    The system expects to see an analog voltage representing the distance on the ADC3.3 port. The Arduino does not produce true analogue output, it is PWM. As described n my solution, all that is required is a bridge circuit to transform the signal to DC and step the voltage down. It is easy, code provided along with instructions.

    It is plug and play at that point with arducopter, just have to find your calibration gain value in the parameter config of your favorite ground station.

    albuckley / ALX_HC-SR04_pixhawk / wiki / Home — Bitbucket
  • If you've got a spare Atmega328 with an Arduino bootloader lying around, you could theoretically program it to deal with the sonar logic, airwire it to the SR04 (with a few additional components) and fix it in place with some hotglue. It would still be cheaper than a Maxbotix and probably more fun.

    However, you'd need some additional components to get a true analog output from it.

    OTOH, you could use it to output the ranging value via I2C (and daisy-chain it with the magneto, then modify the arducopter/ardupirates code).
  • you can't use this without extra components on arducopter, it eats too much processing power

    the maxbotix sonar (which is recommended) gives out a analog value for the distance measured

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @gclue_akira: 柏の葉で走行させてるjetracerの中身 #instantNeRF #jetracer https://t.co/giVvuE4hP7
Jul 4
DIY Robocars via Twitter
Cool web-based self-driving simulator. Click save when the AI does the right thing https://github.com/pncsoares/self-driving-car
Jul 4
DIY Robocars via Twitter
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
Jun 25
DIY Robocars via Twitter
Jun 25
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
More…