Using Ultrasonic Sensors?

I basically want to make a customisable reversing sensor in that I want to be able to use the sensors from a basic car system and be able to add and change the audio and visuals outputs and the distance at which they are triggered.

Question by kjhdfadn 7 years ago  |  last reply 7 years ago


Why does my Arduino script do the opposite of what I want? Answered

Hey out there! I am trying to write a code for an Arduino project I am working on. I am using an ultrasonic proximity sensor and an arduino nano clone. What I want is that when the object it detects is under 50cm an led turns on. When it senses an object farther than 50cm I want theLED to go off. Below is the script I wrote. The problem is it does the opposite of what I want(objects >50 LED goes on, objects <50 LED goes off). Any help would be greatly appreciated! Thanks! #define trigPin 3 #define echoPin 9 int LED = 12; void setup() {   Serial.begin (9600);   pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);   pinMode(LED, OUTPUT); } void loop() {   float duration, distance;   digitalWrite(trigPin, LOW);   delayMicroseconds(2);   digitalWrite(trigPin, HIGH);   delayMicroseconds(10);   digitalWrite(trigPin, LOW);     duration = pulseIn(echoPin, HIGH);   distance = (duration / 2) * 0.0344;     if (distance >= 50){     Serial.print("Distance = ");     Serial.println("Out of range");     digitalWrite(LED, LOW);   }   else {     Serial.print("Distance = ");     Serial.print(distance);     Serial.println(" cm");     digitalWrite(LED, HIGH);     delay(500);   }   delay(500); }

Question by Mpc1055 1 year ago  |  last reply 1 year ago


[Help] bicycle proximity sensor

Hello guys i would like to start making a proximity sensor the idea is to mount it on the back of my bicycle when an object/vehicle come close it gives me reading with distance and maybe a beep or something like that,the question is i found there are 2 methods one using IR and one using ultrasonic,which one is cheaper and which one is better and easier.this is supposed to my first instructable involves programming.

Topic by Mido Masry 3 years ago  |  last reply 3 years ago


where can i get a under water ultrasonic sensors in india or online. i'm doing a progect on under water robot using arduino

Hello, im from bangalore india. looking for a under water ultra sonic sensor for a under water robot. compatible with atmega 8, arduino.

Topic by opadigela 7 years ago


can we record ultrasonic sounds. ?

