Laser module with TinkerPie
Laser tripwires with a light sensor. Never point it at eyes.
| Type | Outputs and actuators |
|---|---|
| Connect to | any accessory pin |
| Gives | a red dot |
| Simulator | Yes: a control appears under the simulated board |
How it works
The laser module makes a narrow beam of red light (about 650 nm) that stays thin over a long distance. Shining it on a light sensor makes a tripwire: when someone breaks the beam, the light level drops.
How to wire it
Signal pin to S1-S4 or P10-P13. Motors, pumps and lamps always go through the relay or a driver module, never straight to a pin.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
outputs.laser(Pin.S1, true)
// Arduino C++
outputs::laser(Pin::S1, true) Good to know
- It is low power, but any laser can hurt eyes: never point it at people, pets or mirrors.
- Fix both the laser and the sensor firmly so the beam stays aligned.
- Any accessory pin switches it on and off.
Similar modules
- Relay module
- LED module
- Traffic light module
- Active buzzer module
- DC fan / motor module (with transistor)
- 16-channel servo driver PCA9685
More projects to try
Questions
Can I try the Laser module without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
How do I make a laser tripwire?
Point the laser at an LDR across a doorway. When the light reading drops suddenly, someone has broken the beam, so sound the alarm. See the Laser tripwire project.