Page 1 of 1

IR Infrared Obstacle Avoidance Sensor (HCSENS0006)

Posted: Fri Mar 04, 2016 4:31 pm
by admin
Image

Transmitter and receiver in one photoelectric sensor. The sensor has an adjustable detection distance and visible light interference. It is easy to use and is ideal for panel mounting.
We also stock a bracket, which is perfect for easy mounting of the sensor (HCSENS0007) and also allows easy mounting to one of our robot smart cars.

Electrical Characteristics:
Supply Voltage: 5VDC
Supply Current: The 100mA
Range: 3-80CM

Size: 17mm x 45mm
Lead Length: 45cm

Wire colour codes:
BRN = 5V
BLU = GND
BLK = OUT

Output:
High = triggered

LED:
On when not triggered


Setup instructions:
With nothing obstructing the sensor adjust the multi-turn screw at rear of sensor until the LED switches from off to on. The sensor should then be calibrated for its current environment.


PLEASE NOTE: As this is an infra-red sensor it can be affected external sources of infra-red light such as sunlight.

Maximum range will be affected be environmental conditions and reflectiveness of sensed object

You can order this module here




Example Arduino Sketch::

  1. /* FILE:    Obstacle_Avoidance_Sensor_Example
  2.    DATE:    12/07/20
  3.    VERSION: 1.0
  4.  
  5. This is a simple example of how to use the Hobby Components obstacle avoidance
  6. sensor module (HCSENS0006).
  7.  
  8. The sensor accepts a GND and +5V supply, and has a single digital output
  9. which goes high (5V) when an object is in range of the sensor.
  10.  
  11. This example sketch will simply output a message to the UART when it
  12. senses this pin going high.
  13.  
  14. SENSOR PINOUT:
  15. Blue:     GND
  16. Brown:  +5V
  17. Black:   Digital pin 2
  18.  
  19. You may copy, alter and reuse this code in any way you like, but please leave
  20. reference to HobbyComponents.com in your comments if you redistribute this code.
  21. This software may not be used directly for the purpose of selling products that
  22. directly compete with Hobby Components Ltd's own range of products.
  23.  
  24. THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
  25. EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  26. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
  27. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
  28. INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
  29. REASON WHATSOEVER.
  30.  
  31. */  
  32.                                  
  33. /* Select the input pin for the hall effect sensors output. */
  34. #define SENSOR_DIO 2      
  35.                                  
  36.  
  37.  
  38. /* Initialise serial and DIO */
  39. void setup()
  40. {
  41.   /* Setup the serial port for displaying the status of the sensor */
  42.   Serial.begin(9600);
  43.  
  44.   /* Configure the DIO pin which the sensors digital output will be connected to */
  45.   pinMode(SENSOR_DIO, INPUT);
  46. }
  47.  
  48.  
  49. /* Main program loop */
  50. void loop()
  51. {
  52.   /* Read the status of the sensors digital output and if it is high
  53.      then send an alert to the serial port */
  54.   if (digitalRead(SENSOR_DIO))
  55.   {
  56.     Serial.println("OBJECT DETECTED!");
  57.   }  
  58. }


Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.