PIR E-Block
- JohnCrow
- 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
I recently aquired a small PIR sensor which I thought would made an interesting E-block
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.
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
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.
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
1 in 10 people understand binary, the other one doesn't !
- 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
Looks like an interesting project - thanks for taking the time to post.
http://www.matrixmultimedia.com/product ... PHPSESSID=
There is an associated "protoboard" E-block too for those wanting to play around without too much soldering.
I'll now shamelessly plug our E-blocks patch board which will help you or others in a similar situation: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.
http://www.matrixmultimedia.com/product ... PHPSESSID=
There is an associated "protoboard" E-block too for those wanting to play around without too much soldering.
- JohnCrow
- 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
Thanks Steve
I have already used your patch board for a couple of projects.
I have already used your patch board for a couple of projects.
1 in 10 people understand binary, the other one doesn't !
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: PIR E-Block
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
If you have a simple program like that I've attached can you please send me.
Thanks
Enamul
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
-
- 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
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
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
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact: