HC-SR04 Breakout Board for Arduino

This weekend I assembled the first version of a new HC-SR04 breakout board that I have been working on lately. The goal of this project is to let an Arduino Uno (or any other 5V microcontroller) monitor up to 8 ultrasonic sensors over SPI, therefore only using one dedicated pin. The other advantage is that by offloading the sensor monitoring, the master device can perform other tasks. My motivation for designing this is to use it in my Sparkfun AVC entry this year.

hcsr04_breakout_v1

The microcontroller is running pure AVR code (as opposed to Arduino code) and is running at 16 MHz, which I’m sure is overkill, but there is no reason why the board couldn’t also be run at lower speeds with some tweaks to the software and changing the fuse bits.

I made one mistake in the schematic that literally took me hours to figure out – I missed the connection between the SS pin on the header and the SS pin on the microcontroller, so SS was floating, resulting in intermittent communication failures. Once I figured out the root cause I had to solder a wire onto the back of the PCB to fix this. There were also some things about the board layout that I didn’t really like, so I’ve reworked the design and am now waiting for fresh boards from OSH park.

What better way to test this than create an electronic piano?

I’m offering a few of these breakout boards for sale in my Tindie store since I have surplus boards.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

2 thoughts on “HC-SR04 Breakout Board for Arduino

  1. Alastair Young

    Wow, that is a heck of a coincidence. I’m in the process of learning pcb design and smd soldering and as a first project I just designed and ordered my first PCBs for my octosonar – an I2C approach I describe here

    http://redhunter.com/blog/2016/04/28/sonari2c-multiple-hc-sr04-sensors-on-arduino-i2c/

    Both my “inventions” were created because there wasn’t one and I wanted it, and google showed that still nobody did it, and it looked like a fun thing to learn how to do. So why not do them as an exercise?

    Then I was randomly looking at how to sell surplus, googled for “etsy for electronics” which led me to tindie, searched for SR04 and there’s your board solving *exactly the same problem* in a different manner.

    And you’re a Dalek owner too. What are the chances?

    So there will be, however briefly, some friendly competition in this tiny niche. I need to recoup my component costs so I can respend the money on the next project, particularly as I messed up the first board order.

    I just wanted to say “hi” from me and Fred and let you know that I didn’t jump into your space on purpose.

    Feel free not to approve this comment on your blog, I’m just using using the comment box to message you directly.

    cheers

    Alastair

    Reply
    1. andygrove Post author

      It’s great to see I’m not the only one who thought this was a good idea. I only sell the products for fun and to cover some costs and I’m happy to see others doing the same :-)

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *