On Fri, Dec 16, 2016 at 10:33 PM, Chris Fink
<[email protected]> wrote:

> At first the LED light turned on right away, and I got a constant succession
> of "Motion Detected" messages. Then I realized that the code assumed an
> active-LOW output from the PIR, but my PIR is active-HIGH, so I changed the
> lines
>
> if(x.value === 0){
>          b.digitalWrite(led, 1);
>     console.log("Motion Detected");
>
> to instead be
>
> if(x.value === 1){
>          b.digitalWrite(led, 1);
>     console.log("Motion Detected");
>
> In this case the light does not come on, and I get a constant succession of
> "No Motion Detected" messages...and the PIR never detects motion, no matter
> how much I move, or how close I am. I even tried a different PIR (also
> active-HIGH), and got the exact same results. I also tried removing the
> pull-up resistor, which also did not work.

First of all, you have to watch for the voltages. BBB uses 3.3V,
whereas Arduino uses 5V. If you apply 5V to BBB, you could damage it,
but on the other hand, if you use 3.3V provided by BBB to power a 5V
sensor, it may simply be not enough for it to operate (although it
won't damage the BBB because it's unlikely to generate its own 5V).
The bottom line is you do need a 3.3V-compatible sensor.

If yours is 'active HIGH' then a pull-up resistor would probably just
peg it in a 'constantly active' state.

Just use a DVM to measure the voltage on the sensor when it's powered
by your BBB: if it shows 0V covered, and around 3V if you stick your
hand in front of it, it should work with the code above.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAC%3D1GgHTGtN07X%3Dea4bCK7NUMMxO-0_coEfzjydwCe07mFg4WQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to