Jump to content
Lv2Hunt

Pir Circuit

Recommended Posts

For the guys that build their own picaxe boards:

 

I have been pursuing building my own camera control board. But from what I have been reading the PIR modules that everyone has been using are giving lots of false triggers and are not a good source to use.

 

I have been emailing the guy from Glolab and have come up with this circuit that can be used with our picaxe chip. Not sure if this is any better than the modules that everyone is using?

 

PIRCIRCUIT_zpsa1ccee50.png

 

The circuit looks very simple. I have not tested this circuit yet which leads me to my next point:

 

This circuit does not have a window comparator and supposedly you can do this with the picaxe chip using ADC commands and such. I know there are some people that have more knowledge of picaxe code than I do so I am asking if anyone knows how to do this? I have read the manuals on this topic but am still very confused on this part of the code.

 

Below is part of an email from Glolab.

 

“When no motion is being detected IC1B pin 7 will be at half of the supply voltage. When motion is detected pin 7 will go up or down depending on the direction of motion. It will also move up and down a little even with no motion because of electrical noise in the sensor and amplifier circuits. So you need a small dead zone near the supply voltage center to ignore that noise and avoid false triggering. The window comparator circuit added that dead zone but you can program your microcontroller to do the same thing. Just program it to respond only to voltage changes greater than about ½ volt.”

 

Does anyone have any suggestions or any faults with this circuit?

 

Share this post


Link to post
Share on other sites
 

Boy I'm not sure on that one. Normally we look for the pin to go high or low when there is motion. Meaning full voltage or no voltage. At least that's how I understand it? With direction of movement giving different voltages high or low that would take some different coding for sure

Edited by bowgod02

Share this post


Link to post
Share on other sites
 

I have used the Glolab circuit in some of my own boards and it works very well. The circuit in the AIO board is almost the same and it appears to work just as well. I don't know what circuit some of the other boards use for the motion detection portion but I think they are all very similar. The Glolab circuit that mine uses does not go high in regards to motion in one direction and low in regards to the other direction. I can't remember which way it works at the moment but it either is low at idle and goes high when motion is detected or the reverse of this. I can check one this evening if it is important. Mine also has one difference. One of the resistors has been replaced with a potentiometer so that the sensitivity can be adjusted. I have mine set such that it will pick up motion at about 15 yards and I get very few false pictures (less than 5%).

 

Rick

Share this post


Link to post
Share on other sites
 

I think what the guys here said is correct, it probably only goes from high to low (or vise versa) in both directions directions. Measure voltage from pin 7 to ground and see what you get. R5 is where you can use a POT or play with different resistor values to adjust the sensitivity.

Share this post


Link to post
Share on other sites
 

I would say Driveway alert is pretty solid, and TC used the electronics123 module in his 360 degree cam with HPWA lens and I have not heard him mention false trigger problems, a few false triggers really wont hurt with a picture camera, I do not think you will be disappointed with driveway alert, TC may chime in on 123 pirs.

Share this post


Link to post
Share on other sites
 
I have used the Glolab circuit in some of my own boards and it works very well. The circuit in the AIO board is almost the same and it appears to work just as well. I don't know what circuit some of the other boards use for the motion detection portion but I think they are all very similar. The Glolab circuit that mine uses does not go high in regards to motion in one direction and low in regards to the other direction. I can't remember which way it works at the moment but it either is low at idle and goes high when motion is detected or the reverse of this. I can check one this evening if it is important. Mine also has one difference. One of the resistors has been replaced with a potentiometer so that the sensitivity can be adjusted. I have mine set such that it will pick up motion at about 15 yards and I get very few false pictures (less than 5%).

 

Rick

Is that a 0 to 10k pot that you use? also wondered if you had a schematic that shows the rectangular chip and not the triangles? they are just confusing for me to look at

Share this post


Link to post
Share on other sites
 

I think a 10k pot will work.

 

I do not have a schematic without the triangles but you can google lm358 and get pics with the pinout that has triangles in it.

 

Share this post


Link to post
Share on other sites
 

I am glad to hear that the driveway alert isn't that bad. I will be getting some soon to try :). However it would be nice to have a pir circuit made on to my board. Also feel like I'm wasting driveway alert.

Share this post


Link to post
Share on other sites
 

Now that I am home and looked at my schematics they are different than what was originally posted even though I got the design from Glolab. The design I used is similar to this http://www.glolab.com/pirparts/appckt.pdf. Just ignore the CD4538 chip and its associated components. The output of D3 and D4 when tied together becomes the input into your microcontroller. The triangles that your are referring to are simply op amps. They make chips that contain 4 op amps within a single chip. On the schematic that I listed they are using a LM324. This particular chip uses a rather large amount of current to run. I substituted it with a TLC27L4ACN. It has the same pin out but consumes much less current. As you can see the last two op amps are in fact set up as comparator. So back to your original question, I have not used one such that the microcontroller is performing the comparator portion.

Share this post


Link to post
Share on other sites
 

Steiner thanks for the info. This was the same circuit that mine came from. Mine did not use IC1C or IC1D because you can apparently program a micro controller to do this. but since no one knows how to write the picaxe program I might try and use the rest of the schematic.

 

So you do not use any components to the right of D3 and D4 correct?

Tying D3 and D4 together is where your controller connects?

Is this Tsl@&$" part the same as the AIO? The part number looks different to me.

Share this post


Link to post
Share on other sites
 

That is correct. You will need D3, D4 and R9. The black dot between D3 and D4 is where you will tie your input into on your microcontroller. The AIO schematic that I have shows a part number for the quad op amp of TS27L4CN. This is a surface mount chip so I used TS27L4IN which is for a through hole circuit boards.

 

Rick

Share this post


Link to post
Share on other sites
 

It sounds like you may go another direction now, but you might be able to use the same type of code that is used for a keypad. Each key has a different resistance to it and the picaxe measures the voltage and assigns a number value to it. In your case you would have the picaxe continually take a voltage reading at the PIR and if it doesn't fall within a set trigger value it would ignore that reading. Once it goes above or below a set value it will take that voltage reading and you can plan a trigger event. I actually like the idea of being able to do that because I think you could in theory really dial in if it's a false reading or not. Set it so it has to have a voltage reading of whatever for so many readings before it triggers. I'm not sure how it gives voltage readings as far as if it's a set idle value and gradually goes up or down as the target comes into the area, or if it has a set idle value and set motion sensed value. Maybe something like this, but it's a total guess.

 

Main:
do
wait_for_PIR:
  readadc 2, junk
  if junk < 100 then wait_for_keypress ‘ value can be whatever the voltage is when the PIR is idle.  Then set < or > value when it senses motion.
  pause 100 ’ adjust to take readings at whatever time length                               
  readadc10 C.2, PIRvalue

               
  sertxd ("PIRvalue=", #w1,cr,lf)

  select case PIRvalue                  

        case > 300 : inc PIRcount
        case < 300 : PIRcount=0
              

  end select
  sertxd ("check=", #b1,cr,lf)




If PIRcount=3 then
goto CamPower
endif

Loop

 

 

Share this post


Link to post
Share on other sites
 

Thanks KZ3 that looks like it could work. But I'm not a genius when it comes to picaxe code. Maybe others will chime in?

 

I have attached my redrawn version of glolabs pir circuit (the one with the comparator).

Mheimburg1: I think this is what you wanted?

 

You guys may want to check over my work but I believe it's right.

 

GLOLABPIRCIRCUITTOPICAXE_zpscae0ca25.png

Edited by Lv2Hunt

Share this post


Link to post
Share on other sites
 
 

Thought I would also post this for reference.

 

If anyone try's this before I get to it. Please update me on any findings.

 

F7CA759D-63BA-4FB4-A9B9-1C0A5D8C8F2D-3780-000008280A176C61_zpscc758a24.jpg

Share this post


Link to post
Share on other sites
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×