.if it so how we can.can we recieve it using microphone(ie it can be converted to electrical energy ah

Question by thenmozhi 10 years ago  |  last reply 7 years ago


How do I make a 3D distance scanner using ultrasonic arduino modules?

I have 3 Ultrasonics Arduino compatible distance sensors. A single ultrasonic sensor can be used to measure the distance of an object from the sensor. But my application for the sensors is a bit different. How do i measure the distance of the object on all 3 axes with respect to the ultrasonic sensor?

Question by Jonathanrjpereira 4 years ago  |  last reply 4 years ago


ultrasonic sensor convert 4 pin to 5 pin

Hello there, Is it possible to convert a 4pin ultrasonic sensor to a 5pin? I have this sensor with 4 pins: http://www.ebay.com/itm/Waterproof-DC-5V-DYP-ME007Y-Ultrasonic-Sensor-Module-Measuring-Range-30cm-3-5m-/201025966447 and this display module with "5 pins": http://www.ebay.com/itm/Mini-Non-contact-Ultrasonic-Motion-Detector-Module-Sensor-Display-Board-Security-/360717776823 How do i get the display module and sensor module, to talk together? BEST :) Regards Lasse

Topic by dmor 5 years ago


Need help for improving PING Ultrasonic sensor code to make it precise

Hi guys,               I havebuilt a circuit to detect the swinging of an object using ultrasonic sensor and send signals to the Arduino Duemilanove board which in turn activates the solenoid. The circuit is working fine but I'm using a PING Ultrasonic sensor and I'm having hard time controlling it with the code. Do you have any idea about how to control and make the readings precise for the Sensor? If you want, I can post my code here... Any help is appreciated. Thanks in advance!

Topic by kailash174 6 years ago  |  last reply 6 years ago


How to stop a servo using conditional if?

I'm using an Arduino Uno, Ultrasonic sensor (HC-SR04) a Servo motor (SG90 Tower Pro). I would like to rotate the servo continuously from 0 to 180 and back to 0. I would like to stop the servo whenever the ultrasonic sensor detects an object  at a distance of 40 cm or less. I know how to rotate the servo and how to detect an object using the ultrasonic sensor, but I couldn't combine the two. Can you kindly help me on how to do so?

Question by iSmartov 1 year ago  |  last reply 1 year ago


Can the NXT 2.0 ultrasonic sensor detect glass?

So, can the sensor sense glass? since its ULTRASONIC does that mean it detect things by sound and not by light? 

Topic by NXTHacker 6 years ago  |  last reply 6 years ago


Hey everyone. Can I use this to make something like a ping ultrasonic sensor except for ir? Answered

Hey everyone. Can I use this to make something like a ping ultrasonic sensor except for ir? Or somehing like this.

Question by TOCO 9 years ago  |  last reply 9 years ago


ultrasonic radar pc software

What pc software do you use to create a radar screen on computer screen that then picks up signals from ultrasonic sensor???

Topic by toka519 6 years ago


new to arduino, want to run a dual display for 2 sensors

I'm new to the Arduino community.  wanting to set up a dual radar setup with 2 ultrasonic sensors,  (Ultrasonic Sensor Module HC-SR04), and outputting to a pair of 7 segment displays ( two 7 segment displays each).  I've found a code to do a single could use a lot of help to output two at the same time, basically 2 lanes without 2 units.  im using an arduino mega, ordered a unor3 and hopefully it can be made to run on one or the other. code is as follows: /* HC-SR04 Sensor    The circuit:     * VCC connection of the sensor attached to +5V     * GND connection of the sensor attached to ground     * TRIG connection of the sensor attached to digital pin 2     * ECHO connection of the sensor attached to digital pin 4  */    /*  This is a radar ping sensor that calcultates the speed of an  object traveling away or towards the sensor. I took some of this  code for the HC-SR04 Sensor implementation by Tautvidas Sipavicius. The rest  is original code from me. I know that the seven segment display  code is not the best to look at or the most optimized but it  serves its purpose just fine and is easy to understand.    Written by Matthew Ladd  */   const int trigPin = 2; const int echoPin = 4;   void setup() {   // initialize serial communication:   Serial.begin(9600);   //First 7 segment (ones place)   pinMode(30,OUTPUT);//F   pinMode(31,OUTPUT);//G   pinMode(32,OUTPUT);//E   pinMode(33,OUTPUT);//D   pinMode(34,OUTPUT);//C   pinMode(35,OUTPUT);//B   pinMode(36,OUTPUT);//A   //Second 7 segment (tens place)   pinMode(37,OUTPUT);//F   pinMode(38,OUTPUT);//G   pinMode(39,OUTPUT);//E   pinMode(40,OUTPUT);//D   pinMode(41,OUTPUT);//C   pinMode(42,OUTPUT);//B   pinMode(43,OUTPUT);//A } void zerofirst(){   digitalWrite(30,LOW);   digitalWrite(31,HIGH);   digitalWrite(32,LOW);   digitalWrite(33,LOW);   digitalWrite(34,LOW);   digitalWrite(35,LOW);   digitalWrite(36,LOW); } void onefirst(){   digitalWrite(30,HIGH);   digitalWrite(31,HIGH);   digitalWrite(32,HIGH);   digitalWrite(33,HIGH);   digitalWrite(34,LOW);   digitalWrite(35,LOW);   digitalWrite(36,HIGH); } void twofirst(){   digitalWrite(30,HIGH);//F   digitalWrite(31,LOW);//G   digitalWrite(32,LOW);//E   digitalWrite(33,LOW);//D   digitalWrite(34,HIGH);//C   digitalWrite(35,LOW);//B   digitalWrite(36,LOW);//A } void threefirst(){   digitalWrite(30,HIGH);//F   digitalWrite(31,LOW);//G   digitalWrite(32,HIGH);//E   digitalWrite(33,LOW);//D   digitalWrite(34,LOW);//C   digitalWrite(35,LOW);//B   digitalWrite(36,LOW);//A } void fourfirst(){   digitalWrite(30,LOW);//F   digitalWrite(31,LOW);//G   digitalWrite(32,HIGH);//E   digitalWrite(33,HIGH);//D   digitalWrite(34,LOW);//C   digitalWrite(35,LOW);//B   digitalWrite(36,HIGH);//A } void fivefirst(){   digitalWrite(30,LOW);//F   digitalWrite(31,LOW);//G   digitalWrite(32,HIGH);//E   digitalWrite(33,LOW);//D   digitalWrite(34,LOW);//C   digitalWrite(35,HIGH);//B   digitalWrite(36,LOW);//A } void sixfirst(){   digitalWrite(30,LOW);//F   digitalWrite(31,LOW);//G   digitalWrite(32,LOW);//E   digitalWrite(33,LOW);//D   digitalWrite(34,LOW);//C   digitalWrite(35,HIGH);//B   digitalWrite(36,LOW);//A } void sevenfirst(){   digitalWrite(30,HIGH);//F   digitalWrite(31,HIGH);//G   digitalWrite(32,HIGH);//E   digitalWrite(33,HIGH);//D   digitalWrite(34,LOW);//C   digitalWrite(35,LOW);//B   digitalWrite(36,LOW);//A } void eightfirst(){   digitalWrite(30,LOW);//F   digitalWrite(31,LOW);//G   digitalWrite(32,LOW);//E   digitalWrite(33,LOW);//D   digitalWrite(34,LOW);//C   digitalWrite(35,LOW);//B   digitalWrite(36,LOW);//A } void ninefirst(){   digitalWrite(30,LOW);//F   digitalWrite(31,LOW);//G   digitalWrite(32,HIGH);//E   digitalWrite(33,HIGH);//D   digitalWrite(34,LOW);//C   digitalWrite(35,LOW);//B   digitalWrite(36,LOW);//A } void zerosecond(){   digitalWrite(37,LOW);   digitalWrite(38,HIGH);   digitalWrite(39,LOW);   digitalWrite(40,LOW);   digitalWrite(41,LOW);   digitalWrite(42,LOW);   digitalWrite(43,LOW); } void onesecond(){   digitalWrite(37,HIGH);   digitalWrite(38,HIGH);   digitalWrite(39,HIGH);   digitalWrite(40,HIGH);   digitalWrite(41,LOW);   digitalWrite(42,LOW);   digitalWrite(43,HIGH); } void twosecond(){   digitalWrite(37,HIGH);//F   digitalWrite(38,LOW);//G   digitalWrite(39,LOW);//E   digitalWrite(40,LOW);//D   digitalWrite(41,HIGH);//C   digitalWrite(42,LOW);//B   digitalWrite(43,LOW);//A } void threesecond(){   digitalWrite(37,HIGH);//F   digitalWrite(38,LOW);//G   digitalWrite(39,HIGH);//E   digitalWrite(40,LOW);//D   digitalWrite(41,LOW);//C   digitalWrite(42,LOW);//B   digitalWrite(43,LOW);//A } void foursecond(){   digitalWrite(37,LOW);//F   digitalWrite(38,LOW);//G   digitalWrite(39,HIGH);//E   digitalWrite(40,HIGH);//D   digitalWrite(41,LOW);//C   digitalWrite(42,LOW);//B   digitalWrite(43,HIGH);//A } void fivesecond(){   digitalWrite(37,LOW);//F   digitalWrite(38,LOW);//G   digitalWrite(39,HIGH);//E   digitalWrite(40,LOW);//D   digitalWrite(41,LOW);//C   digitalWrite(42,HIGH);//B   digitalWrite(43,LOW);//A } void sixsecond(){   digitalWrite(37,LOW);//F   digitalWrite(38,LOW);//G   digitalWrite(39,LOW);//E   digitalWrite(40,LOW);//D   digitalWrite(41,LOW);//C   digitalWrite(42,HIGH);//B   digitalWrite(43,LOW);//A } void sevensecond(){   digitalWrite(37,HIGH);//F   digitalWrite(38,HIGH);//G   digitalWrite(39,HIGH);//E   digitalWrite(40,HIGH);//D   digitalWrite(41,LOW);//C   digitalWrite(42,LOW);//B   digitalWrite(43,LOW);//A } void eightsecond(){   digitalWrite(37,LOW);//F   digitalWrite(38,LOW);//G   digitalWrite(39,LOW);//E   digitalWrite(40,LOW);//D   digitalWrite(41,LOW);//C   digitalWrite(42,LOW);//B   digitalWrite(43,LOW);//A } void ninesecond(){   digitalWrite(37,LOW);//F   digitalWrite(38,LOW);//G   digitalWrite(39,HIGH);//E   digitalWrite(40,HIGH);//D   digitalWrite(41,LOW);//C   digitalWrite(42,LOW);//B   digitalWrite(43,LOW);//A } long distanceOverTime(long first,long second){  return ((first-second)/.1)*.0223693629;//taking cm/s to mph } long holder;//store the cm from last time through loop. long temp;//used to store the speed value after changes int counter; void loop() {   // establish variables for duration of the ping,   // and the distance result in inches and centimeters:   long duration, inches, cm;   int tens;   int ones;   long Speed;   // The sensor is triggered by a HIGH pulse of 10 or more microseconds.   // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:   pinMode(trigPin, OUTPUT);   digitalWrite(trigPin, LOW);   delayMicroseconds(2);   digitalWrite(trigPin, HIGH);   delayMicroseconds(10);   digitalWrite(trigPin, LOW);     // Read the signal from the sensor: a HIGH pulse whose   // duration is the time (in microseconds) from the sending   // of the ping to the reception of its echo off of an object.   pinMode(echoPin, INPUT);   duration = pulseIn(echoPin, HIGH);     // convert the time into a distance   inches = microsecondsToInches(duration);   cm = microsecondsToCentimeters(duration);   Speed=distanceOverTime(holder,cm);   holder=cm;//after speed caclulation so take the cm value for another calculation   Speed=abs(Speed);   if(Speed!=0 || counter==10){     temp=Speed;     counter=0;   }else{     counter++;   }   if(temp>=100){    zerofirst();    zerosecond();   }else{     ones=temp%10;     tens=temp/10;   }   if(ones == 0){     zerofirst();   }else if(ones==1){     onefirst();   }else if(ones==2){     twofirst();   }else if(ones==3){     threefirst();   }else if(ones==4){     fourfirst();   }else if(ones==5){     fivefirst();   }else if(ones==6){     sixfirst();   }else if(ones==7){     sevenfirst();   }else if(ones==8){     eightfirst();   }else if(ones==9){     ninefirst();   }   if(tens == 0){     zerosecond();   }else if(tens==1){     onesecond();   }else if(tens==2){     twosecond();   }else if(tens==3){     threesecond();   }else if(tens==4){     foursecond();   }else if(tens==5){     fivesecond();   }else if(tens==6){     sixsecond();   }else if(tens==7){     sevensecond();   }else if(tens==8){     eightsecond();   }else if(tens==9){     ninesecond();   }       Serial.print(inches);   Serial.print(" in, ");   Serial.print(cm);   Serial.print(" cm, ");   Serial.print(Speed);   Serial.print(" mph");   Serial.println();     delay(100); }   long microsecondsToInches(long microseconds) {   // According to Parallax's datasheet for the PING))), there are   // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per   // second).  This gives the distance travelled by the ping, outbound   // and return, so we divide by 2 to get the distance of the obstacle.   // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf   return microseconds / 74 / 2; }   long microsecondsToCentimeters(long microseconds) {   // The speed of sound is 340 m/s or 29 microseconds per centimeter.   // The ping travels out and back, so to find the distance of the   // object we take half of the distance travelled.   return microseconds / 29 / 2; } again, all your help and thought are appricated

Topic by herb1977 1 year ago  |  last reply 1 year ago


How would I make a sensor sense motion coming at me from behind while I'm moving forward?

I'm trying to make a small sensor that would detect a large object coming at me from behind at about 60mph while I'm moving forward at around 7mph. What kind of sensor would I use? I looked up the different types and I found Passive/active infrared, optic-based, piezoelectric, and ultrasonic. I tried to figure it out myself and my best guess is ultrasonic? Like what cars use to detect deer, they use "ultrasonic airflow sensors". Ideally the sensor would beep and get louder or faster as the object approaches. Would I use an arduino? I'm very new at this :/ Thanks for any help!

Topic by arrowstation 3 years ago  |  last reply 3 years ago


Ultrasonic sensor controled directly from arduino?

I'm on a time crunch for a project, and I want to have distance sensing.  Unfortunatealy, i dont have enough time to get stuff shipped, nor the budget to use radioshack.  I was wondering if I can use a single pieze transducer without premade circuitry, and control it from an arduino.  I have some transistors, some common ICs (386, 555, etc), and basic passive components, plus two arduino UNOs (one with a broken FTDI adapter) can it be done? I don't need an  exact, continuous, or scaling measurment, just one that gives me an idea of the distance/presence of an object. 

Question by jduffy54 6 years ago  |  last reply 6 years ago


Arduino ultrasonic sensor activating servo movement?

I am building a rc car as part of a pretty big project that has a bunch of other stuff on it . But one thing I can't figure out, being I'm only slightly familiar with arduino (UNO), is how to make a servo move when the sensor tells it to. I am going to attach a hook on the front to lift up an object so I can transport it. Now what I want to do is have the sensor detect the object when it is close enough to the hook (3-4") and then tell the servo to move a given degrees, around 25, just enough to pick it up. I've been toying with the code for the obstacle detecting robots trying to see if I cant modify that for this type of use but a lot of that code is backup commands, alternate routes and all that other stuff. just need a simple detect object, send signal to servo and servo moves the hook to pick the object up. Thanks  

Question by dmegill 5 years ago  |  last reply 5 years ago


Modify the ultrasonic range finder sensor - your opinion ???

Hi ... I would like to know your opinion about this ultrasonic range finder sensor. I bought this "JCB ultrasonic distance measurer". I bought it for it's ability to measure up to 18m. I tried it ... and happy with the distance ... BUT ... a realised few issues (for me). 1. I think, it use 2 pulses to make the measurement. It's like ... Tuk - Tuk ... end then cca 1 sek is the result. 2. when I move ... it will NOT tell me the results ... probably, because of those 2 impulses - I think, the device is comparing those two TUK TUK ... and if there is a difference, it tells me ERROR. How ever ... my question is ... if I would take out just the sensor, do you think, I could make it to run only with one TUK - to be faster ... and do you think, then I could make measurements while moving ??? (just to show me the actual distance ???) I would like to make something like the arduino PING sensor ... but with greater distance. EDIT : I forgot to mention, that I want to use it with Arduino ... I don't need the device to work on its own. I would just like to know, if the sensor on its own (taken out of this device) + arduino could measuring by movement and with the same distance (max 18m) ??? Looking forward to your opinions. Thank you. zholy

Question by zholy 9 years ago  |  last reply 8 years ago


Is an ultrasonic transducer for measuring liquid levels... capable of being used for an ultrasonic cleaning transducer? Answered

I am working on something I know nothing about. I have a transducer (from a liquid level sensor) and an ultrasonic generator... can I make an ultrasonic cleaner with it or is the transducer the wrong type?

Question by bellinghammakerspace 9 years ago  |  last reply 9 years ago


does anyone know any how to`s on how to connect a picaxe 20m to a SRF005 ultrasonic range sensor? Answered

I want to connect an ultrasonic rangefinder to my robot and my robots brain is a picaxe 20m so i need a way of interfacing it with a picaxe 20m , im pretty sure it`s an ADC input so if anyone knows an adc to cm converter i would be very grateful!!! thanks in advance if anyone answers this!!! cm

Question by thecookiemonster 9 years ago  |  last reply 9 years ago


<5mm distance sensing, <100micron accuracy, GUI, RasPi or Arduino?

Hi there, I am trying to keep my hardware/ coding skills alive and spruce up my bicycle wheel truing stand. I need to figure out the required hardware + software for the following: I want to build a non-contact distance measurement sensor system and get the output "into" my computer for display in a graphical user interface. I know I could omit the latter step with going directly onto a mini-LCD screen, but trying to use this a learn-another-programming-language learning experience (I've coded Matlab galore, pondering Python for this project). General system components: Sensor - [something - RasPi or Arduino I guess] - laptop (running debian) - GUI displaying continuous sensor reading Sensor: I've web-searched the hell out of this, but not finding anything quite answering my questions. I want to continuously measure the distance from the sensor to a bicycle wheel rim braking surface. Material is aluminium, shiny, though not smooth. Biggest problem with the web-search is being swamped by proximity sensor results (on/off) rather than a distance proportional output signal and much lower resolution projects. I rule out IR or optical sensing, now stuck between ultrasonic and inductive sensing, though tending to the latter for a faster response/adjustment to change time. Sensor criteria (other than reasonable $$): - total sensing range: ca.5mm - sensing accuracy 10 to 100micron/ 0.01 to 0.1mm - don't ask if that's needed, a bit of overkill, I know, but a bit of OCD doesn't do any harm, eh? - fast-ish sampling rate (so that when I turn the wheel, the number on the screen updates nice and fast, guess >25Hz is sufficient). [Something - RasPi or Arduino]: I know that I could omit the laptop GUI part (mini-LCD, LED array, etc), but keen to learn/ practice a little Python with this project, so I guess I am tending to the RasPi, but I am open minded. All I want is the analogue sensor out to end up as a digital reading "inside" my computer to be passed to my GUI as a reading. Essentially a mini A2D converter. Not fussed whether the output is in actual distance units or in arbitrary units/ current units (I guess the sensors put out a proportional current signal?). GUI: Depending on the above, how do I best get the signal "into" a Python program? A moderate fast sample rate >25Hz should suffice.  Any help with this would be greatly appreciated! LaserCycle

Topic by lasercycle 4 years ago  |  last reply 2 years ago


SENSOR- Ultrasonic HC-SR04 (Interfacing HC-SR04 with 8051)

Hi friends, I am doing a project based on obstacle detector. It is a outdoor project hence i choose to buy an ultrasonic sensor to work efficiently on both bright sun light as well as dark nights. Now my problem is i am not able to interface this sensor with my controller. Anyone please tell me what input i must give to trig input of that sensor and what kind of output i get form the echo pin. also tell me how can i interface this sensor with the AT89S52. i have attached the user manual which i downloaded from internet.  Please help me with your valuable comments, Thanks in advance.

Topic by knachuthan 4 years ago  |  last reply 3 years ago


What components would be needed to build an ultrasonic thickness gauge to measure paint the thickness of paint coatings?

I need an ultrasonic thickness gauge, they work by sending a pulse through the material being measured (paint in this case). When the pulse strikes a denser material it returns to the sensor, the delay from the time of the pulse being sent to being received gives the depth. I anyone knows the components that would be needed, or ideally, a set of schematics could you be so kind as to help me out. Thank you.

Question by alkem 9 years ago  |  last reply 9 years ago


How to make an Ultrasonic Proximity Sensor w/ Vibrating motor?

Ok so I want to use something like http://www.parallax.com/Store/Sensors/ObjectDetection/tabid/176/ProductID/92/List/1/Default.aspx?SortField=ProductName,ProductName and http://tinyurl.com/cxlp8jz to create a small system that vibrates when an object is in the way of the detector. To elaborate, Something like https://www.instructables.com/id/Make-an-Attiny13-based-IR-proximity-sensor-for-2/ but using an ultrasonic sensor(for farther range) and a vibrating motor instead of an LED because I am looking to make something for the blind. So how would I build it? I can purchase any parts and just need some instructions like the project above provided. Thanks a lot for any help you can provide. Also , If I need to use a Raspberry Pi, I have one. My Skills? My skills are limited. I know how to solder and work with PCBs, But I do not know how to code a microprocessor. I know that I'd hook it up to an arduino to code it but I can't code. If someone can tell me where to solder the parts and give me a code, I'll be able to do it. Thanks alot for your reply. If someone does this for me, I would be very grateful and might even make some donations to you. :) So to summarize, I need code to program a microprocessor to make a vibrating motor vibrate when the PING senses an object. I also need some sort of a schematic. I will be very grateful and will be sure to give you acknowledgements when I do my project.

Topic by hackery21 6 years ago  |  last reply 5 years ago


Selection of presence sensor

Hi guys. For one of my university projects I need to detect the presence of a person in the shower. In order to do that what I have in mind is use a proximity sensor. If the target is in a distance range (let's say 20 to 50 cm) It will assume that the person is in the shower when the distance measure is no longer in this range then it will mean that the person left the shower. I need to detect all the time of the person in the shower (meaning when he/she gets in and then out). I have read a lot of info and forums to properly choose the type of sensor. However I still don't have a clear answer. About the Ultrasonic proximity sensors I know that they are cheap and more accurate by it can be affected by Temperature, humidity and some ambient noise, all of them which happen in a shower. The other option an Infrared one gets affected by lightning conditions and the surface of the target. The last option I checked is a PIR sensor I know it senses Temperature of the target, but I don't know if it will be affected by the running hot water and also is more expensive. In general, I don't know how the running hot water will affect the detection of the person in shower. Also,so again I don't know how this will work. Sorry for the huge amount of  questions, I am a little bit confuse with all the factors to have in mind. I am hoping someone out there can help a lost newbie like me and give me a suggestion. Thanks a lot :)

Topic by mcamiea 2 years ago  |  last reply 2 years ago


Controlling 9 Micro Servos with Arduino & Ultrasonic Sensor

Hello! I'm new to Arduino and trying to build a series of moving cogs attached to micro servos, which are triggered by an Arduino controlled Ultrasonic Sensor. My code so far looks like this #include #define trigPin 12 #define echoPin 13 #define CONNECTED_SERVOS 9 // macro just adds two - the first servo is attached to digital pin 2, this gives us upto 12 servos - digital 2 to 13 #define SERVO_TO_PIN(x) (x+2) Servo myServos[CONNECTED_SERVOS]; Servo myservo; void setup() {   Serial.begin (9600);     pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);     // attach the servos   for(int nServo = 0;nServo < CONNECTED_SERVOS;nServo++)   {     myServos[nServo].attach(SERVO_TO_PIN(nServo));   }    } void loop() { int duration, distance,pos=0,i;   digitalWrite(trigPin, LOW);    delayMicroseconds(2);   digitalWrite(trigPin, HIGH);   delayMicroseconds(10);   digitalWrite(trigPin, LOW);   duration = pulseIn(echoPin, HIGH);   distance = (duration/2) / 29.1;    Serial.print(distance);    Serial.println(" cm");   for(int nServo = 0;nServo < CONNECTED_SERVOS;nServo++)   {     if (distance >0 && distance < 30)   {      myServos[nServo].write(180);   }   else{     myServos[nServo].write(180);   }      }          But it isn't really the code that I am having a problem with. I know that I need an external power supply for the 9 servos but I am having difficulty figuring out what is best. I have tried attaching a 9V battery to the power and ground lines of the servos and it hasn't quite supplied enough, only making them move a little when i get closer to the distance sensor, then jittering about a bit before completely stopping. I have got a Switching Power Supply plug that has an output of 12V which I can use and plug directly into the Arduino? I also have voltage regulators that have an output of 5V available. Could somebody recommend how to wire these supplies up for the servos? Any help would be much appreciated!  Thanks

Topic by j_olo 4 years ago  |  last reply 4 years ago


Back that Arduino Up

Hello instructables, I am a student at High Tech High North County and we are working with arduinos in our Engineering class. Our project is to create a reverse sensor for a motor vehicle, we are having trouble finding a way to set up the sensor with the arduino. The sensor we are using is HC-SR04 Ultrasonic Ping range sensor. If you have any idea on how to do this, please reply. Thanks.

Topic by hthnc-student 6 years ago  |  last reply 6 years ago


Adruino cyclone dust sensor

I am looking for suggestions for building a wood chip / dust level detector for the collection can of a cyclone vacuum. I have tried using uv detectors, they get covered in fine dust and become in-effective.  I am thinking of using the ultrasonic sensor. My objective is to detect the level of chips and dust collected in the debris can, and sounding an alarm when the can gets to the full point. Any help on this subject would be appreciated.  I am new to working with these Adruino controllers and not real familiar with writing the Sketches for this. Thanks Don

Topic by Don D 1 year ago  |  last reply 1 year ago


Can you tell me the code for arduino robot that has HC-SR04 Ultrasonic sensor , L293D , IR receiver module and remote?

It is a arduino obstacle avoiding robot , that has arduino uno R3 , L293D motor driver , HC-SR04 ultrasonic sensor , IR remote and receiver module on 2wD chassis.

Question by KodakH1 1 year ago  |  last reply 1 year ago


How would I go about changing the frequency of the analogWrite() function in Arduino?

I am designing an ultrasonic parking sensor, and need to use the analogWrite() function to produce a 50% duty cycle PWM. I would ordinarily use the tone() function in this situation however, this is currently tied up with something else and noTone() cannot be called. The problem I am having is with the default frequency of the analogWrite() function aliasing occurs with my reading on the ultrasonic sensor and I receive values that are a factor of ten off what they should be. I have tested the sensor at a range of frequencies and it appears to work best at about 50 Hz. Any help would be greatly appreciated.

Question by Pash1987 7 years ago  |  last reply 7 years ago


how can i modify the circuit by replacing the LED and photo diode by using ultrasonic sensor? Answered

Please for any one who is capable of drawing a schematic diagram on how i can modify, and use ultrasonic sensor  as a transmitter and receiver for my circuit to work well. also i want it to operate without using micro-controller. 

Question by YallajevoM 1 year ago  |  last reply 1 year ago


How can I make a Burglar alarm using ultrasonic sensor with a microcontroller Zilog Z8? Answered

We were asked to construct  a burglar alarm using ultrasonic sensor with a micro controller Zilog Z8. It's our requirement for the Final term this semester. We also have difficulties in our documentation because it is in thesis format. I know that somebody can help us from Instructables. We definitely need documents so we can have ideas to be included in our documentation. Thank you so much. God bless. ^^,

Question by AljonSalvatore 6 years ago  |  last reply 6 years ago


Distance between two electronic systems sensor for the Arduino

Hello. I've been thinking about this for months and haven't figured out how to do it... Don't be frightened by the wall of text, it's a VERY entertaining read! You'll fall down laughing! ______________ The basics: Imagine two systems: A and B. Both A and B use the Arduino as their "heart". I want A and B to know, at all times, the distance between them. The distance is 3-dimensional, ie, it doesn't matter if A is in front of B, if A is on top of B, etc. The distance ranges from about 10cm to 2m. It's not that strict, though. Something around that... The final project (which is not the sensor; the sensor is just a piece of it, just like the Arduino or an LED or a resistor) is a gift, so it has to be 'good-looking'. Because of that, the sensor has to be as inconspicuous as possible. Problem 1: Linear solutions can't be used, like Infrared LEDs or Ultrasonds. Besides being too linear (which makes sensing in 3 dimensions too hard and expensive because of the use of arrays of LEDs or sound generators), the only way (that I came up with) they could be used is this (because it can't be based on reflections): 1- A emits signal (IR modulation or Ultrasonic frequence) and starts timer (microcontroller function). 2- B receives signal. B waits 2 milliseconds. B emits signal (different from the signal emitted by A, so they don't get messed up). 3- A receives signal and stops the timer. A then calculates the distance through a simple formula. That's how A would know the distance between itself and B. B would do exactly the same thing to know the distance between itself and A, but with signals different from those used by A (so they wouldn't get messed up). This is infeasible because: Using IR, every millisecond (the smallest unit of time a general microcontroller can measure) is equivalent to 30,000,000cm (or 300,000km or 186,400 miles). Using sound, every millisecond is equivalent to 34cm (or 13.4 inches). With such a short distance range (10cm to 2m), 34cm is too much, which makes the sensor incredibly inaccurate. Problem 2: Using the sensor with the Arduino The sensor would have to output something to let the Arduino know the distance so that I could then do stuff like: If distance is between 0 and 20cm, do this. If distance is between 21 and 50cm, do that. If distance is 51 and 200cm, do that. Else do nothing. etc. :) Problem 3: It has to be simple (and cheap) I'm no programmer nor do I know a lot about electronics. I'm a simple hobbyist with the dream to finish this project, so it can't be overly complex. :) So, after reading this wall of text, what do you think I could use? Do you know any wireless technology that lets me do this? Oh, sorry about claiming it would be a fun read.. It was the only way I found to make you ACTUALLY read this. :p THANK YOU! :D

Question by pedrotome 9 years ago  |  last reply 4 years ago


Ultrasound 3D positioning

How would you use an array of ultrasonic sensors to determine the 3d position of an ultrasonic transmitter. Basically i want an ultrasound transmitter on my hand that gets picked up on an array of 5 or so receivers that outputs the position via usb.

Topic by redshirtdeath 8 years ago  |  last reply 8 years ago


NEED HELP WITH CODING

Hello i would like to know if you guys could help with a code to make a servo reacts to an ultrasonic sensor. The way it would work is that when an object gets close to the sensor for example 2 inches, then the servo goes from 0 degrees to 135 degrees, then wait 5 seconds and go back to original position ( 0 degrees). i was thinking of using loop. something like . loop if  sensor is close to 2 inch then servo goes from 0 to 135 degrees then delay 5 seconds and go back from 135 to 0 degrees else do nothing end if end loop

Topic by tech20151 3 years ago  |  last reply 3 years ago


What is the program code for arduino obstacle avoiding robot it has IR remote and receiver module with HC-SR04 sensor?

It has HC-SR04 ultrasonic sensor , arduino uno R3, L293D motor driver , and Infrared remote and Infrared receiver module.

Question by KodakH1 1 year ago  |  last reply 1 year ago


logging ESP8266 data of(BMP180+DHT22+Ublox GPS Neo 6m +hc04 ultrasonic sensor)

Hi instructables , i'm just starter in this filed i just need Sketch for logging ESP8266 data of(BMP180+DHT22+Ublox GPS Neo 6m +hc04 ultrasonic sensor) all data in separeted files  i found in Net GPS neo logging but for the authers no ..please if someone can help me i will be very thankful 

Topic by Slash09 2 years ago  |  last reply 2 years ago



Does anyone know how to build a robot water sprayer using arduino?

If the robot detecting a plant using an ultrasonic sensor, then it will spray a water.

Question by Temarie 3 years ago  |  last reply 3 years ago


arduino code nedded

HI, MY  NAME IS THIAGO IKEDA AND HERE IS MY FIRST "ASK" my english is VERY bad. well sorry anyway FIRST  i made this arduino tank (named ardutank) with ladyada motor shield and i used library and worked then i like WOW I SUPER GENIUS so i buy an HC-SR04(ULTRASONIC SENSOR) to put with ARDUTANK, and i used the library too but when i upload the code the ARDUTANK START make some wild noises. i dont know what to do to ARDUTANK work with the sensor obs: in first mode (with out ultrasonic sensor) one motor spins more fast than other, WHY? the bouth motors are the same motor. but when i put to HIM to RUN HE make lil curve. here is code WITH SENSOR PLEASE IGNORE THE RELE AND BUZER NEXT TO SENSOR // Adafruit Motor shield library // copyright Adafruit Industries LLC, 2009 // this code is public domain, enjoy! #include #include #define TRIGGER_PIN  12 #define ECHO_PIN     13 int distance; Ultrasonic ultrasonic(TRIGGER_PIN, ECHO_PIN); AF_DCMotor motor1(1); AF_DCMotor motor2(2); void setup() {   Serial.begin(9600);           // set up Serial library at 9600 bps   Serial.println("Motor test!");   // turn on motor   delay(10);   motor1.setSpeed(20);   motor2.setSpeed(20); motor2.run(RELEASE);   motor1.run(RELEASE); } void loop() {   uint8_t i;   float cmMsec, inMsec;   long microsec = ultrasonic.timing();   cmMsec = ultrasonic.convert(microsec, Ultrasonic::CM);   inMsec = ultrasonic.convert(microsec, Ultrasonic::IN);   Serial.print("tick");   motor1.run(FORWARD);   motor2.run(FORWARD);   if(distance<10) {    motor1.run(RELEASE);    motor2.run(RELEASE); } else {    motor1.run(FORWARD);   motor2.run(FORWARD); } }

Question by crazy_thiago 5 years ago  |  last reply 5 years ago


Sub-mm precision ultrasonic or inductive distance sensor for use with Raspberry Pi?

Hi there, I am trying to keep my hardware/ coding skills alive and spruce up my bicycle wheel truing stand. I need to figure out the required hardware + software for the following: I want to build a non-contact distance measurement sensor system and get the output "into" my computer for display in a graphical user interface. I know I could omit the latter step with going directly onto a mini-LCD screen, but trying to use this a learn-another-programming-language learning experience (I've coded Matlab galore, pondering Python for this project). General system components: Sensor - [something - RasPi or Arduino I guess] - laptop (running debian) - GUI displaying continuous sensor reading Sensor: I've web-searched the hell out of this, but not finding anything quite answering my questions. I want to continuously measure the distance from the sensor to a bicycle wheel rim braking surface. Material is aluminium, shiny, though not smooth. Biggest problem with the web-search is being swamped by proximity sensor results (on/off) rather than a distance proportional output signal and much lower resolution projects. I rule out IR or optical sensing, now stuck between ultrasonic and inductive sensing, though tending to the latter for a faster response/adjustment to change time. Sensor criteria (other than reasonable $$): - total sensing range: ca.5mm - sensing accuracy 10 to 100micron/ 0.01 to 0.1mm - don't ask if that's needed, a bit of overkill, I know, but a bit of OCD doesn't do any harm, eh? - fast-ish sampling rate (so that when I turn the wheel, the number on the screen updates nice and fast, guess >25Hz is sufficient). [Something - RasPi or Arduino]: I know that I could omit the laptop GUI part (mini-LCD, LED array, etc), but keen to learn/ practice a little Python with this project, so I guess I am tending to the RasPi, but I am open minded. All I want is the analogue sensor out to end up as a digital reading "inside" my computer to be passed to my GUI as a reading. Essentially a mini A2D converter. Not fussed whether the output is in actual distance units or in arbitrary units/ current units (I guess the sensors put out a proportional current signal?). GUI: Depending on the above, how do I best get the signal "into" a Python program? A moderate fast sample rate >25Hz should suffice. Any help with this would be greatly appreciated!

Question by lasercycle 4 years ago  |  last reply 4 years ago


i want make robot car

I have arduino uno , arduino motor shield ultrasonic sensor ,2 dcmotors? PLS Can any one help me>>>>>>programmind arduino

Question by omar elkady 6 years ago  |  last reply 6 years ago


Sonic data transmission?

This is just an idle thought, but I was reading a couple of ROV builds, and the one thing they all have in common is a tether - it's a fact of the world that very little in the way of radio signal can penetrate water. So... Could you send control signals to an ROV via sound or ultrasound?  Could beeps and clicks carry enough data, far enough, and clearly enough, to control an ROV? Even more fun, how much data could come back? Sensor readings? Images? Just throwing it out there for you to toy with, but it would be fun to have genuinely-remote control for this class of robot.

Topic by Kiteman 3 years ago  |  last reply 3 years ago


Audio frequency and signal strength sensor: is there such thing?

Hi, I'd like to know if there's a sensor easily used with an Arduino that detects the signal strength of a sound of frequency determined by me. I want this to make a sensor that can be used to measure its distance to the emitting object omni-directionally, ie, not like ultrasonic or IR distance sensors, which only sense what's in front of them. I want the sensor to sense the SPACE AROUND it, like... spherically. If you know of a sensor that does that in another way, I'd LOVE to hear about it. I've been searching for something like that for a long time... Anyway, I just need a sensor - cheap, preferably :) - that senses the signal strength of a wave of frequency x. By the way, the distance range to be measured is about 10 - 150cm... Thanks!

Question by pedrotome 8 years ago  |  last reply 8 years ago


i need a arduino program that will allow my servo to scan and my wheels to drive...PLEASE HELP!!!!?

I have two continuous rotational servos (Parallex) that are used as my wheels.Another servo is connected to my srf 05 sensor (ultrasonic range finder sensor). I just need a program that will allow my wheels to drive and my sensor to detect walls...please help!! =-(I can answer additional questions if im unclear.

Question by znunez 10 years ago  |  last reply 10 years ago


security system (not responding after combining ultrasonic sensor code and esp8266 code )

The base of this project is https://www.instructables.com/id/SIMPLE-ARDUINO-ULTRASONIC-SENSOR-DOOR-ALARM-/ &http;://randomnerdtutorials.com/door-status-monitor-using-the-esp8266/ I changed according to my uses from above links I tryed by dividing into two parts one for ultrasonic sensor and other for esp8266 they worked fine while separating ultrasonic and buzzer are working in (Tools and wifi module is working in onlt(Tools when i mix ultrasonic and buzzer nothing happening) any idea here is the code #include #include #include #include #define USE_SERIAL Serial #define trigPin 9 #define echoPin 10 #define piezoPin 8 ESP8266WiFiMulti WiFiMulti; int normalDistance; boolean triggered = false; long duration, distance; void setup() {   USE_SERIAL.begin(115200);   pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);   pinMode(piezoPin, OUTPUT);   long duration, distance; while (millis() < 5000) {   digitalWrite(piezoPin, HIGH);       digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2;         normalDistance = distance;       USE_SERIAL.print("Distance: "); USE_SERIAL.println(distance);         digitalWrite(piezoPin, LOW);    for(uint8_t t = 4; t > 0; t--) {         USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);         USE_SERIAL.flush();         delay(1000); } WiFiMulti.addAP("username", "pass"); } } void loop() { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2; USE_SERIAL.print("Distance: "); USE_SERIAL.println(distance); if (distance < normalDistance-5) {       triggered = true;     }     else {         triggered = false;     }     if (triggered) {     tone(piezoPin, 635);     delay(500);     tone(piezoPin, 912);     delay(250);     if((WiFiMulti.run() == WL_CONNECTED)) {         HTTPClient http;         USE_SERIAL.print("[HTTP] begin...\n");                 http.begin("iftt link.........................."); //HTTP         USE_SERIAL.print("[HTTP] GET...\n");         // start connection and send HTTP header         int httpCode = http.GET();         // httpCode will be negative on error         if(httpCode > 0) {             // HTTP header has been send and Server response header has been handled             USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);             // file found at server             if(httpCode == HTTP_CODE_OK) {                 String payload = http.getString();                 USE_SERIAL.println(payload);             }         } else {             USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());         }         http.end();     }     } } any idea about whats going on Thanks Hemanth

Topic by hemanth kumar reddy 2 years ago  |  last reply 2 years ago


PRICE??

I live in India. I am interested in electronics and robotics. I built a Light following robot at low cost. I want to know cost of some electronic parts in India. Th electronic parts are   arduino uno, micro servo, HCSR04 ultrasonic sensor and QRD1114 reflective sensor. I am making plans for my new robot, so i want to calculate the total cost.

Question by makesomeso 5 years ago  |  last reply 5 years ago


uli lab stations

i have some vernier corperation uli lab iterfaces for sale with sensores and some documentation but no software i only have a few so there first come first serve. if anyone on here has access to the sofware or knows of some free software that will work it would be much apprishiated. im thinking about $30 US plus s&h; for the whole set sensors and all . this includes the interface and cables what documentation i have and the fallowing sensors. Heart rate, ultrasonic motion detector, magnetic field detector, mic/amplifier module, regular and fast response temp probes, and a force probe

Topic by juggalo_assassin183 8 years ago  |  last reply 7 years ago


No sensory input on a motor shield?? Answered

Hello, I recently acquired a seeed motor shield http://www.seeedstudio.com/depot/motor-shield-p-913.html But what i notice now is that there is nowhere to attach my Sr04 ultrasonic sensor! How do I include sensory input on my robot with this shield? Thanks bunches. 

Question by TheIronHobo 5 years ago  |  last reply 5 years ago


How do you build an arduino radar?

Hi Everyone, I saw on youtube that you can make an arduino radar using a ping ultrasonic sensor, an arduino, and a processing sketch. I have successfully gotten the ping sensor to rotate (180 degrees) on a servo and report the distance to the computer via the serial monitor but I need help converting it to a radar interface using processing. Can anyone help me write a processing sketch that would do it. Thanks in advance, Mr_E

Question by Mr_Electric 7 years ago  |  last reply 7 years ago


POWERING SERVOS and other modules

Can you guys help me pls.I don't know how to power servos.My projects use an ultrasonic sensor with a few servos.when i try to power it up only 1 module that works.Can i power the servos using a different power source?like a power bank

Topic by Alexander heron the inventor 2 years ago  |  last reply 2 years ago