- two PIRs - SEN120A2B
- EL Wires in blue (TEM03036B), red (TEM03016B), green (TEM03046B) and yellow (TEM03026B)
- and the EL Shield (SLD10262P) with an EL Inverter (POW10301P)
The EL Wires are very easily connected to the EL Shield. The same with the EL Inverter which converts 5V DC to 110V AC for the EL Wires.Only the PIRs need some soldering for this project. I've also added three LEDs to show the PIR and running status.
The two PIRs detect
- the direction in which the object moves (from left->right or right->left)
- and the speed
When the left PIR detects something before the right PIR detects it, then the object is moving from left to right. The time (in milliseconds) between these recognition points is the object moving speed. Depending on this speed (milliSecondsPerMeter) the start time of light 1 can be calculated and also the end time of light 4, and the time for light 2 and 3.
The Code
I've extended the PIR example code on arduino.cc to handle two PIRs and the running session. The code for the EL Shield is as simple as the Arduino Blink example, you only have to set the pinMode and use digitalWrite to turn the EL Wire on or off.In idle mode all four lights are turned on. In the running session all light are turned off and the first light starts, then turns off and the second turns on, and so one. At the end all lights are turned on again. To get into the running session both PIRs have to recognized the moving object.
I've uploaded the implementation on github : el_shield.ino
... and this is the first result:
PS: more images and videos of this project are here available.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.