Introduction: Ultra Sound Avoidance Assembly

About: I'm an Electrician, with Arduino life(not wife)

Hi, first off the ultra sound modules are the SR04 type(4 pins), I
tested one through a sketch from the examples and thought wouldn't it be great if I could get more than one working. Well this is the project, still in progress, as most projects are, that accomplishes exactly that. All the sensors were tested individually, making sure I could make a prototype a bit more permanent.

Step 1: Ultra Sound on Breadboard to Prototype


Here's a couple of drafts showing how I wanted them all hooked up. Again I think it's important to show scrappy stuff, like how it started and how it progressed. Also the first video of getting 3 of them working on the breadboard. You can hear the clicks from the sensor when it pings!!

Step 2: Three Ultrasound PCBs

Ok so I made the pcb's and tested with the Arduino Nano, it works really well, much to my surprise. The code is as usual a little raw but I hope it gives you a sense that trial and error is the key thing here, oh and a shed load of patience.

I more or less stumbled upon an idea to use calling methods and functions with several parameters being passed. I had used it passing single values, but never more than 1, it might not be efficient programming however.

ie.

getDist(2, 3, "left side ", "right", 1); //left detect

which calls.......

"void getDist(int trigger, int echo, String whichWay, String takeAction, int takeActionPin1) {
digitalWrite(trigger, LOW);

delayMicroseconds(2); // Trigger down delay

digitalWrite(trigger, HIGH); // trigger up

delayMicroseconds(5); // cleaner signal trigger delay before getting echo

etc...etc...

That about wraps it up, twas only about the assembly really

ta ta.

Nick