Posts | Comments

Planet Arduino

Archive for the ‘Motion Detection’ Category

We’re still not sure exactly how [connornishijima]’s motion detector works, though many readers offered plausible explanations in the comments the last time we covered it. It works well enough, though, and he’s gone and doubled down on the Arduino way and bundled it up nicely into a library.

In the previous article we covered [connor] demonstrating the motion detector. Something about the way the ADC circuit for the Arduino is wired up makes it work. The least likely theory so far involves life force, or more specifically, the Force… from Star Wars. The most likely theories are arguing between capacitance and electrostatic charge.

Either way, it was reliable enough a phenomenon that he put the promised time in and wrote a library. There’s even documentation on the GitHub. To initialize the library simply tell it which analog pin is hooked up, what the local AC frequency is (so its noise can be filtered out), and a final value that tells the Arduino how long to average values before reporting an event.

It seems to work well and might be fun to play with or wow the younger hackers in your life with your wizarding magics.


Filed under: Arduino Hacks

It is likely that many of us will at some time have experimented with motion detectors. Our Arduinos, Raspberry Pis, Beaglebones or whatever will have been hooked up to ultrasonic or PIR boards which will have been queried for their view of what is in front of them.

[Connornishijima] has stumbled on a different way to detect motion with an Arduino, he’s polling an ADC pin with a simple length of twisted pair hooked up to it and earth, and reliably generating readings indicating when he (or his cat) is in its vicinity. He’s calling the effect “Capacitive turbulence”, and he’s open to suggestions as to its mechanism. He can only make it work on the Arduino, other boards with ADCs don’t cut it.

Frequent Hackaday featuree [Mitxela] may have also discovered something similar, and we’ve hesitated to write about it because we didn’t understand it, but now it’s becoming unavoidable.

It’s always dangerous in these situations to confidently state your opinion as “It must be…” without experimental investigation of your own. Those of us who initially scoffed at the idea of the Raspberry Pi 2 being light sensitive and later had to eat their words have particular cause to remember this. But this is an interesting effect that bears understanding. We would guess that the Arduino’s fairly high input impedance might make it sensitive to mains hum, if you did the same thing to an audio amplifier with a phono input you might well hear significant hum in the speaker as your hand approached the wire. It would be interesting to try the experiment at an off-grid cabin in the woods, in the absence of mains hum.

If you’d like to give his experiment a try, he’s posted his sketch on Pastebin. And he’s put up the video below the break demonstrating the effect in action, complete with cats.

We like to see people pushing the boundaries of what is possible with their microcontroller I/O lines, it furthers our collective knowledge as a community. We’ve seen people making  TV transmitters from ESP8266s, and not so long ago a Raspberry Pi ADC port as further examples. Please, keep them coming!


Filed under: Arduino Hacks, hardware

sotu_perf_headerNick Squires details his time spent using his maker skills to produce an interactive art installation and performance.

Read more on MAKE

The post Go Behind the Scenes of Installing an Interactive LED Art Exhibit appeared first on Make: DIY Projects and Ideas for Makers.

Bridge Passage,courtesy of Professor Tom Robbins, Architecture

Bridge Passage, photo courtesy of Professor Tom Robbins, Architecture

The bridge, “Passage” by L. Brower Hatcher at Columbus State, is one of the most outstanding and notable landmarks on campus. Connecting the main parking garage and Davidson Hall over Spring Street, the bridge offers safe passage above the fast moving one-way traffic below. Painted bright red, it also adds a strong visual contrast against the blue sky above and the green grass below.

The bridge contains many educational symbols and decorative metal icons mounted along the passage, which at one time were lighted at night by fiber-optics, creating a moving array of colors and light. This night-time light display has been noticeably absent for several years, apparently due to the mechanical failure of the high-powered “luminaries” which project colored light through the fiber optic cables.

Bridge Icons

Bridge Icons

As a class project, we designed a Solar Powered LED Lighting system to replace the existing outdated system that no longer works. (I can’t reveal the design yet here until things are approved) After thorough investigation, our class determined that the luminaries, located on the side of the bridge, most likely failed due to heat build-up, and possibly corrosion from exhaust and salt water mist from the traffic below. By contacting the vendor, we discovered that the 277 VAC model PH-3001 luminaries installed when the bridge was commissioned are no longer manufactured, and the replacement units would not be compatible with any of the PH-3001 units which still may be repairable on the bridge.  This means that to light the bridge again using the high-powered Metal-Halide luminaries, all 14 units would need to be replaced, at a minimum cost of $13,000.00 USD, not including labor.

