Embedded Programming and Robotics Lesson 8 Light Sensors and Temperature/Humidity Light Sensors1.

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Potential Dividers You will be familiar with the use of a variable resistor to vary current.
Encoders, Motors, Power, Mini Project #1 10/24/2014.
Lesson 4: Breathing Monitors. Breathing Monitors In the past 3 classes, we’ve learned – How to write to a digital pin – How to read the value of a digital.
Automatic Delivery Machine ME 3484 Group 2 Li Jiang Jia Cong Li Kun Hei Fong.
Curry Mouse EE296 Final Presentation Wednesday, May 10, 2006.
Embedded Programming and Robotics
Embedded Programming and Robotics Lesson 1 Basic Electricity and Electronics Transistor Basics Lesson 1 -- Basic Electricity1.
Microprocessors Tutorial 2: Arduino Robotics
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics Lesson 6 Mechanical Assembly 1.
Embedded Programming and Robotics Introduction and Overview Presented by John Cole Senior Lecturer in Computer Science The University of Texas at Dallas,
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Embedded Programming and Robotics
Embedded Programming and Robotics Lesson 10 Ultrasonic Range Finder Range Finder1.
Embedded Programming and Robotics Lesson 5 Motor Control 1.
Image of Arduino. Arduino discussion Address issues with circuit walk-through – Electricity, Programming, Arduino Concepts Work on BeatTable (next week)
FUN WITH COOL KIT. Kit Purpose Have fun assembling and programming a simple robot – Includes chassis, wheels, motors, motor driver, IR sensor and arduino.
Week 10 Today 1.Homework presentations and critique. 2.Review digital and analog inputs. 3.DIY - jumpers, soldering etc.
Recoded. Significance of programming Digitalised era- phones, computers, industrial processes… Raspberry programming device Exploration of the concept.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
ENGR 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program Solar Energy Meter.
MTI FALL 2010 By: Rohan Sharma Mini Project Documentation: Bacterial Growth Monitor.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
WALL FOLLOWING ROBOT USING I-BOT mini V3
Smart Plant Robot Prepared by Haya De’bas Jumanah Salhab Supervisor Dr. Ra’ed Al-Qadi.
Created by: James Buttice Intelligent Machine Design Laboratory Dr. Arroyo Dr. Schwartz 4/8 Spring 2010 B.L.a.R.R.
1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.
Today’s Agenda 1.Scribbler Program Assignment 1.Project idea due next class 2.Program demonstration due Wednesday, June 3 2.Attendance & lab pair groupings.
Shaojie Ge Special Sensor System  My special sensor system is the walk mechanism of my robot. Since my robot is a walking robot with four legs.
SECURITY ALARM Done by RINKESH KURKURE.  This project serves as a detecting mechanism to indicate the presence of an object or person in undetected cases.
ALL TERRAIN ROBOT 1 Wilmer Arellano. The Client’s Need  Verbally presented at class time.  Modify the All Terrain Manual Robot into an autonomous Gripper.
Microprocessors Tutorial 2: Arduino Robotics. Agenda 1. Robot Anatomy 2. Sensor Review 3. PWM 4. MAKE: Fade 5. Motors 6. H Bridge 7. Robot Control library.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
PHY 235 Robotics Workshop Day 4 Robotic Behaviors, Light Sensing, Voltage Dividers, LCD-MOD.
ROBOTIC ARM 2 Wilmer Arellano © Hardware  Next slide shows sensor connection to analog pin 0 and Motor 1 connection. Lecture is licensed under.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
Embedded Programming and Robotics Lesson 11 Arduino Interrupts 1.
Robot Project by Ahmad Shtaiyat Supervised by Dr. Salem Al-Agtash.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Electronic instrumentation Digitization of Analog Signal in TD
2-POINT PERSPECTIVE. Exercise: Follow the next steps in order to create a box in a 2-point perspective.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Python with Raspberry PI Kit
Arduino Setup & Flexing the ExBow
Controlling Servos with the Arduino
Assist. Prof. Rassim Suliyev - SDU 2017
Arduino - Introduction
Arduino Uno and sensors
Electrical Engineer Responsibilities
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Analog Input through POT
Internet-of-Things (IoT)
How a Breadboard Works Teacher Notes: This picture depicts the connections on a breadboard. A breadboard is a device used to make simple electrical connections.
Dave Mawdsley, DACS Member, Linux SIG January 16, 2013
Secret Door Knock Detector
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Electricity and Circuits
Compiled from various Internet sources Presented by Mr. Hatfield
Python with Raspberry PI Kit
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
CTY SAR FCPS Alexander Velikanov
Presentation transcript:

