How to use arduino compatible PIR motion sensor in mbot


#1

Hi, Tere, I got an arudino compatible PIR motion sensor with 5V, GND and singal pins. Now If I want to use that sensor in mbot, how should i hooked this sensor to the board? BTW, i had bought a RJ25 adaptor, which got two slots(slot1 and slot 2). and if i hooked the sensor to one of the slot, which mblock should i use to program that sensor? so far i can only find one block, the “pir sensor port3”, but in that block, I can’t choose which slot is it? any suggestion ?


#2

worked for me panda thinks 0 when you are sitting still and 1 when it sees (your) motion


#3

I was working with PIR and noticed 2 things which may or may not apply:

  1. Any IR only worked on port 6 of Orion board, otherwise programs would compile, but upload failed until PIR was on port 6. IR remote is directed to be used on port 6.

  2. As such, IR for remote and PIR could not be used together.

Since mBot IR is onboard, not sure what port would run PIR, if any.


#4

that can not be true because the above script worked in my case (I have a mBot)

take a look at this table: http://learn.makeblock.cc/wiring/ there you will see that PIR sensor uses a ‘blue’ interface
and should work on every interface with a blue block on it (on an Orion that should be 3,4,5 and 6)


#5

As I said, may not apply to mBot, I actually have the Orion, and I was talking about how it handles the IR Detect, a blue label item. Depends on the board as the wiki states (but incorrectly says yellow rather than blue):

“1. As the Yellow tag illustrated, the Me–Infrared Receiver Decode can be connected to the port 3, 4, 6, 7 or 8 of the Me-Base Shield by RJ25 cable.
2. Connect Me–Infrared Receiver to Port 6 of Me-Base Shield on Meduino(or other Arduino compatible board).”

Notice port 5 is omitted, yet also has blue square. So not all ports are equal or always supported from this color only perspective.

IR Reciever

My problem was probably this (which I just found on the wiki):
p.s. If you use Port 6, 7, 8 as a serial communication port (Infrared Receiver, Line Finder, Bluetooth), please don’t set “delay()” in your code. If not, it would cause data obstruction and error.


#6