PIR SE10 Motion Detector and Micro Maestro 6-ch USB

I would like to use a PIR SE10 infrared motion detector in conjunction with a Micro Maestro 6 channel USB servo controller to control activation of a Power HD High Torque 1501MG servo. I would like the Micro Maestro to be powered for only 10 minutes once the PIR SE10 detects motion. Is this possible with these components?

Hello,

The Maestro can certainly use the PIR detector as an input (connect it like a “button or switch” as described here.) And it can control a servo to move however you like, including moving in some pattern for 10 minutes and then powering down the motor.

However, you asked about the Maestro being powered for only 10 minutes. What do you mean, exactly? If you want it to turn off, how would you expect it to turn itself back on?

-Paul

What I would like to happen is, once motion is detected by the PIR, the servo will cycle back and forth once every 30 seconds for 10 minutes. After the 10 minute period of servo activity, the servo will stop cycling until the motion detector detects motion again. I do not need the controller to power down between cycles. Thanks for your help thus far.

Yes, the Maestro can do that. Basically, you have to write a program like this:

begin   # loop forever
  detector if  # you write the "detector" function
    20  # do the following loop 20 times (30 seconds * 20 = 10 minutes)
    begin dup while
      position1    # you write this function - go to position 1
      15000 delay  # wait 15 seconds (max possible delay is 32767)
      position2    # you write this function - go to position 2
      15000 delay  # wait 15 seconds
      1 minus
    end
    drop  # remove the counter from the stack
  end
repeat

The functions might be as simple as:

def detector
  0 get_position 500 less_than
  return

def position1
  4000 1 servo
  return

def position2
  8000 1 servo
  return

We can help you finish your program if you keep posting here. Good luck!

-Paul

I have hooked the PIR SE10 to the Micro Maestro according to the instructions for using a button switch and loaded the program onto the Micro Maestro. Everything works great while the system is attached to my laptop (via USB cable, It also does not matter if my laptop is on or off). However, when I disconnect the laptop and the system is on the 6 v battery it appears that the PIR SE10 does not function properly. Do you have any suggestions?

Thank you for all of your help thus far.

Sure. Tell us exactly how you connected and configured everything and describe what goes wrong when you disconnect it from the laptop, including in your description exactly what the LEDs on the Maestro are doing. In particular, did you connect the 6V battery to Vin on the Maestro?

-Paul

Well I guess it must have been some bad connection. I hooked up the unit up today and it worked fine. However, if you wish to check over my work, that would be great.
I am using a 6V sealed battery, current voltage is 6.39 V. The battery is connected to the ground and VIN on the Maestro. The positive lead runs through an ON/OFF toggle switch. A second positive lead from the toggle switch runs to the positive pin for servo power on the Maestro. I have channel 0 configured as a servo and channel 1 configured as an input. I have my Pololu 1057 servo plugged into the channel 0 pins. I have placed a 10 k ohm resistor between the 5V (out) and the signal pin for the channel 1. Between the resistor and the channel 1 signal pin I have attached a wire that is connected to the black wire coming from the PIR motion detector. I have run the positive and negative leads from the PIR detector directly to the 6 V battery.
I have applied the following program.
begin
1 get_position
1000 greater_than
if
5
begin
dup while
7000 0 servo
500 delay
4000 0 servo
1 minus
repeat
else
4000 0 servo
endif
repeat
With the Maestro hooked to my laptop, the yellow led flashes twice rapidly and has about a half second period between flashes. The green led is flashes rapidly. With the laptop disconnected the green LED is not lit and the yellow LED flashes with the same pattern as with the laptop connected. The 1 input with no motion sits steady at 255.75. When motion is detected the 1 input drops to 3.75.
Thanks, Rod

Hello,

I am glad that the sensor is working for you, and your connections do all sound correct. However, I noticed a few problems with your code, so I wonder about what you mean when you say “it worked fine.” In the future, please pose your code using the Code button and preview to get it formatted nicely - it is very hard to read when you just paste it in like that. Anyway, here is what I noticed:

  • A cutoff of 1000 for the sensor value seems way too strict - I would use something about halfway between your observed on and off values, like 500.
  • There is no delay after setting the position to 4000, so the servo will not go back and forth the way you intended.
  • You need a DROP command after exiting the loop to remove the loop variable from the stack; otherwise it will eventually overflow.

-Paul

@rnakamoto
I would really like to see how you wired everything up, did you follow a guide?

I have also been trying to figure this out. For what its worth, here’s what I’ve done. Eventually I was able to hook up the se10 by runnning a 10k resistor lead from the +5v out socket on the Maestro 6 to the black line socket on the se10. The plug socket on the se10 is offset to fit the red and brown wire socket over the power and ground pins, respectively, of the maestro on post set 5 (use whichever post set you wish). Note that as this is offset the the black wire socket of the se10 is not over a post, but is free to receive the line from the 10K resistor. Lastly, I patched a second line from the +5v out to the free post from post set 5 on the Maestro. I set the maestro control to INPUT for channel 5. I wired up the battery pack jumper as described in the Maestro instructions and use a 6v battery pack. I get a static reading of 255 when there is no signal. I get a reding of 4 when there is an interruption in the infrared baseline. That interruption signal lasts for about 4 seconds, before it resets to 255.