Embedded Programming and Robotics Lesson 8 Light Sensors and Temperature/Humidity Light Sensors1

Analog Devices These next two devices are by nature analog You get a voltage that is the analog of some physical quantity, such as light intensity, temperature, or humidity Light Sensors2

Light-Dependent Resistors The LDR changes its resistance depending upon the level of light falling upon it The more light, the lower the resistance We can’t measure resistance directly, but we can measure the voltage drop caused by resistance Light Sensors3

Light-Dependent Resistors Basic circuit: The resistor shown can be any value from 15K to 20K You’ll get readings on A0 that range from 10 in near- darkness to 900 in bright light Light Sensors4

Light-Dependent Resistors You must use one of the analog pins Code to read this: #define LIGHT A0 int light = analogRead(LIGHT); Light Sensors5

Light-Dependent Resistors Connect up the circuit as shown Determine the reading using the serial monitor Cover the LDR and see what reading you get You can use the multimeter to see the “raw” readings of resistance in varying light levels Light Sensors6

Robot that Hides from Light Add three light sensors to the front of your robot, spaced at intervals, one pointing straight ahead and the other two at about a 15-degree angle from straight ahead You may need to put cardboard or paper between the sensors so each one operates independently Write a program that reads the light level from all three and turns in the direction with the lowest reading until the levels are within about 20 of each other, then goes forward Light Sensors7

Temperature and Humidity The DHT11 is a small sensor that reads both temperature and humidity You can get the library here: DHT11Lib DHT11Lib Light Sensors8

Temperature and Humidity Connect V cc to +5 Connect ground Connect signal (pin 2 on the DHT) to pin 2 on the Arduino Pin 3 is not used Light Sensors9

Temperature and Humidity The DHT11 is slow It can take up to 250 milliseconds to get a reading of temperature or humidity The value can be up to 2 seconds old Not very useful for quick response Temperature is in degrees Celsius as integers, thus not very accurate Humidity is relative, as a percentage 0 to 100 Light Sensors10

Temperature and Humidity In your code, you’ll need the following lines: #include #define DHTPIN 2 The following creates a DHT object: dht DHT; You don’t need to do anything in the setup() function Light Sensors11

Temperature and Humidity You can determine that the DHT11 is online: int result = DHT.read11(DHTPIN); if (result == DHTLIB_OK) Serial.println(“DHT sensor ok”); Light Sensors12

Temperature and Humidity Read the temperature: float temp = DHT.temperature; Read the humidity: float humidity = DHT.humidity; Light Sensors13

Programming Exercise Write a program that reads the temperature at four different places in the room and reports back to the Pi, using Bluetooth You may have the robot move for 10 seconds, stop and read, then turn a little, move, etc. This works best in a room that gets some sun, so you may not get much difference Light Sensors14

Infrared Sensor The infrared sensor (not the passive infrared motion detector) gives you proximity information similar to the range finder It has a fairly short range Light Sensors15

Infrared Sensor Test the sensor: Place the sensor on the breadboard and connect Vcc and ground Connect A0 to an analog pin, say A6 Write a program to read the value using analogRead an show it on the serial monitor Light Sensors16

Mechanical Assembly Having done that, you’ll need to modify your robot. Since the sensor needs to point down, and it needs to be ahead of and outside of the wheels, you can use two pieces of cardboard to make “wings” for your robot Attach the wings using tape. Make sure they’re reasonably rigid. Make sure the wings are at least 5 cm outside of the wheels and at least 15 cm in front of the chassis Light Sensors17

Mechanical Assembly Attach an IR sensor to each wing, pointing down Make sure they’re approximately the same distance from the top of the table Use male-to-female jumpers to connect it to the board Light Sensors18

Coding Hints Use #define to define the left and right sensors. No guessing that A6 is left and A7 is right Define a function that controls the motors and parameterize it Do not have analogWrite function calls inline Light Sensors19

Programming Exercise Write an edge-follower program thus: The robot will move in a straight line as long as neither sensor detects an edge You detect an edge by “seeing” nothing in the sensor If the robot detects an edge on the left, it moves right If it detects an edge on the right, it moves left If both sensors detect edges (a cliff) have it move side to side until it can move in a safe direction Light Sensors20

Programming Exercise The test for this exercise is for your robot to go all the way around a square table in both directions Caution: It is easy to have your robot overcompensate for detecting an edge; don’t do this Light Sensors21