Asked — Edited
Resolved Resolved by Dunning-Kruger!

Interfacing A Pir Onto The Ezb

I have tried every which a way and I cannot find a way to hook the PIR to the EZB. I have tried Analog,Digital, etc. I bought a dozen of these units - the ones with the TWO Potentiometers on the PC. You help would be appreciated.

Thanks,


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

#1  

PIR can use digital (my old ones worked via analog)... Are you using a 5v voltage regulator?... I just tried and they work from the digital port... Sorry, I thought they were analog...

Note The ones I use are from Parallax... The cheap Chinese ones from eBay don't seem to work with the ezb

#3  

Yes, I just tried Digital and they work Great. Thanks for your help.

#4  

@MovieMaker, I've been wanting to set up a PIR on my project so it will "wake up" when it detects motion. Do you mind sharing how you have your's configured? and possibly some script to get me going? Thanks

#5  

@bhouston Probably the easiest sensor to use... You just plug it in to any of the ezb's digital ports. It is a basic 3 pin sensor (grn,signal,+5v)... When motion is detected the pin goes high... In a script all you have to do is monitor the digital port...

Of course you would do this in a loop or you can use Wait for change option. There are a few ways to do this...


repeatUntil(1=2)
set(D0,OFF) #You might need this line as well, not sure
sleep(20)
$motion=getDigital(D0)

IF($motion=1) #pin went high
#motion detected so do something
endif

sleep(100)
endRepeatUntil


#6  

@Richard R, thanks, I'll try that.

#7  

Cool, I'd just like to mention that the Wait for Change command uses a lot less resources then a loop that's monitoring a port. This is very important if your monitoring an ADC port. I never monitored a Digital port so I cant comment on the resource draw there.

#8  

I was just testing it out. I haven't installed it yet. sorry,