The 2nd experiment using an Infrared LED and Sensor to detect inputs on a Raspberry Pi, this time using interrupts in Python 3 with much faster / more reliable detection.
Interrupts are interesting because it allows the Pi to carry on with 1 program while waiting for a real-time trigger to tell it to do something else immediately. It works until it is **interrupted** to perform a higher priority task.
A relatively simple python program allows you to power the LED and use the photodiode to detect any interruption of the IR beam. Can be used for counting, detection of objects, location of moving parts, etc.
MATERIALS
- IR photodiode
- IR LED
- 330 ohm resistor x2
- 1M ohm resistor
- Jumpers
- Breadboard
- Pi
WARNING: Warning: mis-wiring or mis-programming your Pi or miswiring of accessories can ruin the Pi and accessories.
Information/drawings offered as is. Use at your own risk. If you don’t know, learn first.
RASPBERRY PI EXPERIMENTS
Experiment 1 – Blink LED
Experiment 2 – Stoplight / Traffic-light
Experiment 3 – Massive Power Control
Experiment 4 – Polling to Detect Input
Experiment 5 – Interrupts to Detect Input
Experiment 6 – Counter
Experiment 7 – Tachometer (Beta)
Experiment 7x – Laser Morse Code Transmitter
Experiment 08 – Chronograph / Timer
Experiment 09 – Ultrasonic Distance Measurement
Experiment 10 – Ultrasonic High Accuracy Distance Measurement
Experiment 11 – Ultrasonic Velocity & Speed Measurement
Experiment 12 – Raspberry Pi Ultrasonic Accelerometer – 12 (FAIL)
https://www.youtube.com/edit?video_id=GZS3lKiZN7A
Experiment 13 – The Speed of Pi – How Fast Are The GPIO Ports?
Experiment 14 – Raspberry Pi Stepper Motor 1
Experiment 15 – Analog to Digital Converter (I2C-ADS)
Experiment 15.1 – 8 Channel Upgrade to A2D Converter Software
Experiment 16 – In Progress…
Experiment 17 – Experiment on RFI & The RPi – Does RFI Cause Inconsistent Readings?
Experiment 18a – Part 1/2: Stepper Motor using DRV8825 driver board
Experiment 18b – Part 2/2: Stepper Motor using DRV8825 driver board
Experiment 18-1 Pre-Programmed Stepper Motor Control
Post time: Aug-31-2017