DYP-ME007 with an AtMega8 AVR microcontroller

I wanted to be able to read the distance captured from the ultrasonic range finder device on a microcontroller, to know how to implement this device in a possibly bigger and more complex circuit later on. Starting simple, this code prints out a pattern relative to the distance output of the DYP-ME007. I am using my Atmel STK500 for both programming and operation of the AtMega8, and the pattern will be displayed on the STK500 leds. The comments in the C code will describe what is being done and why. Since C code specific syntax highlighting is not one of blogspots features, I will add a clean syntax highlighted image, and you can always download the code here.

The video quality is no good, but it’s easy to see what is going on. Notice the waveform on the scope in the background.

This article has 4 comments

  1. Hi
    That’s really nice development. I would like to know can we measure the Liquid Level too with the Ultrasonic Range Finder…. specially (Gasoline, Petrol) …

    Regards,
    Shan

  2. Hi Henrik,

    Please could you send me the c code for the working of DYP-ME007.
    Thanks for the tutorial

    regards
    Jayanth

  3. Please send me the code please

Leave a Reply