Jump to content
bulltalk.65

Project 3 Eye's

Recommended Posts

Chris,

on your timing for the walktest how and where did you come up with the W0, I looked through the pdfs and manual and I'm not finding it so on mine I went "symbol counter=b1, 1-60" but I'm not sure if thats correct or will work either but added it under walktest on the program I'm working on so we'll see.

 

when I get home tonight I'll post up what I have put together so far, I still need to figure out how to add the servo in to read from each pir individually, I had to change the idea of all three pirs in series on the same pin because I would not have a clue as to how to read motion individually so the servo could move the camera to the correct position. I've changed that and placed them on there own inputs just for simplifying it for myself, hopefully it will work... LoL

 

let me know what you think if you have time,

 

George

Edited by bulltalk.65

Share this post


Link to post
Share on other sites
 

george,

 

does the chip you are using have a pin for "a/d input".

Share this post


Link to post
Share on other sites
 

would that be the same as an adc input ? if it is then yes I have adc 0, adc 1 and adc 2 inputs.

 

 

I think I'm on to it here in the manual, because when I use the "symbol" for the counter its using the b1 register (WO), I think !!!

Share this post


Link to post
Share on other sites
 

for chips that have adc inputs, one of the tricks you can use to have multiple inputs on one pin is to use a switched resistor network. dont' panic - big words for a simple concept.

 

About adc - it converts an analog signal (i.e. - volts) to a digital number (a byte) - thus the name adc = Analog Digital Converter. Here is an excellent article on how to build a switched resistor network:

 

http://ww1.microchip.com/downloads/en/AppNotes/00234a.pdf

 

see figure 1 for a schematic of how to build the resistor network.

 

so how does it work? VDD is your circuit voltage - lets say 5 volts. assuming your chip has 8 bit resolution, if the adc has 5 volts applied to it, the corresponding adc register would read 255. if it had 2.5 volts applied, it would read 128 and if it has 0 volts applied, it would read 0. in other words, the analog input range of 0 to 5 volts has a corresponding "digital" range of 0 to 255. so - you use the resistor network to make different voltage levels appear on the adc pin. in your case, each pir would trigger a switch (an optoisolater perhaps?) providing a seperate voltage to the adc pin. you would then write your program something like this:

 

loop

 

if adc < 10 then nothing is happening

 

if adc is > 10 and less than 80 then the left pir has detected and i need to go out of this loop routine and move camera to the left position and record

 

if adc is >80 but less than 160 then the center pir has detected and i need to go out of this loop routine and move the camera to point in the center direction and record

 

if adc is > 160 then the right pir has detected and i need to go out of this loop routine and move the camera to point to the right direction and record.

 

end loop

 

 

or, you can simply use three input pins and have the program recognize which pir they are assigned :)

 

hope this helps

 

 

Share this post


Link to post
Share on other sites
 

THANK YOU VERY MUCH, that is exactly what I am wanting to accomplish but really had no Idea or enough know how to get it done. I was reading a post on a chip forum about using multiple pirs in series and using just one pin of the IC for economical reasons of this individuals. so I knew it could be done , just did'nt know how to accomplish it... I'll work on it..

 

thanks again bud, very much appreciated.

 

George

Share this post


Link to post
Share on other sites
 

George, I got it from someone way smarter than I'll ever be, but look in manual 2. If you click edit at the top of the page, you can choose "find" and it will search for stuff for you. I think it was around page 9. I believe you can do it your way too though...

 

I really like the name you chose for the project! It's one of the things on my to-do list too, so I'm sure interested in what you learn, and how you do it.

 

hunt4it44, thanks!

Share this post


Link to post
Share on other sites
 

removed from embarrasment.....LoL

 

Edited by bulltalk.65

Share this post


Link to post
Share on other sites
 

George, with the program in your program editor, click Picaxe at the top. See Check Syntax...

 

That will point out where you have a problem in the code.

Share this post


Link to post
Share on other sites
 

This works in the editor now, but I don't know if it works a camera yet.

 

symbol counter=b1 'define variable b1 as "counter"

symbol pirA=15 'define pin 15 as pir A

symbol pirB=16 'define pin 16 as pir B

symbol pirC=17 'define pin 17 as pir C

symbol led=6 'define pin 6 as "led"

symbol campower=11 'define pin 11 as "campower"

symbol shutter=12

Share this post


Link to post
Share on other sites
 

George, I think I found a problem there. Try this if you can.

 

 

symbol counter=b1 'define variable b1 as "counter"

symbol pirA=15 'define pin 15 as pir A

symbol pirB=16 'define pin 16 as pir B

symbol pirC=17 'define pin 17 as pir C

symbol led=6 'define pin 6 as "led"

symbol campower=11 'define pin 11 as "campower"

symbol shutter=12 'define pin 12 as "shutter"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

warm_up: '25 seconds

 

for counter = 1 to 25 'start for...next loop

high led 'turn on walktest led - flash 25 times on warm up,switch high

pause 500 '1/2 sec pause on

low led 'turn off walktest led, switch low

pause 500 '1/2 sec pause off

next counter 'end of for...next loop

 

goto walktest 'start walktest

 

 

walktest:

 

high 6

pause 1000

low 6

pause 1000

goto walktest

Edited by 212

Share this post


Link to post
Share on other sites
 

George,

I've been toying with this too. Depending on what you are try to accomplish, one idea that might simplify things is to use 2 sensors rather than 3 if faster detection/triggering is what you're after. That way, you can put a super wide angle lens in front of one sensor and then a narrow (0.65) in front of the other. Now use the WA for turning the cam on and the .65 for triggering. An advantage of 3 would be that you could use a .65 in front of all 3 so that you would still get good distance though.

Gary

Share this post


Link to post
Share on other sites
 

 

Hey Gary,

 

my idea was to build a cam that simulates a security cam but use a still cam instead. I have a case I'm building that the cam will see 180 degrees across the case with 3 pir's positioned at one straight forward and the other 2 at 75 degrees from center (off 90 deg) to the left and right of center (probably hard to picture). my buddy is doing a cad drawing of it so when its done I'll post it so you can see how its setup.

 

I figured if 1 of the 3 pirs was triggered I'd have the cam move to position and then take a pic, or setup the cam to do short video clips and then reposition to what I'd call home position (straight forward). basically it would be able to sense motion from around 270 degrees from where ever I hang it. we have alot of intersecting migration trails that spread and some follow parallel so thats where the thought came from. I could hang the cam and get pics from 3 different angles from 1 spot and cover a bunch of trails at the same time.

 

hope all that made sense !!!

 

 

George

Share this post


Link to post
Share on other sites
 

Ahh, I see...sounds like a cool idea. Something else that you may be able to incorporate is the direction of movement on each single sensor. Here's a pretty good write up on the GLOLAB website:

 

GLOLAB

Gary

Edited by ghoot

Share this post


Link to post
Share on other sites
 

at at at...stay focused George, keep it simple, then you can expand on it later :)

Share this post


Link to post
Share on other sites
 

here is some cad drwg's of project 3 Eyes, its "not to scale" so the actual build will have the cam within a 1/4 of the front slotted opening but I think you'll have the right idea by seeing the cam on the servo arm facing the front with the 3 pirs set 75 degrees apart. I sure hope I can program this cause I really want to see it work...

 

project3Eyes.doc

 

man, had a hard time getting this formatted right to download.....

 

 

George

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

×