Ardumotive Arduino Greek Playground
  • Home
    • About us
    • Contact
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

Sharp IR Sensor (GP2Y0A41SK0F)

Available Languages
Picture
Picture

Introduction 

Picture
In this tutorial we will use the Sharp IR sensor (GP2Y0A41SK0F) to measure distance from an object. 

​IR Sensors work by using a specific light sensor to detect a select light wavelength in the Infra-Red (IR) spectrum. By using an LED which produces light at the same wavelength as what the sensor is looking for, you can look at the intensity of the received light. When an object is close to the sensor, the light from the LED bounces off the object and into the light sensor. This results in a large jump in the intensity, which we already know can be detected using a threshold.

Since the sensor works by looking for reflected light, it is possible to have a sensor that can return the value of the reflected light. This type of sensor can then be used to measure how "bright" the object is. This is useful for tasks like line tracking.

In this tutorial we will try to measure the distance from an object (4~30cm).

​Let's get started!

What you will need - Hardware

For this tutorial you will need:
  • Arduino uno
  • Sharp IR Sensor (GP2Y0A41SK0F)
  • 3 cables

The Circuit

Ardumotive Tutorial - Arduino Shake Vibration Sensor

The code using Codebender

​Here's the code, embedded using Codebender!
Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board. And that's it, you've programmed your Arduino with this sketch!
You can keep playing with that by clicking the "Edit" button and start making your own modifications to the code.

Press connect button below to start serial communication.

Well done!

You have successfully completed one more "How to" tutorial and you learned how to use the Sharp IR sensor with Arduino.

I hope you liked this, let me know in the comments!
Picture

Search Engine

Picture

Licence 

Picture

Help us to grow up!

Picture


Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates