PIR (pyroelectric) and picaxe

Jagger08

New Member
Hi all,

First off, I would like to say that I have been searching the forums for the past few days for any information that could help me with the problem I am having, as there are numerous threads about PIR sensors. However, I have not been able to find anything that I can use. Please don't redirect me to the search button :eek:

I am working on my semester assignment at school, and I am designing and building a wireless alarm system. I have the rest of the system working, but I have run into trouble with my PIR sensors. Here is a bit of info, as I know that will be the first thing you ask for :p

Part no.: Murata IRA-E712ST3
Supplier: Farnell Australia
http://au.farnell.com/murata/ira-e712st3/pir-high-light-immunity/dp/1006207

I am looking for help with connecting this to my 08M Picaxe. The first thing I tried was connecting the output leg of the component directly to an ADC input on the microcontroller, then using readadc to read its value. This turned up a strange result, though. When using debug on the variable, I saw that it was just letters, instead of the expected numbers from 1-255.

I then decided to test the output voltage of the component, by using a multimeter between the ground leg and the output leg. From this, I found a constant voltage of around 1.2/1.3 volts, even when there was movement.

Most of the threads I found on these forums did not say whether they were referring to the single sensor, or the complete module, so I could not use the information in them.

Any help would be greatly appreciated.
Thanks, Jagger.
 

Andrew Cowan

Senior Member
I've never had letters coming in through debug. Were you:
- Running at 4MHz
- Using the command debug
- Not using the sertxd command

If you are running at 8MHz, you can select this in the debug window.

I haven't used a raw PIR sensor, I've only used the modules.

Your wiring should be:
Leg G to 0V
Leg D to +V
Leg S is output, and it should have a 100K pulldown resistor on it.

I got that from the datasheet.

Does this help?

A
 

Dippy

Moderator
Using a pyro PIR module can be tricky. The o/p changes can be tiny and need gain (amplifciation) unless an inch range is OK :) .

I believe there are special chips available but I have used Op-Amps to achieve fairly good results.
AC coupling with fixed bias can get rid of o/p drift too. HF rejection and plenty of gain and Bob's your Uncle.
I can't find my circuit offhand, sorry.

Remember, they work best for changes in IR.
So, for anything more than a foot or two range you should use those polythene Fresnel lens (some use reflectors) to focus the body heat. The lenses (and reflectors) focus into sort-of bands, so as you walk across them it increases the high-low-high changes in IR reaching the sensor element(s).

I haven't looked at that specific Data Sheet but many give example circuits to improve gain.
The ones I have looked at in the past show a complete circuit, you will only need the front end gain.

And, sorry to worry you, but having an oscilloscope makes life SSSOO much easier.

Once you have all that sorted you can look into thresholds and pulse counting to reduce false triggers.

What is your level of skill/experience with electronics?
I hope you haven't set a task that is too difficult in a short period of time?

As for the serial; could be baud rate as alluded to by Andrew. Could be your serial command structure.
Post a code snippet.
Best to get that bit sorted first.
 

Jagger08

New Member
Your wiring should be:
Leg G to 0V
Leg D to +V
Leg S is output, and it should have a 100K pulldown resistor on it.
I didn't have a pull-down resistor on it, that could be it. Thanks for clearing that up.

Dippy, I was originally intending to get a PIR module, with the circuitry integrated, if that makes sense. However, it seems that there were none available from any Australian suppliers, and my school has a policy of not ordering off ebay. One of the department staff suggested the sensor alone, which ended up taking 2 weeks to arrive from overseas anyway. :D Unfortunately, that seems to have made the project harder.

I have limited experience in electronics, no specialized training, only 3 years at school. However, I have an understanding of the theory, so it doesn't take me long to pick up the stuff I need. I have a fair amount of experience in programming, though.

I have a fresnel lens for the sensor. I have access to an oscilloscope at school, which means I would have to wait until Monday to use it. I do have a multimeter here, so I can measure the voltages, if needs be.

Unfortunately, the data sheet is lacking on the information side, and appears to me to only have the basic info (operating voltages etc), so I might need some help with increasing the gain, after I actually get the sensor working of course. The project is due on Tuesday, but completing the actual electronics isn't essential, due to delays in shipping, etc. I only need to hand in a design folio.

I was only using a simple debug loop:

Code:
main:
readadc 2,b0
debug b0
pause 500
goto main
Thanks for both your replies, I am going to attempt to find a 100k resistor. If I can't find one, I will have to wait until Monday - I do not have many parts at home.

Jagger
 

Dippy

Moderator
I just had a look at your link and then read the Data Sheet.
Page 10 of that Data Sheet gives an example circuit!!

As we all leave things until the last moment it wouldsound like a all-in module would be the quickest but most expnsive route.

Did you buy the Murata from Farnell?
And it took 2 weeks to turn up?
I get next day service from Farnell here FOC.
(Or did teacher save a dollar from some other supplier? ;) )

I notice that Farnell also do the all-in modules.
They say Epson Tyocom in this page.
http://au.farnell.com/jsp/search/browse.jsp?N=500001+1002904&Ntk=gensearch_001&Ntt=pyro&Ntx=
But the Data Sheet says Seiko.
http://www.farnell.com/datasheets/57403.pdf

And they say In Stock in Aus.

So, apart from the price there is no problem (??).
You'll be unlikely to get a working circuit in a couple of days without a lot of help.
Depends on whether the project is to educate you in electronics or whether the PIR is just to be treated as a 'black box' (??).

PS. Panasonic/NAIS make some really nice all-in-ones with analogue or digtal o/p models. May be difficult to source though.

Good luck.
 
Last edited:

Jagger08

New Member
I ignored the second one because it said miscellaneous - I guess that was a bad idea. I just had a look at the second pdf, and it does have some useful info.

They didn't have the sensors in stock in Australia, so they had to be shipped from Japan. I guess that is why they took so long. It was bought from Farnell.

It would take a while to get the Epson Tyocom modules in, so I will stick with the sensors. I think they are a bit too expensive as well.

I don't have to finish the circuit by Tuesday, as long as I get the folio done, and show that I had the right idea. I'll keep at it anyway, because I want to finish it for myself as well.

I will use the example circuit in that second pdf and see what happens from there. Thanks for your help.

Edit: I did find a 100K resistor. I took it off some kit I found that I made a long time ago, hehe. Thanks Andrew
 
Last edited:

Dippy

Moderator
Weird, so even though the Aus Farnell site says there are 5 off MS401 in stock, then that isn't the case in reality?
http://au.farnell.com/jsp/search/productdetail.jsp?sku=1209948

Yes, quite a price.
But cheap if you were a design engineer on >$100 per hour :)

Well, I hope you get the circuit working OK. It will be a useful bit of learning if you understand basic op-amps.

I've just found my old circuit - I think it's more complicated than Murata's , so I won't post it :)
 

Jagger08

New Member
and here I was looking at the wrong one again! :) I was looking at the MS331. I think I will go to bed now, maybe my brain will function better tomorrow. Again, thanks for the help.
 

papaof2

Senior Member
Based on the multiple stages of op-amp (two LM358 plus parallel NJM2903m) in the datasheet circuit, I don't think that you will be able to use this sensor directly with a PICAXE.

John
 
Top