This project shows you how easy it is to use Raspberry Pi® hardware for sending signals to a motion sensor and controlling an external LED. It uses Simulink, and requires the free support package for Raspberry Pi hardware, which you can download here.
Using the step-by-step instructions and downloadable code, you’ll be able to create a Simulink model that reads the output of a motion sensor and performs a series of actions based on the motion it detects. For instance, you could use a passive infra-red (PIR) motion sensor from Parallax® to measure changes in infrared heat levels that nearby objects emit. When an object or person passes in front of the PIR sensor, the sensor sends a high signal to its output pin.
The example uses these hardware support blocks:
- GPIO Read block to read digital logic levels output by an external device
- GPIO Write block to output logic high or low values to control external devices
- LED block to turn an on-board LED on or off
- eSpeak Text to Speech block for synthesizing speech
For a step-by-step tutorial and to download code visit: http://www.mathworks.com/examples/simulink/4305-motion-sensor