Chapter 7: Measuring Light

Slides:



Advertisements
Similar presentations
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Advertisements

Chapter 6: Digital Display
Chapter 3: Digital Inputs - Pushbuttons
1 Chapter 8: Frequency and Sound Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
1 Chapter 9: Electronic Building Blocks Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
4/22/ MAKING YOUR ROBOTS SEE Building and Testing Photosensitive eyes.
1 Chapter 2: Light on- Lights off Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
1 Chapter 7: Measuring Light Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Boe-bots and STEM Boe-bots and STEM – This sectional will introduce participants to a programmable robot that is useful for engaging students in building.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
1 Chapter 4: Controlling Motion Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
ENGR 101: Robotics Lecture 2 – Text Programming Outline  Introduction to PBASIC  Variables, I/O, Arithmetic  Controlling the LEDs References 
Input and Output Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale
1 Chapter 5: Measuring Rotation Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
Sensors Material taken from Robotics with the Boe-Bot.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
1 Chapter 4: Hitachi HM55B Compass Module Smart Sensors and Applications Chapter 4: Hitachi HM55B Compass Module Presented by: Andy Lindsay Parallax, Inc.
Parallax BASIC Stamp® Tutorial
1 Chapter 8: Frequency and Sound Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Jessica.
1 Chapter 3: Tilt with the Memsic Dual-Axis Accelerometer Smart Sensors and Applications Chapter 3: Tilt with the Memsic Dual-Axis Accelerometer Presented.
1 Chapter 1: Parallax Serial LCD Display Smart Sensors and Applications Chapter 1: Parallax Serial LCD Display Presented by: Andy Lindsay Parallax, Inc.
1 A Modification of Chapters 5 & 7 Slides Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by:
Slide 1 Presentation based on: “Robotics: with the Boe-Bot" by Andy Lindsay Menlo Drive Suite 100 Rocklin, CA
1 Chapter 6: More Accelerometer Projects Chapter 7: LCD Bar Graphs for Distance and Tilt Smart Sensors and Applications Chapter 6: More Accelerometer Projects.
1 With the Parallax USB Oscilloscope Understanding Signals With the Parallax USB Oscilloscope Presented by: Andy Lindsay Parallax, Inc.
Programming the CheapBot-14. Start the Editor Set the Mode.
1 Chapter 6: Light Sensitive Navigation With Photoresistors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation.
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Slide 1 IR Remote for the Boe-Bot IR Remote for the Boe-Bot.
Slide 1 IR Remote for the Boe-Bot IR Remote for the Boe-Bot.
Sensors Material taken from Robotics with the Boe-Bot.
1 Chapters 2 And 3 Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel Southern.
1 “Something to put it in perspective…” Slide Show Name “Something to put it in perspective…” Presented by: Andy Lindsay Parallax, Inc.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
Changing Databases This presentation gives a quick overview on how to change databases in Osprey.
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
1 Parallax BASIC Stamp ® Tutorial Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale.
Slide Menlo Drive Suite 100 Rocklin, CA
Slide 1 Chapter #7: Measuring Light Light Sensor Circuit Parts (1) (1)Resistor – 220 Ω (red-red-brown) (1) Capacitor – 0.1  F (1) Capacitor – 0.01  F.
PHY 235 Robotics Workshop Day 4 Robotic Behaviors, Light Sensing, Voltage Dividers, LCD-MOD.
ENGR 101: Robotics Lecture 6 – Follow That Light! Outline  The Scribbler's Light Sensors  Using EEPROM Memory References 
1 Chapter 5: Accelerometer Gaming Basics Smart Sensors and Applications Chapter 5: Accelerometer Gaming Basics Presented by: Andy Lindsay Parallax, Inc.
Slide Menlo Drive Suite 100 Rocklin, CA
Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Scrolling LCD using Arduino.
Chapter 8 Browsing and Searching the Web
GO! with Microsoft Office 2016
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Chapter 1: Getting Started
Chapter 1: Getting Started
DIGITAL CALCULATOR USING 8051
GO! with Microsoft Access 2016
Programming Boe-Bots (Part 1)
EET 2261 Unit 11 Controlling LCD and Keypad
Setup Of 4050 EIP To Control LOGIX PLC
Material taken from Robotics with the Boe-Bot
Chapter 5: Tactile Navigation With Whiskers
EET 2261 Unit 11 Controlling LCD and Keypad
Chapter 8: Frequency and Sound
Chapter 1: Getting Started
Chapter 5: Measuring Rotation
BEMS user Manual Fundación cartif.
HIBBs is a program of the Global Health Informatics Partnership Learning the Basics of Microsoft Word 2019 and Microsoft office support TFN
AN INEXPENSIVE ROBOTIC KIT FOR CHILDREN EDUCATION
Presentation transcript:

Chapter 7: Measuring Light Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel Southern Illinois University Carbondale College of Applied Sciences and Arts Electronic Systems Technologies 9/10/03

Presentation Index Use and Copyright Devices that Contain Light Sensors Introducing the Photoresistor Activity #1: Build & Test Light Meter Activity #2: Graphing Light Level Activity #3: Tracking Light Events Writing to EEPROM Reading From EEPROM Activity #4: Simple Light Meter Chapter #6 Review Links

Use and Copyright This presentation supplements "What's a Microcontroller" by Andy Lindsay. (Link to text at Parallax) This presentation is not a replacement for the text. Important concepts of the text are highlighted. In some cases, additional material has been added to augment the text. Denoted by titles colored gold. Full program listings are generally not provided in the presentation. Distribution: This presentation may be freely distributed without modifications. Modifications are permitted by schools and organizations for internal use only. Credits, use and copyright slides must remain.

COPYRIGHTS AND TRADEMARKS This documentation is Copyright 2003 by Parallax, Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax, Inc. Check with Parallax for approval prior to duplicating any of our documentation in part or whole for any use. BASIC Stamp is a registered trademark of Parallax, Inc. If you decide to use the name BASIC Stamp on your web page or in printed material, you must state that "BASIC Stamp is a registered trademark of Parallax, Inc." Other brand and product names are trademarks or registered trademarks of their respective holders. DISCLAIMER OF LIABILITY Parallax, Inc. and Southern Illinois University are not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, or any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products. Parallax is also not responsible for any personal damage, including that to life and health, resulting from use of any of our products. You take full responsibility for your BASIC Stamp application, no matter how life threatening it may be.

Devices that Contain Light Sensors Pushbuttons and dials are examples of pressure and rotation sensors, but there are a variety of sensors used for a variety of purposes: Temperature, smoke, tilt, vibration and so on. Light sensors are also a type used in a variety of applications: Automatic street lights TV remotes using Infrared (non-visible light). Camera flash and exposure controls

Introducing the Photoresistor While there are a variety of light sensors, a very popular one is the photoresistor in that it is easy to use and inexpensive. As the name implies, it is a resistor that reacts to light. The active ingredient Cadmium Sulfide (CdS) allows electrons to flow more easily when light energy hits it, thus lowering it resistance (opposition to current flow). The brighter the light the lower the resistance.

Just as with a carbon resistor, the photoresistor can be used with the BASIC Stamp in an RC circuit to obtain a value in relation to the amount of resistance, or in this case the amount of light hitting the sensor.

Activity #1: Build & Test Light Meter Just as with the RC Time circuits in Chapter 5, the capacitor is charged by the output (P2 in this case) and the time to discharge though the resistor is measured. In this case, as light level changes, discharge time will change.

What happens to the value of time as the light level changes What happens to the value of time as the light level changes? When is it lowest? Highest?

Activity #2: Graphing Light Level Monitoring of sensors is a need in industry to ensure systems are operating within specifications. Stamp Plot Lite is a PC-based graphing program for monitoring data graphically.

