G+_Shooter_FPV (Shooter_FP Posted May 19, 2018 Share Posted May 19, 2018 Hey all... an Arduino question for y'all.. I made a Tiny Whoop (mini quad) race gate with an Arduino, a Pololu LED strip and a 3-foot piece of clear tubing. I used the code from Pololu and I can change the LED sequence by loading a different library, but that's the limit of my Arduino knowledge. Whant I want to do is integrate an ultrasonic sensor, a basic one, into the gate, so that when something flies through it the LED blink pattern changes. Can anyone shoot me over to a starting point to see if I can actually get this to work? Is it even possible? Link to comment Share on other sites More sharing options...
G+_Shooter_FPV (Shooter_FP Posted May 19, 2018 Author Share Posted May 19, 2018 Link to comment Share on other sites More sharing options...
G+_John Sullivan Posted May 20, 2018 Share Posted May 20, 2018 Ken Jancef I read your post this morning, but didn't answer right away, hoping that someone more knowledgeable would go first. As that did not happen (yet), here goes. I would start here: https://www.hackster.io/Isaac100/getting-started-with-the-hc-sr04-ultrasonic-sensor-036380 Just read through the opening paragraphs to get an idea of what is going on. This example, like most I've found, uses an ultrasonic transceiver to measure distance to an object, but you just want to DETECT an object. I would start with the code shown, but not "pulse" the Trig pin, I would just set it HIGH so that it is always transmitting. Then I would watch the ECHO pin for a HIGH and when that happens, and object is detected and you can run your change-the-colors-code. So, from the example I would ignore the "pulseIn" function, and also the "duration" variable, and just watch for the ECHO pin to go from LOW to HIGH. p.s. Now that I've thrown that out there, I'm sure someone else will come up with a better idea ;). And I would not be surprised if Padre is already working on a solution to use in an upcoming episode! Link to comment Share on other sites More sharing options...
G+_Shooter_FPV (Shooter_FP Posted May 20, 2018 Author Share Posted May 20, 2018 John Sullivan Thanks for the reply John! I will check that out... it sounds like a great start!!! Link to comment Share on other sites More sharing options...
G+_Mark Olson Posted May 29, 2018 Share Posted May 29, 2018 You have probably seen this episode that uses both an ultrasonic sensor and an 8-LED WS2812B strip: TWIT.TV KnowHow Episode 178 about Arduino Collision Avoidance twit.tv - Know How... 178 Arduino Collision Avoidance | TWiT.TV Their code for the sensor seemed pretty clear to me. When I did something similar, I added a potentiometer so I could adjust the range. https://github.com/Mark-MDO47/KnowHow_ParkTheCar Link to comment Share on other sites More sharing options...
Recommended Posts