Arduino 5 Minute Tutorials: Lesson 4 - IR Distance Sensor & Push Button

@Milind You will need an IR sensor, a microcontroller, a motor controller, a motor and a power supply. To open a door, you might need a linear actuator. Start by learning how to get output from an IR sensor, then (separately) how to use a motor with a motor controller, and finally, put both together.

hi, is this the only required code to measure distance with IR sensor i.e. what pins to be declared. can u plz write the detailed code. also speed control using variable distance and delay can u write code on that. quite urgent !!

hey is this the complete code foor mesuring distance using IR i mean only one pin. and can u make code for speed control using distance and delay. speed= distance/delay

@shivam thaman More detailed code would be sensor / application specific. These tutorials are more general.

@shivam thaman It all depends on what distance sensor you use, its method of communication, the microcontroller you selected etc.

how can i connect 5 IR sensors to an avr microcontroller board? which avr microcontroller board should I use? plz help…

@Sushant Did you chose the sensors you want? Most IR distance sensors are analog, with a few exceptions, and most AVR chips have ADC input pins, so you should be fine; be sure to check the specs of both though.

hello anyone can help me for make complete sketch of 4 servo, 2 motor control with android Bluetooth app

@vishal Unfortunately creating custom code is beyond the scope of this article. We suggest creating a new topic on the Arduino Forum.

sir,can i use IR sensor and bluetooth modules at same time…

@VIMAL PANDIT Certainly.

can i connect IR sensor to other than analouge pin of arduino

@sidharth: Short answer: no. Long answer: There are some ways to do this. If you use an IR sensor that is digital in nature, you can connect it to a digital pin (instead of analogue). Also, you could use an external ADC board and connect that to your sensor instead of an ADC (analogue to digital converter) pin. But, in general, an analogue sensor (IR or otherwise) needs an analogue pin.

i want programme for control the solenoidal valve using ir sensor

@naveen You will need a microcontroller to read the IR sensor, and a relay (connected to a digital pin on the same microcontroller) to control the solenoid.

hello coleman benson, i have uploaded codings for an ir sensors in adruino , but the thing is that , can’t able to interface between hardware and with my laptop, but i have tried in many way, can,t able to find the solutions…can you give some point for this…

@kalyan You need serial output and use the Arduino serial terminal. You also need to set a baud rate and select that same baud rate in the serial terminal.

i wish to know how to interface ir sensor for object detection with arduino uno r3 to show parking condition on a display…do the sensor connect to analogue pins and lcd display to digital pins and if so can i get a code for that?

@NORMAN OSIEMO The sensor can connect to an analog pin, and the LCD can connect to the digital pins, but it depends on which models you choose. We do not know where to get custom code for an application like that, so you will need to learn how to code.

I have the SHARP IR sensor and would like to make it work as a distance sensor with a buzzer but my code is not completely right…
The buzzer does not beep slower when the obstacle is further away, can you help please? […]