Shop OBEX P1 Docs P2 Docs Learn Events
PIR General Activation Circuit — Parallax Forums

PIR General Activation Circuit

SRLMSRLM Posts: 5,045
edited 2009-01-11 02:10 in Robotics
Well, here it is. This project uses the PIR sensor from Parallax to control a pair of LEDs and make them flash, based on whether the PIR senses motion or not. The interesting part in this project is that you can replace the LEDs with any sort of digital device that requires an enable pin. For example, the circuit works to pull the enable pin of the Parallax RFID reader. This enables you to make your RFID come on when you move close, and turn off when you leave.

The original proof of concept was discussed and shown in this thread.

The parts in this circuit are fairly simple. All you need are three general purpose transistors (2 NPN and a PNP), six resistors, regulator with caps, your LEDs, and a battery clip, and a board to build on; all of which you can pick up from Radio Shack. Additional (but not required) is a three pin socket. This allows you to pull the PIR off the board, especially helpful when soldering.

100_0136Small-full;init:.JPG
This is the front of the board. Note the three transisors, the regulator, and the PIR.

100_0139Small-full;init:.JPG
This is the back of the board. The regulator is on the left hand side, and the LEDs are on the bottom.

100_0140Small-full;init:.JPG

This is the circuit diagram. Note that you can add or take away the second and third set as you see fit if you are going to make a custom setup (such as for the RFID reader). Also, note that since the PIR has two states (HIGH or LOW) the output of the circuit is of two states. You can choose to have it inverted or not as you see fit. The second set is inverted from the PIR, the third is not inverted.
Note that in most cases, you can’t hook the PIR pin directly to an output, since the PIR sig pin cannot source very much current. Prolonged overcurrent may damage the module, so do so at your own risk. The red LED is on the right, and the green is on the left.

This was a fun little project that has allowed me to test my soldering skills.

Edit: Did you know that you can nest a picture in a link? Lots of work, but it comes out nicely [noparse]:)[/noparse]
Edit: Here is an image of the recomended setup for the regulator.
LB7805CapacitorSchematic-full;init:.jpg

Post Edited (SRLM) : 1/10/2009 8:05:35 AM GMT

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2009-01-10 03:08
    Cool.

    I haven't hooked my PIR up in quite a while, but based on that thread you mentioned, I'm sorely tempted to connect it to that 5V controllable outlet that was also mentioned in that thread. Fun ideas.

    Something about seeing your photo shortly after reading this thread

    http://forums.parallax.com/showthread.php?p=775204

    makes me want to sign off with

    Duracell rules! skull.gif
  • HumanoidoHumanoido Posts: 5,770
    edited 2009-01-10 04:09
    Very nice project! It's interesting to see a PIR run a fundamental
    operation by substituting a Basic Stamp with 3 transistors,
    6 resistors, 2 capacitors, a 5-volt regulator, and 2 LEDs. You
    could say there is an appreciation for the Parallax PIR sensor
    after building the Penguin Humanizer seen in Penguin Tech
    Magazine issue 2. You have an interesting project. This could
    ride along on Penguin's back, use no ports and contribute a
    functional operation to the robot. In fact, the status of the LED
    can be picked up by the photodector to interface directly to
    Penguin to drive code with the sensor's results. I see a lot of
    applications for your fine project!

    humanoido
  • soshimososhimo Posts: 215
    edited 2009-01-10 21:40
    Nice project. Not to beat a dead horse though, as I said before, you can create a high current sink using a common collector, sometimes called an emitter-follower, amplifier. It's a basic amplifier circuit. Here's a link: http://en.wikipedia.org/wiki/Common_collector.

    Remember, hfe is the current gain of the transistor. This means that a small change in current on the base is felt as a large change of current in the emitter. If you take your output from the emitter and make your collector common to both you will create a voltage buffer with unity gain - 1:1, but with high current gain which is proportional to hfe. This creates a nice high impedance buffer with a very large current source, which is exactly what you want. With one transistor instead of three.
  • SRLMSRLM Posts: 5,045
    edited 2009-01-11 00:30
    @sylvie369

    I beg to differ! Here is a battery comparison chart of different batteries (the D's are Duracell and the R is Rayovac). Notice how much longer the purple R line lasts before it crashes. Although, I'm not quite sure what that thread you mentioned has to do with anything ... [noparse]:)[/noparse]

    9v-100ma-discharge-tests.png

    @humanoido
    There certainly are lots of applications to for motion detecting circuits, especially ones that are cheap.

    @soshimo
    Want to provide a schematic? I'm no electrical engineer (programmer is my field), so this is a big step: just getting some transistors to flash an LED is like making the 'Hello World' program. This is my first analog project (analog on my part, I'm sure that the PIR has some code). With one transistor can you still provide the 5 volts to two LEDs that turn on and off in opposite states?
  • soshimososhimo Posts: 215
    edited 2009-01-11 01:52
    @SLRM - sure, I'll post a circuit biased correctly for your needs. I'll even test it out and make sure that it can source enough current. I'll add some resistor/led pairs in parallel and set the choke resistor up for 20ma current - I'll test at 100ma (5 branches) since I don't want to cook my regulator and that should be more than sufficient). The only issue I see is the unity voltage gain, but 3.3.vdc (the logic 1 of the prop chip) is within the range of a TTL logical '1'.

    I forgot to add - I always go Rayovac, ever since my RC days. I would eat through a 4 pack of energizers in a day on my 8th scale buggy (heavy torque steering servo drew lots of current) but rayovacs lasted up to 3 or 4 trips out (though I usually didn't press it and switched out after the 2nd time out). Same goes for the transmitter batteries. The only thing I noticed, and the graph definitely illustrates that, is the falloff is very steep so there's not much warning that your batteries are going.

    Post Edited (soshimo) : 1/11/2009 1:58:12 AM GMT
  • JamesDoughertyJamesDougherty Posts: 48
    edited 2009-01-11 02:10
    @·SRLM - Great job man! I'm in the middle of a huge programming project at the moment, but as soon as I take a break I will have to try this.·This idea can be used for so many different kinds of projects it's unbelievable.

    BTW: Thanks·for the link back smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James Dougherty

    Ariel Productions
    http://www.arielproductions.com/
Sign In or Register to comment.