Ultra Sound Avoidance Assembly
by flyingsparkie in Circuits > Sensors
498 Views, 4 Favorites, 0 Comments
Ultra Sound Avoidance Assembly
![WP_20170823_18_50_51_Rich.jpg](/proxy/?url=https://content.instructables.com/FJT/G1VV/J6QQMYOZ/FJTG1VVJ6QQMYOZ.jpg&filename=WP_20170823_18_50_51_Rich.jpg)
![WP_20170825_01_16_12_Pro.jpg](/proxy/?url=https://content.instructables.com/FJ6/LOJU/J6QQMZJQ/FJ6LOJUJ6QQMZJQ.jpg&filename=WP_20170825_01_16_12_Pro.jpg)
![WP_20170825_19_02_37_Pro.jpg](/proxy/?url=https://content.instructables.com/F0W/2Y9C/J6QQN05Q/F0W2Y9CJ6QQN05Q.jpg&filename=WP_20170825_19_02_37_Pro.jpg)
![WP_20170825_01_18_03_Pro.jpg](/proxy/?url=https://content.instructables.com/FRU/T4VR/J6QQMZZ1/FRUT4VRJ6QQMZZ1.jpg&filename=WP_20170825_01_18_03_Pro.jpg)
![WP_20170825_19_02_50_Pro.jpg](/proxy/?url=https://content.instructables.com/F6L/WIDV/J6QQN06T/F6LWIDVJ6QQN06T.jpg&filename=WP_20170825_19_02_50_Pro.jpg)
![WP_20170825_01_19_28_Pro.jpg](/proxy/?url=https://content.instructables.com/FF6/FMWN/J6QQN033/FF6FMWNJ6QQN033.jpg&filename=WP_20170825_01_19_28_Pro.jpg)
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.
Ultra Sound on Breadboard to Prototype
![WP_20170826_15_37_40_Pro.jpg](/proxy/?url=https://content.instructables.com/FV0/UY1G/J6QQN1UN/FV0UY1GJ6QQN1UN.jpg&filename=WP_20170826_15_37_40_Pro.jpg)
![WP_20170826_15_37_02_Pro.jpg](/proxy/?url=https://content.instructables.com/FWD/DA2K/J6QQN1TL/FWDDA2KJ6QQN1TL.jpg&filename=WP_20170826_15_37_02_Pro.jpg)
![Ultra sound testing for avoidance](/proxy/?url=https://content.instructables.com/F35/ORK2/J6QQN6OV/F35ORK2J6QQN6OV.jpg&filename=Ultra sound testing for avoidance)
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!!
Three Ultrasound PCBs
![WP_20170825_01_16_35_Pro.jpg](/proxy/?url=https://content.instructables.com/FO9/YIMP/J6QQMZOY/FO9YIMPJ6QQMZOY.jpg&filename=WP_20170825_01_16_35_Pro.jpg)
![WP_20170825_01_18_37_Pro.jpg](/proxy/?url=https://content.instructables.com/F7J/7WQU/J6QQN010/F7J7WQUJ6QQN010.jpg&filename=WP_20170825_01_18_37_Pro.jpg)
![WP_20170825_01_19_21_Pro.jpg](/proxy/?url=https://content.instructables.com/F8Y/XXL2/J6QQN021/F8YXXL2J6QQN021.jpg&filename=WP_20170825_01_19_21_Pro.jpg)
![WP_20170825_01_16_52_Pro.jpg](/proxy/?url=https://content.instructables.com/F52/7039/J6QQMZVD/F527039J6QQMZVD.jpg&filename=WP_20170825_01_16_52_Pro.jpg)
![WP_20170825_19_03_16_Pro.jpg](/proxy/?url=https://content.instructables.com/FL5/9S96/J6QQN08Y/FL59S96J6QQN08Y.jpg&filename=WP_20170825_19_03_16_Pro.jpg)
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