PIR E-Block

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Post Reply
User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

PIR E-Block

Post by JohnCrow »

I recently aquired a small PIR sensor which I thought would made an interesting E-block
PIR E - Block.jpg
PIR E - Block.jpg (74.13 KiB) Viewed 13743 times
The device operates from 12V. (Red Wire)
The output is 5V and goes low when movement is detected. The signal line is connected to 5V via a 10k-ohm pull up resistor. (Black Wire)

To save having to connect both 12V and 5V lines to the programmer, two 3-pin regulators were used.
12V for power and 5V for the pull up signal. This means just the 14V line from the programmer is needed.

Small caps were placed between input & ground and output & ground on both 3 pin regulators - (Value was what I had in stock in a suitable physical size)
Rather than use links on the top of the board, thin insulatated wires were run on the rear of the board.

The output defauts to bit 0, but a jumper allows a patch system to connect to ch1 to 5.

I have found during initial tests I got better operation by reading the output as a voltage on the ADC rather than logic levels.
But the device works as expected. 8)

The 9pin D-Plug caused a bit of head scratching as the 2 rows of pins are stagged and wont fit veroboard.
I cut off pins 6-9 which allowed it to be soldered to the veroboard.(These channels are not required for this application, anyway).
Pin 9, ground, then had a short thin wire soldered to the stub and fed through to the solder side.

Flowcode Test File - ADC
Having tried digital detection with the completed E-Block it now works fine.
Must have been somthing to do with running initally just patched using a protoboard.
Also means a much simpler flowcode program, and can be used on a PIC without ADC.

Flowcode Test File - Digital
SE10 E Block - Simple Digital Detected.fcf
(7.5 KiB) Downloaded 667 times
1 in 10 people understand binary, the other one doesn't !

User avatar
Steve
Matrix Staff
Posts: 3421
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PIR E-Block

Post by Steve »

Looks like an interesting project - thanks for taking the time to post.
JohnCrow wrote:The 9pin D-Plug caused a bit of head scratching as the 2 rows of pins are stagged and wont fit veroboard.
I cut off pins 6-9 which allowed it to be soldered to the veroboard.(These channels are not required for this application, anyway).
Pin 9, ground, then had a short thin wire soldered to the stub and fed through to the solder side.
I'll now shamelessly plug our E-blocks patch board which will help you or others in a similar situation:
http://www.matrixmultimedia.com/product ... PHPSESSID=

There is an associated "protoboard" E-block too for those wanting to play around without too much soldering.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: PIR E-Block

Post by JohnCrow »

Thanks Steve
I have already used your patch board for a couple of projects.
1 in 10 people understand binary, the other one doesn't !

singhdeol
Posts: 30
Joined: Sat Dec 18, 2010 6:07 am
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: PIR E-Block

Post by singhdeol »

thx for sharing the project with us

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: PIR E-Block

Post by DylanBalloo »

Hello there, can you please tell me if we can use the PIR directly in the MIAC?

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PIR E-Block

Post by Enamul »

Hi
PIR sensor output 5v signal which can be easily sensed by MIAC
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: PIR E-Block

Post by DylanBalloo »

What will be the input to the miac, input digital or analog?

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PIR E-Block

Post by Enamul »

Of course digital input..
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: PIR E-Block

Post by DylanBalloo »

Can you please check this program for me..Its a simple program..I dont know how to use the Digital Input?
If you have a simple program like that I've attached can you please send me.
Thanks
Enamul

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: PIR E-Block

Post by DylanBalloo »

PIR.fcf
(5.5 KiB) Downloaded 452 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIR E-Block

Post by medelec35 »

Hi DylanBalloo,

For a single channel digital input your looking for a 0 or 1 (no higher!)

So if you change: LDR > 100
to
LDR = 1

It will then work the way you have intended.

If you use analogue input then:
If ReadAsByte then range is 0 to 255 (8bit)
If ReadAsInt then range is 0 to 1023 (10bit)
With Miac you will need to look at programming guide:
http://www.matrixmultimedia.com/resourc ... -guide.pdf
to check maximum reading as I believe the upper value will be limited due to clamping.

Martin
Martin

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: PIR E-Block

Post by DylanBalloo »

Ok Enamul....thanks its working now

Post Reply