It is also important to note, that the PH-3001 units are extremely difficult to maintain. Maintenance is very labor intensive, and consumes a large block of time for maintenance personnel who obviously have a multitude of other important tasks, maintaining a large campus the size of Columbus State. The bulbs burn out frequently, with a replacement cost of $211.00 each, or approximately $3000.00 USD per year. The units are also located in a difficult to reach location, and the fragile glass color wheels which require frequent cleaning and maintenance because of pollution from the traffic below, are easily damaged during maintenance.

Cost Benefit Analysis:

As noted earlier, the old Metal Halide lighting units are very labor intensive, and difficult to maintain. Due to heat buildup inside the enclosed units (Metal Halide bulbs run very hot), the bulbs would need to be changed yearly at a material cost of $3000.00 USD. Added to this amount would be a minimum of 28 hours of labor at $40 per hour, or $1120 in labor costs. The 14 units each consume approximately 200 watts of power per hour, or a total of $3.36 per day, $1226 per year. This would bring the approximate operating costs for the old lighting units to $3000 + $1120 + $1226 = $5346.00 per year operating cost.

Since the Solar Powered LED illuminated bridge runs off of the Sun’s energy, electrical costs and Carbon footprint would be Zero. LED light bulbs have an average MTBF (Mean time between failure) of 50,000 to 100,000 hours, or approximately 20 times that of the metal halide bulbs. By eliminating the mechanical rotating color wheels, valuable maintenance costs for an LED lighting system would be greatly reduced, to possibly only several hours per year. The estimated cost savings for the Solar Powered LED lighting system would be over $5000.00 USD per year.

So far the school has seemed to drag their feet with getting things done. Each day when I go to class and walk across the bridge I day dream about more stuff to add to the design which brings me to my original intent for this post, which is how to connect a PIR sensor to an Arduino.

The bridge has lighted square panels along the walkway. What I would like to see added is the ability for each panel to light up as a person gets close and then turn off as they move further away. This I feel will add to the cost savings since the walk way lights will only be in use at night when there is traffic on the bridge. If nobody is on the bridge, there is no need for them to be on at that time since the only purpose they serve is to see where you are walking.

Arduino with PIR Sensor

Arduino with PIR Sensor

Connecting a PIR sensor to an Arduino board can be done easily. PIR sensors consist of 3 pins, Vcc (Positive Voltage), Vss (Ground), and Signal. Interfacing it to the Arduino only requires +5v, GND and a digital input pin.

I put a short video clip on YouTube showing how the sensor works and the code is below.

I am thinking I could easily put together a small board and have each one located throughout the bridge with PIR sensors connected to them to control the individual squares. Or possibly have one central location for a control station and each PIR sensor runs to it.

Then as you walk, each panel will light up and turn off a few seconds later as you move away from it. The panels are staggered all the way down the walkway, so this would give a nice effect at night as someone is walking across the bridge.

Another thought I had was to tie all the walkway panels into one PIR at the entrance and one PIR at the exit of the bridge (maybe one in the middle also) and then the bridge would light up in 2-3 stages, rather than individual panels. Kind of boring, but serves its purpose for safety.

Additional Resources:

Parallax PIR Sensor Datasheet

Arduino PIRsense

Arduino Sketch:

// Parallax PIR sensor's output

//VARS
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 30;        

//the time when the sensor outputs a low impulse
long unsigned int lowIn;         

//the amount of milliseconds the sensor has to be low 
//before we assume all motion has stopped
long unsigned int pause = 5000;  

boolean lockLow = true;
boolean takeLowTime;  

int pirPin = 3;    //the digital pin connected to the PIR sensor's output
int ledPin = 13;

//SETUP
void setup(){
  Serial.begin(9600);
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(pirPin, LOW);

  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i < calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
  }

////////////////////////////
//LOOP
void loop(){

     if(digitalRead(pirPin) == HIGH){
       digitalWrite(ledPin, HIGH);   //the led visualizes the sensors output pin state
       if(lockLow){
         //makes sure we wait for a transition to LOW before any further output is made:
         lockLow = false;
         Serial.println("---");
         Serial.print("motion detected at ");
         Serial.print(millis()/1000);
         Serial.println(" sec");
         delay(50);
         }         
         takeLowTime = true;
       }

     if(digitalRead(pirPin) == LOW){
       digitalWrite(ledPin, LOW);  //the led visualizes the sensors output pin state

       if(takeLowTime){
        lowIn = millis();          //save the time of the transition from high to LOW
        takeLowTime = false;       //make sure this is only done at the start of a LOW phase
        }
       //if the sensor is low for more than the given pause, 
       //we assume that no more motion is going to happen
       if(!lockLow && millis() - lowIn > pause){
           //makes sure this block of code is only executed again after 
           //a new motion sequence has been detected
           lockLow = true;
           Serial.print("motion ended at ");      //output
           Serial.print((millis() - pause)/1000);
           Serial.println(" sec");
           delay(50);
           }
       }
  }
Share/Bookmark


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook