Author Topic: Arduino sharp 2YOA21 IR Sensor  (Read 4278 times)

0 Members and 1 Guest are viewing this topic.

Offline alm1909Topic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Arduino sharp 2YOA21 IR Sensor
« on: November 24, 2011, 01:50:50 PM »
Hi as part of my university project i am required to use the arduino board and the IR sensor to start video that would be projected when someone walks into a room. I was wondering if anyone knows how i can set the IR sensor and Arduino up so that the program on the mac could tell if there was motion through the sensor, kind of like an infra red switch that would start a video program on the mac. If anyone could help me it would be greatly appreciated.

Equipment i currently have:
• Sharp 2YOA21 IR Distance Sensor
• IR Distance Adaptor
• Arduino Board
• USB Connector
• Wires

If i require any other parts please tell me :)

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Arduino sharp 2YOA21 IR Sensor
« Reply #1 on: November 25, 2011, 01:35:54 AM »
Hi there.

You will need to write code for Arduino so that it keeps reading IR Sensor output, and if distance falls below threshold value, signal is sent via UART to USB (or Ethernet, or WiFi, or Bluetooth) port of Mac. Now, there will have to be second part of software, this time in Your Mac. That one should be waiting for signal from Arduino and start playing video when signal is received.
« Last Edit: November 25, 2011, 01:37:15 AM by newInRobotics »
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Arduino sharp 2YOA21 IR Sensor
« Reply #2 on: November 25, 2011, 07:51:11 AM »
Hi as part of my university project i am required to use the arduino board and the IR sensor to start video that would be projected when someone walks into a room.

Just curious, but was that particular IR sensor specified? If not it might be easier to use a passive IR sensor instead, such as http://www.sparkfun.com/products/8630

You can set the arduino up to to generate an external interrupt when the sensor alerts, and then put the arduino to sleep. When the sensor fires the arduino will wake up and do it's thing. Makes for longer battery life.

If it was specified then NIB's solution is the way to go.

Joe

 


Get Your Ad Here

data_list