Summary of Controlling a Servo with a PICAXE and an IR Sensor
This article explains building a finger-tracking device using a PICAXE microcontroller, IR LEDs, and an IR phototransistor. The system detects reflected infrared light to determine stimulus position, allowing the PICAXE to control a servo motor's rotation accordingly.Parts used in the Finger-Tracking Device:
- PICAXE microcontroller
- Infrared (IR) LEDs
- IR phototransistors
- Servo motor (Tower-Pro MG996R)
- BASIC programming language environment
Related Information
- Servo Motor Control with an Arduino
- Servo Control with Arduino Through MATLAB
- Servo Control via USB with the SAM4S Xplained Pro
- Control a Servo from Your PC with the Atmel SAM4S
What's a PICAXE?
PICAXEs are PIC microcontrollers that have been preloaded with a bootstrap code that allows programming in BASIC language. All About Circuits provides a series of articles that serve as a guide to choosing and using any of the chips in the PICAXE family. This article will provide an excellent starting point and will lead you to other articles in the series.
Project Overview
This project consists of building a circuit using common IR (infrared) LEDs to produce IR emissions and an IR phototransistor to detect reflected IR light. The voltage from the phototransistors varies with the intensity of the IR light received. A specially programmed PICAXE microcontroller converts this analog voltage to a digital format and stores it for comparison with the output from other IR phototransistors.
Based on the relative levels of the IR light, the PICAXE signals a servo motor to rotate to a predetermined position. Thus, reflected IR light can be used to control physical movements.
What's a Servo?
Servos, or more specifically servomotors, are electromechanical devices that consist of (1) an electric motor with an accessible output shaft, (2) a mechanism to determine the rotary position of the output shaft, and (3) electronic circuitry to receive control signals and position the output shaft accordingly.
One of the most familiar uses of small servos is to move the throttle and control surfaces of RC (radio control) airplanes. Servos are available in a variety of sizes, shapes, and capabilities. A servo suitable for use in this project is the Tower-Pro MG996R, two of which are shown in the photo below.
The MG996R servo operates on 4.8V to 7.2V, and can draw from 500 mA to almost a full ampere depending upon its load. The output shaft covers a range of 120 degrees (60 degrees each side of center.) For a more complete description, download and read the datasheet. A little on-line research will produce all the information you can imagine about servomotors.
For more detail: Controlling a Servo with a PICAXE and an IR Sensor
Quick Solutions to Questions related to Finger-Tracking Device:
-
What is a PICAXE?
PICAXEs are PIC microcontrollers preloaded with bootstrap code that allows programming in BASIC language. -
How does the project detect movement?
The circuit uses common IR LEDs to emit light and an IR phototransistor to detect reflected IR light intensity. -
Can a PICAXE convert analog signals?
Yes, the specially programmed PICAXE converts the analog voltage from the phototransistor into a digital format for comparison. -
What voltage range does the MG996R servo operate on?
The MG996R servo operates on a voltage range of 4.8V to 7.2V. -
How much current can the MG996R draw?
The servo can draw from 500 mA to almost a full ampere depending upon its load. -
What is the output shaft range of the MG996R?
The output shaft covers a range of 120 degrees, which is 60 degrees each side of center. -
What components make up a servomotor?
A servomotor consists of an electric motor with an accessible output shaft, a mechanism to determine rotary position, and electronic circuitry.
Related projects
Real-Time CAN-Based Vehicle Monitoring System with PIC MCU
INTRODUCTION The Controller Area Network (CAN) is a robust vehicle communication bus standard that was primarily developed for automobile applications but has...
Motors & RoboticsEasy Way to Learn Robotics Using Microcontrollers: A Beginner’s Guide
The title, "Easy Way to Learn Robotics Using Microcontrollers," promises an accessible entry point for those curious about the exciting world of...
Motors & Robotics · PIC16F877AEfficient Sun-Following Robot: A Solar Tracker with Microcontroller Control
Abstract The impending global challenge of dwindling non-renewable fuel resources underscores the urgency of transitioning towards renewable energy alternatives like solar power....
Motors & RoboticsInnovative Robotics: A Comprehensive Project Exploration
A DC motor functions as an electromechanical device, translating electrical signals into mechanical movements. The rotation of the motor correlates directly with...
Motors & RoboticsAdvanced Techniques for Fault Detection, Indication, and Protection in Induction Motors
1. INTRODUCTION The impact of microcontroller usage on our daily lives is remarkable. This versatile device is now prevalent in various control...
Motors & RoboticsExploring Versatility: GSM-Based Robotic Vehicle Technology
Introduction To Robotics The term 'Robot' remains elusive, defying a precise definition due to its evolving usage. Initially, it referred to humanoid...

