Presentation is loading. Please wait.

Presentation is loading. Please wait.

Material taken from Robotics with the Boe-Bot

Similar presentations


Presentation on theme: "Material taken from Robotics with the Boe-Bot"— Presentation transcript:

1 Material taken from Robotics with the Boe-Bot
Sensors Material taken from Robotics with the Boe-Bot

2 Where Are We Going? Sumo-Bot competitions

3 Devices that Contain Sensors
The boebot uses sensors to interact with its environment. There are a variety of sensors used for a variety of purposes: smoke, sound, rotation/tilt, vibration, orientation, temperature, humidity, pressure, proximity, distance, light, and so on.

4 Ultrasonic Distance Sensor
PING Ultrasonic Range Finder Parallax Tutorial PING ultrasonic distance sensor provides precise distance measurements from about 2 cm (0.8 inches) to 3 meters (3.3 yards). It works by transmitting an ultrasonic burst and providing an output pulse that corresponds to the time required for the burst echo to return to the sensor. By measuring the echo pulse width the distance to target can easily be calculated.

5 Theory of Operation The PING sensor emits a short ultrasonic burst and then "listens" for the echo. Under control of a host microcontroller (trigger pulse), the sensor emits a short 40 kHz (ultrasonic) burst. This burst travels through the air at about 1130 feet per second, hits an object and then bounces back to the sensor. The PING sensor provides an output pulse to the host that will terminate when the echo is detected, hence the width of this pulse corresponds to the distance to the target.

6 Limited Detection Range

7 Simple to Connect

8 Programs Code---Without Library Support With the NewPing library
#include <NewPing.h> int PingPin = 9; int maxDistance = 5 * 12 * 2.54; // max sonar range in cm NewPing sonar(PingPin, PingPin, maxDistance);; void setup() { Serial.begin(9600); } void loop() { delay(50); int location = sonar.ping_in(); Serial.print("Ping: "); Serial.print(location); Serial.println(” in");

9 QTI Line Sensor

10 How it Works The QTI is a reflective object sensor. There’s an infrared LED behind its clear window and an infrared phototransistor behind its black window. When the infrared light emitted by the LED reflects off a surface and returns to the black window, it strikes the infrared phototransistor’s base, causing it to conduct current. The more infrared incident on the phototransistor’s base, the more current it conducts.

11 Like an RC Circuit

12 Code for Testing QTIs int LeftQTI = 8; int RightQTI = 2;
void setup() { Serial.begin(9600); } void loop() { long tLeft = rcTime(LeftQTI); long tRight = rcTime(RightQTI); Serial.print("tLeft = "); Serial.print(tLeft); Serial.println(" us"); Serial.print("tRight = "); Serial.print(tRight); Serial.println(" us"); delay(1000); long rcTime(int pin) { // ..returns decay time pinMode(pin, OUTPUT); // Charge capacitor digitalWrite(pin, HIGH); // ..by setting pin ouput-high delay(1); // ..for 5 ms pinMode(pin, INPUT); // Set pin to input digitalWrite(pin, LOW); // ..with no pullup long time = micros(); // Mark the time while(digitalRead(pin)); // Wait for voltage < threshold time = micros() - time; // Calculate decay time return time; // Return decay time

13 Code for Detecting Reflection
Customizing the code: Assign names to the pins Use multiple QTI sensors More?

14 Simple Connections

15 Mount the QTI sensor close to the ground


Download ppt "Material taken from Robotics with the Boe-Bot"

Similar presentations


Ads by Google