Close

More About the "Connor Nishijima Effect"

A project log for Little Friend

This companion robot, 9000 farads of super capacitance, spends less than eight minutes feeding--then 75 minutes or more she can be a buddy.

mike-rigsbyMike Rigsby 05/26/2016 at 20:102 Comments

I've been working on this "human detector" sensor and I have more information to share. First, I wound (two) four inch long insulated wires around each other (not electrically connected). One goes to pin A0 of an Arduino Uno, the other to ground.

While playing around with software, I noticed that I could only get predictable results when my delay between two readings was an exact multiple of 16.7 milliseconds--something to do with 60 cycle (powerline) frequency.

Next, I hooked up the antenna to an oscilloscope.

There's a wave there and its frequency is 60 cycles--but here is where it gets interesting. The wave is "fat" (has a lot of "fuzz" on it--please excuse my technical language here).

When a human gets near the antenna, it isn't the 60 cycle wave that changes, it's the "fuzz."

The easiest way to read the change in "fuzz" is to get rid of the 60 cycle component. I chose to read at the same spot on the 60 cycle wave by reading analog values at 16.7 millisecond multiples (like 50 or 500).

Here's my Arduino code:

int val=0;//storage
int val1=0;//second storage
int val2=0;//more storage
int val3=0;//another storage



const int led=5;//led pin
const int relay=4;//relay pin
int antenna=1;//analog assignment



void setup() {
pinMode(led,OUTPUT);//set led for output
pinMode(relay,OUTPUT);//set relay for output
digitalWrite(led,HIGH);//startup test
digitalWrite(relay,LOW);//startup test
delay(2000);
digitalWrite(led,LOW);//set for run



}



void loop() {



val=analogRead(antenna);//read antenna

delay(500);//wait a bit
val1=analogRead(antenna);//read antenna again



val2=val+10;
val3=val-10;



if (val1>val2 || val1<val3) {
digitalWrite(led,HIGH);//something happened
digitalWrite(relay,HIGH);//close relay contact
delay(1000);
digitalWrite(led,LOW);//reset led
digitalWrite(relay,LOW);//open relay
delay(5000);//let speech module talk
}}

Two or three things of interest should be noted:

1) The twisted wire that does not go to A0 works just as well in +5 or gnd.

2) 500 milliseconds delay between readings provides more sensitivity than 50 milliseconds.

3) This works better when powered by battery than a wall wart. Power supply noise or other nearby electrical noise will foul the results.

Discussions

Mike Rigsby wrote 05/29/2016 at 13:33 point

I agree that direction (moving TO or AWAY) can be discerned, but I haven't spent much effort on that. Antenna configuration, exactly what is being influenced and how--somebody could probably earn a degree working on this. For robotics--the concept of a simple antenna and code to detect approaching humans or animals--opens up a lot of possibilities. Please keep me posted as you discern more about the "Connor Nishijima Effect."

  Are you sure? yes | no

Lixie Labs wrote 05/29/2016 at 12:22 point

The way I was able to overcome the 60Hz component in my code was to fill a medium-sized array of samples (over a period >= the ~16ms of an American AC cycle) and grab the maximum value seen. Next time around we do it again and compare the new max to the last one. Pretty bodgy, but it worked. :) If the difference was negative, it signifies movement AWAY from the antenna, but I simply used abs() on the value to make all differences positive for simplicity.

  Are you sure? yes | no