1 / 27

Connecting a Sensor to a Computer

Catherine Mui Mike Harmon Fan Li. Connecting a Sensor to a Computer. November 9, 2010 ELEC 443-03 Dr. S. Grenquist. Parameters. Find an analog sensor Interface the sensor with the computer Get it done as soon as possible!. Types of Sensors. Photocell Thermocouple

damon
Télécharger la présentation

Connecting a Sensor to a Computer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Catherine Mui Mike Harmon Fan Li Connecting a Sensor to a Computer November 9, 2010 ELEC 443-03 Dr.S. Grenquist

  2. Parameters • Find an analog sensor • Interface the sensor with the computer • Get it done as soon as possible!

  3. Types of Sensors • Photocell • Thermocouple • Pressure sensor • Photodiode • Thermistor • Infrared sensor

  4. Photoresistor • Varying resistor dependent on light intensity • Made of high resistance semiconductor • Photons absorbed from the light give bound electrons energy to move to the conduction band • Free electrons increase current flow • Decreased resistance

  5. Developing the circuit Use a voltage divider to vary the output voltage Figure 1 – Increased light increases voltage output. An analog output is produced due to the varying resistance of the photoresistor Figure 2 – Increased light decreases voltage output.

  6. The choice In the brightest setting: In the darkest setting:

  7. The Problem • Computers use digital logic • Unable to instantaneously read a varying voltage output Therefore, we must develop a way to convert the output to a digital signal

  8. The options • Microcontroller • Write code to convert analog signal to digital signal • DAQ – Data Acquisition Unit • Built-in analog to digital converter • ADC Chip – Analog to Digital Conversion Chip • Construct a circuit • Comparator

  9. Voltage comparator • Uses the 741 op-amp • The analog waveform is compared to the DC voltage supply • When the analog signal is larger than the DC voltage, the circuit outputs a HIGH • If lower, the output is a LOW

  10. The 741 op-amp Pin Connections Not Connected DC voltage supply Voltage output from voltage divider Ground Not Connected Output +9V Not Connected

  11. Obtaining the dc reference voltage • Want to use only one voltage source to supply the voltage across the photoresistor and to supply the reference DC voltage • Parallel input to a second voltage divider

  12. Testing the circuit • What is the critical resistance between a high and low output? 4.5V  • Example: In the lighting of the electrical lab, • < 10kΩ Low Output

  13. The circuit

  14. Making the connection • Microcontrollers • Able to transmit information to the computer through a USB connection • Texas Instrument: MSP430 (16 Bits) • Atmel AVR (8-bit) • AVR32 (32-bit) • BasicX • Ardiuno • Parallax

  15. Parallax Microcontroller • Complex device, however we barely got into its capabilities • Only used as interface between voltage output and computer • 3 pins used: • Relays information through USB port

  16. Install the USB Drivers

  17. Basic Stamp Software Download • Go on the Parallax website • http://www.parallax.com/tabid/441/Default.aspx • Click on Download on the top right corner

  18. Basic Stamp • Click Save, when the file download shows up. • Install the software and wait for it to setup.

  19. Basic Stamp • Once the software has been download. • Click Run • BASIC STAMP Editor screen • Click Next

  20. BASIC STAMP • Starting Window • You can write the programming code in the white space provided.

  21. Programming Code ' {$STAMP BS2}' {$PBASIC 2.0}Main:DO DIR0 = 0IF IN0 = 1 THEN PrintitIF IN0 = 0 THEN Printit1Printit:DEBUG HOME, "No Light On“PAUSE 100GOTO MainPrintit1:DEBUG HOME, "Light Is On"PAUSE 100GOTO Main

  22. EquIpment • Photoresistor • 3 10kΩ resistors • 741 Op-amp • Breadboard • 9 Volt battery • Wires • Parallax microcontroller • BASIC stamp editor v2.5

  23. Budget

  24. Applications • A circuit like this can be used for devices that should be turned on when lighting is minimal • e.g. Street lights

  25. References • http://itp.nyu.edu/physcomp/Labs/Components • http://en.wikipedia.org/wiki/Photoresistor • http://www.cybercollege.com/tvp008.htm • http://www.nteinc.com/specs/2000to2099/pdf/nte2053.pdf • http://www.ferret.com.au/c/Firetail-DAQ/New-USB-counter-timer-modules-available-from-Firetail-DAQ-n817104 • http://www.tmworld.com/article/323379-Create_short_pulses_with_a_function_generator.php • http://pixdaus.com/single.php?id=138442

  26. THANK YOU FOR LISTENING! QUESTIONS?

More Related