Using Stamp Plot Lite This image shows a plot of the light level. Note how the value increases from left to right then drops again suddenly? What do the values represent as far as light level?

StampPlot Lite may be installed from your CD or downloaded from Parallax's website. Winzip is required to extract and install the software.

Sending Measurements to Stamp Plot Values to be graphed are sent using DEBUG and the DEC formatter. All data and instructions sent to Stamp Plot must end in a carriage return (CR). For example, to plot the value of Time, the code would be: DEBUG DEC Time, CR

Stamp Plot may also be configured by sending control instructions instead of having to click the settings on the plot: DEBUG "!AMAX 1250", CR, "!TMAX 25", CR, "!TMIN 0", CR, "!SHFT ON", CR, "!RSET",CR

Load and run PlotPhotoresistor.bs2 Verify the output in the DEBUG Window is a single column of values: Note the COM port

Open Stamp Plot Lite MenuProgramStamp Plot Stamp Plot Lite Change the COM port to match the one from the DEBUG Window. Close the DEBUG Window. Only 1 applications can have access to the COM Port at anyone time.

Click Connect then Plot Data in Stamp Plot Lite. Press and release the Reset button on your HomeWork board to re-start your program to catch the DEBUG statements at the start of the program. The light level should now be plotting. Experiment with the Span and Time Span + and – buttons to adjust your plot.

Activity #3: Tracking Light Events Programs remain in memory even when power is removed because it resides in special type of memory, EEPROM (E-E-PROM).

The Memory Map (Click RunMemory Map) shows RAM usage for variables and EEPROM usage for the current program. Notice that programs are stored in EEPROM from bottom-up.

Writing to EEPROM BASIC Stamp programs can also use the EEPROM for data storage. WRITE Locations, {WORD} Data Item For example, to store the value of 195 in address location 7: WRITE 7, 195

To store values greater than 255, the Word parameter must be specified: WRITE 8, Word 659 WRITE 10, Word 50012 Note that location 9 is skipped because using Word required 2 bytes to hold the value.

StoreLightMeasurementsInEeprom.bs2 The StoreLightMeasurementsInEeprom program stored 30 measurements of light into EEPROM (from locations 0 to 58 with each taking 2 bytes).

Reading From EEPROM The READ instruction is used to read data from EEPROM: READ Location, {Word} Data Item Read a byte and save in byte variable littleRR: READ 7, littleRR Read a word value and store in Word variable eepromValueA: READ 8, Word eepromValueA

ReadLightMeasurementsFromEeprom.bs2 The ReadLightMeasurementsFromEeprom will read and display the values from EEPROM.

Activity #4: Simple Light Meter Simple light meter uses the 7-segment LED to indicate the light strength.

Using GOSUB A GOSUB is a branch to another section of the program defined by a label. Once complete, the execution returns to after the GOSUB call.

All subroutines called with a GOSUB MUST end with a RETURN. If GOSUBs and RETURNs are not properly matched, it can lead to improper operation of your BASIC Stamp program.

GOSUBs allow code to be re-used and makes coding cleaner by having the main DO…LOOP call subroutines to perform the various tasks of the program. From the main routine, you can get an idea of what the program will perform.

LightMeter.bs2 uses the principles of RCTIME with the Photoresistor and LOOKUP with the 7-segment display to create a light meter. By using a PAUSE length defined by the time value, LED segments will cycle at a speed dependent on light level.

Chapter #6 Review A photoresistor's __________ changes based on the amount of light. The _______ command is used to send values to Stamp Plot for plotting. Programs are stored to ________ memory. The _______ command stores data in the EEPROM. The _______ command reads data from EEPROM. The _______ command causes execution to branch to a subroutine. The _______ command must be used at the end of a subroutine.

Links BASIC Stamp Home Stamps In Class Home BASIC Stamp Software BASIC Stamp Robots BASIC Stamp Yahoo Group Stamps In Class Yahoo Group SIUC EST Degree StampPlot Lite Software