Line Hunting Sensor Module (HCARDU0005)

Modules for various types of sensors including accelerometers. gyro's, IR motion, etc
Post Reply
admin
Site Admin
Posts: 867
Joined: Sun Aug 05, 2012 4:02 pm

Line Hunting Sensor Module (HCARDU0005)

Post by admin » Tue Nov 06, 2012 6:23 pm

Image

- Photosensitive diode
- Working power: + 5V
- Working current: < 10mA
- Working temperature range: 0'C 50'C
- Output electrical level signal: TTL
- Output interface: 3 wire
- Easy to install


PINOUT
PIN DESCRIPTION
1 GND
2 OUT
3 VCC (+5V)


Example Arduino Sketch:

Code: Select all

/* FILE:    ARD_Line_Hunting_Sensor_HCARDU0005_Example
   DATE:    03/07/12
   VERSION: 0.1

This is a simple example of how to use the Hobby Components line hunting sensor 
module (HCARDU0005). It is a very simple module that requires only one DIO
pin (defined as an input) to operate. When the sensor detects a reflective object 
in close proximity it will pull a DIO pin that it has been connected to LOW. A 
non reflective or no object in close proximity will cause the DIO pin to go high.

You may copy, alter and reuse this code in any way you like, but please leave 
reference to HobbyComponents.com in your comments if you redistribute this code. 
This software may not be used directly for the purpose of selling products that 
directly compete with Hobby Components Ltd's own range of products. 

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER 
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES, 
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY 
REASON WHATSOEVER.

*/


/* Define the DIO pin that will be used to communicate with the sensor */
#define LINEHUNTSENS_DIO 2

/* Initialise serial and DIO */
void setup()
{
  /* Setup the serial port for displaying the status of the sensor */
  Serial.begin(9600);
  
  /* Configure the DIO pin the sensor will be connected to as an input */
  pinMode(LINEHUNTSENS_DIO, INPUT); 
}


/* Main program loop */
void loop()
{
  /* If the DIO pin is pulled low then an object has been detected */
  if (!digitalRead(LINEHUNTSENS_DIO))
    Serial.println("Object detected !");
    
}

Post Reply

Return to “Sensors”