December 1, 2012

EL Shield Project - Idea And Code

This is the idea of the project as an image ... everything is available from Seeed Studio:

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:

This is a nice project, which Seeed Studio made available with the EL Shield give away. The code needs some adjustment, e.g. on the left side there's a tree (don't worry I will not chop it off) and the object recognition is later than on the right side.

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.