Maker Pro
Maker Pro

555 timer circuits for digital camera trigger

D

DorkyGrin

I've got a digital camera that I am trying to connect to a motion
sensor. I've disassembled it and have the wires available to wire into
a circuit. I have three relays. I need a circuit to trigger the camera
in this fashion:

1. Receive signal, activate Relay A and hold for 10 seconds
2. Same signal, after a couple of seconds, activates Relay B for 5
seconds
3. Same signal, after a couple of seconds, activates Relay C for 2
seconds
4. Then reset all relays for next event

These steps simulate Power, Focus and Shutter.

It's been awhile since I've worked with 555 timers, but I think tying
them together in a circuit might be the simplest way to make this
happen. I believe a 555 timer configured as a monostable one-shot
could be used for Relay A. What I'm not sure about is steps 2 and 3,
maybe a 556 timer that has some sort of startup delay?

Or would this project be easier with some sort of PIC?

Open to ideas.

Thanks
 
J

Jan Panteltje

I've got a digital camera that I am trying to connect to a motion
sensor.

These steps simulate Power, Focus and Shutter.

Or would this project be easier with some sort of PIC?

Yes.

OTOH many digital cameras have an USB interface, and there exists a protocol
(PTP mode) that these days many cameras support, to take a picture.
So a small Linux computer, running perhaps gphoto2 software, with some
sensor interface with USB PIC perhaps, more complicated.....
All depends.
 
D

DorkyGrin

Or would this project be easier with some sort of PIC?
Yes.

OTOH many digital cameras have an USB interface, and there exists a protocol
(PTP mode) that these days many cameras support, to take a picture.
So a small Linux computer, running perhaps gphoto2 software, with some
sensor interface with USB PIC perhaps, more complicated.....
All depends.


I was thinking 555 or PIC because of size requirements (needs to be
portable and run off a 6-12v battery). I had not considered USB.
Hummm...

Are there any PICs that don't require a steep learning curve for
programming? Something like a PIC for dummies?
 
D

default

I've got a digital camera that I am trying to connect to a motion
sensor. I've disassembled it and have the wires available to wire into
a circuit. I have three relays. I need a circuit to trigger the camera
in this fashion:

1. Receive signal, activate Relay A and hold for 10 seconds
2. Same signal, after a couple of seconds, activates Relay B for 5
seconds
3. Same signal, after a couple of seconds, activates Relay C for 2
seconds
4. Then reset all relays for next event

These steps simulate Power, Focus and Shutter.

It's been awhile since I've worked with 555 timers, but I think tying
them together in a circuit might be the simplest way to make this
happen. I believe a 555 timer configured as a monostable one-shot
could be used for Relay A. What I'm not sure about is steps 2 and 3,
maybe a 556 timer that has some sort of startup delay?

Or would this project be easier with some sort of PIC?

Open to ideas.

Thanks

Picaxe to the rescue! Check them out. The 8/14/20 pin basic (M
series) versions only require a serial port or usb to serial cable to
program.

The basic language software is free. The parts go for ~$3-4. They are
a snap to use - almost no learning curve. A/D converters with 8 or 10
bit resolution, PWM output, runs on 2-5 volts in the microamp range.

I'm using them for time lapse cameras among other things. It sits
there waiting for the sun to come up, then snaps pictures at an
adjustable interval (using a pot). All the timing is done in the
'axe. I even count the pictures and slightly lengthen the time the
camera stays on, so they get into memory - as the card fills up the
camera needs more time. Camera runs for 10+ days and takes 1,000+
shots in high res JPG format - 0n 3 AA rechargeable cells (3.6V).

I'm using one 8 pin version on one camera and one 14 pin chip on
another. Pins are assignable as input or output. The 14 and 20 still
have assignable pins but they default to inputs or outputs without a
program command.

They sell all kinds of fancy hardware but all you really need is the
PC and serial cable or USB adaptor and three resistors to program it.
A solder less breadboard is nice too.

Use 4.5 volts - they are damned serious about the 5 volt absolute
maximum and batteries are convenient. Anderson (below) is probably
still including programming resistors with the purchase of the 'axe.


Official site (download software and manuals)
http://www.rev-ed.co.uk/picaxe/

Best cheapest fastest place to get them in the US
http://www.phanderson.com/picaxe/index.html

another good fast inexpensive
http://www.sparkfun.com/commerce/product_info.php?products_id=8322

The forum - these guys can answer most any question you have and the
manufacturer monitors and participates
http://www.picaxeforum.co.uk/forumdisplay.php?f=2
 
S

Scott Seidman

I've got a digital camera that I am trying to connect to a motion
sensor. I've disassembled it and have the wires available to wire into
a circuit. I have three relays. I need a circuit to trigger the camera
in this fashion:

1. Receive signal, activate Relay A and hold for 10 seconds
2. Same signal, after a couple of seconds, activates Relay B for 5
seconds
3. Same signal, after a couple of seconds, activates Relay C for 2
seconds
4. Then reset all relays for next event

These steps simulate Power, Focus and Shutter.

It's been awhile since I've worked with 555 timers, but I think tying
them together in a circuit might be the simplest way to make this
happen. I believe a 555 timer configured as a monostable one-shot
could be used for Relay A. What I'm not sure about is steps 2 and 3,
maybe a 556 timer that has some sort of startup delay?

Or would this project be easier with some sort of PIC?

Open to ideas.

Thanks

You're trying to implement a state machine, and need some memory
components-- flip flops and such. Not terribly difficult if you have a
basic understanding of digital circuits. Much easier to put together
with a small PIC, assuming all your development tools are in place. If
not, its a great small project with which to learn the environment.
 
D

DorkyGrin

Picaxe to the rescue!  Check them out.  The 8/14/20 pin basic (M
series) versions only require a serial port or usb to serial cable to
program.

The basic language software is free.  The parts go for ~$3-4. They are
a snap to use - almost no learning curve. A/D converters with 8 or 10
bit resolution, PWM output, runs on 2-5 volts in the microamp range.

I'm using them for time lapse cameras among other things.  It sits
there waiting for the sun to come up, then snaps pictures at an
adjustable interval (using a pot).  All the timing is done in the
'axe.  I even count the pictures and slightly lengthen the time the
camera stays on, so they get into memory - as the card fills up the
camera needs more time.  Camera runs for 10+ days and takes 1,000+
shots in high res JPG format - 0n 3 AA rechargeable cells (3.6V).

I'm using one 8 pin version on one camera and one 14 pin chip on
another.  Pins are assignable as input or output.  The 14 and 20 still
have assignable pins but they default to inputs or outputs without a
program command.

They sell all kinds of fancy hardware but all you really need is the
PC and serial cable or USB adaptor and three resistors to program it.
A solder less breadboard is nice too.

Use 4.5 volts - they are damned serious about the 5 volt absolute
maximum and batteries are convenient.  Anderson (below) is probably
still including programming resistors with the purchase of the 'axe.

Official site (download software and manuals)http://www.rev-ed.co.uk/picaxe/

Best cheapest fastest place to get them in the UShttp://www.phanderson.com/picaxe/index.html

another good fast inexpensivehttp://www.sparkfun.com/commerce/product_info.php?products_id=8322

The forum - these guys can answer most any question you have and the
manufacturer monitors and participateshttp://www.picaxeforum.co.uk/forumdisplay.php?f=2

Seems like that PICAXE might be just the ticket. Probably easier then
trying to cascade a bunch of 555's. And it sure it cheap enough. I'll
take a look at the software and try to get an idea how hard it would
be to write the code. Thanks for the tips.

Are of lots of examples of picaxe code out there?

Thanks again

DG
 
M

mpm

I've got a digital camera that I am trying to connect to a motion
sensor. I've disassembled it and have the wires available to wire into
a circuit. I have three relays. I need a circuit to trigger the camera
in this fashion:

1. Receive signal, activate Relay A and hold for 10 seconds
2. Same signal, after a couple of seconds, activates Relay B for 5
seconds
3. Same signal, after a couple of seconds, activates Relay C for 2
seconds
4. Then reset all relays for next event

These steps simulate Power, Focus and Shutter.

It's been awhile since I've worked with 555 timers, but I think tying
them together in a circuit might be the simplest way to make this
happen. I believe a 555 timer configured as a monostable one-shot
could be used for Relay A. What I'm not sure about is steps 2 and 3,
maybe a 556 timer that has some sort of startup delay?

Or would this project be easier with some sort of PIC?

Open to ideas.

Thanks

Wow. This smells like a nightmare in the making.
My first thought is what happens when the focus doesn't snap first
time.
Will this un-synch the whole contraption?
 
D

default

Seems like that PICAXE might be just the ticket. Probably easier then
trying to cascade a bunch of 555's. And it sure it cheap enough. I'll
take a look at the software and try to get an idea how hard it would
be to write the code. Thanks for the tips.

Are of lots of examples of picaxe code out there?

Thanks again

DG

There's tons of examples. The forum is rife with them. All you're
doing, according to your post is sequential timing functions.

The code would look something like
high 4 'make pin 3 (logical output #4) high
pause 10,000 'wait for 10 seconds (10,000 milliseconds)
high 2 'turn on pin 5 (output #2)
pause 'etc.

To turn off, it is low 4 etc.

I use a A/D input to read a pot and adjust the pause time.

One of my outputs is a 40 KHZ 10% duty PWM that I use to toggle an
inductor to make a small low power bias supply to turn on a mosfet.

Regarding your camera - the ones I've played with just require an open
collector to pull the switch signal to ground to actuate the functions
- no relays necessary. But its all in how you want to do it - I
wanted everything including the camera to work from one battery. The
mosfet pulls the camera minus low to provide camera power.

There's a book called "programming and Customizing the Picaxe" by
David Lincoln ISBN # 0-07-145765-8. The book is OK - the table of
contents don't agree with the content page numbers, and they'd added
the 14M and 20M since the book was published.

Download the two part manual from the revved site and you'll see how
easy it can be.

I have next to no programming experience and had no trouble using it.
I like messing with it now.
 
D

DorkyGrin

There's tons of examples.  The forum is rife with them.  All you're
doing, according to your post is sequential timing functions.

The code would look something like
high 4          'make pin 3 (logical output #4) high
pause 10,000    'wait for 10 seconds (10,000 milliseconds)
high 2          'turn on pin 5 (output #2)
pause 'etc.

To turn off, it is low 4 etc.

I use a A/D input to read a pot and adjust the pause time.

One of my outputs is a 40 KHZ 10% duty PWM that I use to toggle an
inductor to make a small low power bias supply to turn on a mosfet.

Regarding your camera - the ones I've played with just require an open
collector to pull the switch signal to ground to actuate the functions
- no relays necessary.  But its all in how you want to do it  - I
wanted everything including the camera to work from one battery.  The
mosfet pulls the camera minus low to provide camera power.

There's a book called "programming and Customizing the Picaxe" by
David Lincoln ISBN # 0-07-145765-8.  The book is OK - the table of
contents don't agree with the content page numbers, and they'd added
the 14M and 20M since the book was published.

Download the two part manual from the revved site and you'll see how
easy it can be.  

I have next to no programming experience and had no trouble using it.
I like messing with it now.


Wow, lots of resources, downloaded and looked at the manual last
night. Good stuff.

I'm going to order a 14m and an 8m and play with them.

Are there any components necessary for a to protect a picaxe input pin
to sense
a signal from my motion sensor?

OK to email me directly. dorkygrin at yahoo

Thanks!
 
D

default

Wow, lots of resources, downloaded and looked at the manual last
night. Good stuff.

I'm going to order a 14m and an 8m and play with them.

Are there any components necessary for a to protect a picaxe input pin
to sense
a signal from my motion sensor?

OK to email me directly. dorkygrin at yahoo

Thanks!
No pin can exceed the supply voltage of the axe. If it might go
higher you have to use a voltage divider or clamp it with a diode or
both.

It was more hassle for me to get the USB to serial adapter recognized
by Windows than it was to get the axe to blink a led. There's a
debugger built into the "program editor" software - it toggles the
RS232 output line high and low. That proved invaluable in getting the
USB working for me. You click on a led on the PC screen to toggle the
line high and low, and can monitor it with a voltmeter on the
breadboard.
 
D

DorkyGrin

No pin can exceed the supply voltage of the axe.  If it might go
higher you have to use a voltage divider or clamp it with a diode or
both.  

It was more hassle for me to get the USB to serial adapter recognized
by Windows than it was to get the axe to blink a led.  There's a
debugger built into the "program editor" software - it toggles the
RS232 output line high and low.  That proved invaluable in getting the
USB working for me.  You click on a led on the PC screen to toggle the
line high and low, and can monitor it with a voltmeter on the
breadboard.


I'm just going to use serial, that eliminates the USB issue!

As for the trigger, I'll have to think about that as the motion sensor
output will probably run from a different power supply. That might be
an issue even if that voltage were 5v or less. Hummmmm....

Ever ordered picaxe stuff from here?: http://www.world-educational-services..net/cart/
 
D

default

I'm just going to use serial, that eliminates the USB issue!

As for the trigger, I'll have to think about that as the motion sensor
output will probably run from a different power supply. That might be
an issue even if that voltage were 5v or less. Hummmmm....

Ever ordered picaxe stuff from here?: http://www.world-educational-services.net/cart/


No. Two reasons. Cost. Last time I checked they wouldn't sell a few
picaxes without a $8 handling fee due to minimum order constraints and
their shipping was higher.

Anderson was only charging a couple of bucks for shipping with no
minimum. (sparkfun and ebay were also cheap in that respect)

Reason two was Anderson maintains circuits, code and useful glue parts
at a reasonable cost. He also ships faster than spark or ebay. I
don't know how fast world-ed is.

Open collectors can work - tie an NPN transistor to ground turn on the
base with the axe and it pulls the collector low - this assumes both
circuits have negative grounds - the OC protects the axe - read the
manual they show how to do it. If in doubt, post your schematic to
the forum and ask for suggestions. ditto code.
 
D

default

Whats the full story on the PIC vs PICAXE? I am looking at an
application using 12F675 or 12F629. I see the PICAXE-08 is same as
12F629 but with different bootstrap program.

I don't know the "full story." The 'axe has a programmed in boot
loader - its only claim to fame. You pay extra for that, over the
bare pic. The advantage is it allows easy programming in Basic and
you don't need a development system - a solderless breadboard is all
it takes in that respect.

Can you clone the boot loader? I don't know. Reved makes their money
and maintains the educational info on their profit, so don't expect
them to give you that.

Kicchip is another company trying to do the same thing as reved but
they don't sell in the US and seem to be having some start up
problems.

Arduino is an open source version using a more sophisticated pic with
lots more capability - but the boards cost $13 and up (similar to
basic stamp but program in basic and C.

The basic Arduino chip with the boot loader is ~$6
1) Can I use the same programmer for the Microcode PIC as for the
PICAXE? The cost of entry to experiment with the Microcode compiler
seems very pricey compared to PICAXE.
No you can't use the programmer because the 'axe bootloader is
proprietary.
2)Do I even need a programmer? Or can I program in-circuit with a cable?

I would guess you'd need something like a programmer but- there are
some open source attempts to program using an Axe to work as the
loader for a bare pic - I haven't kept current but you can search for
it.
31) Will the PICAXE-08 run over same operating voltage as the PIC? I ask
this because their is a disclaimer about a 4.2V brownout setting. I
don't need Brownout protection but need to run at 2.7 to 3.3 volt range.

I run my 08M at 2.7 in one camera - 3 volt supply (2-AA) and one
germanium diode to isolate it from the camera. (camera sucked down
the supply rail when it turned on, and would reset the axe - causing
it to oscillate on and off)

The spec I saw said 2-5 volts and I can run at 2.4 when the battery is
low. Programming should or must be done at ~4.5 or more due to
voltage levels on the serial port. I use 4.5 and it seems to program
fine at 3 volts also . . .

The brownout in the chip can be over written in programming but I
haven't fooled with it and use low voltages with no problems.
 
J

Jan Panteltje

I was thinking 555 or PIC because of size requirements (needs to be
portable and run off a 6-12v battery). I had not considered USB.
Hummm...

Are there any PICs that don't require a steep learning curve for
programming? Something like a PIC for dummies?

Sorry for the late reply.
I did see some recommend custom solutions like pic-axe (spelled right?).

In my view it is much better to just take the time, and learn PIC asm.

You will, as electronics person, work close to the hardware,
and really, writing a delay loop in asm is just as simple, and a lot more versatile,
then doing it in some higher language.

You will want to write to IO ports, read AD the converter, do interrupts too, later.

Learning curve? There is always one.
If you _ever_ programmed in a language, say BASIC or whatever, then
you understand the idea of having something execute your instructions.
In such a case learning PIC asm (or any other asm) is just having a good read of
the data sheets, the instruction set, and start with something simple like lighting a LED
for example.

There are lots and lots of examples for asm on the Microchip website,
and the cheapest programmer is less the 50 $ IIRC.
 
R

Rich Grise

As for the trigger, I'll have to think about that as the motion sensor
output will probably run from a different power supply. That might be
an issue even if that voltage were 5v or less. Hummmmm....

That's what optoisolators are for. :)

Cheers!
Rich
 
D

default

That's what optoisolators are for. :)

Cheers!
Rich

My own application - running at low voltages - the optos I tried had
too much VCEsat to work with a mosfet on the camera's minus (raising
the whole camera above ground slightly).

The hardware problems and work-arounds are due to the low voltages -
with as much as 5 volts to play with, they'd probably vanish.
 
D

DorkyGrin

My own application - running at low voltages - the optos I tried had
too much VCEsat to work with a mosfet on the camera's minus (raising
the whole camera above ground slightly).

The hardware problems and work-arounds are due to the low voltages -
with as much as 5 volts to play with, they'd probably vanish.

Rich - thanks for the optoisolator tip, that's exactly what I need to
do, assuming I have enough voltage.

This is coming together nicely.

Default -

HOLY COW! You were right, this pixaxe is way cool. I'm lovin' it.

I downloaded the software and very quickly wrote the following
program:

========
main:
if pin1 = 1 then takepic

goto main

takepic:
high 2 'make pin 1 (logical output 2) high ** power relay **
pause 3000 'wait for 3 seconds (2000 milliseconds)
high 3 'turn on pin 2 (logical output 3) ** focus relay **
pause 2000 'wait for 2 seconds
high 4 'turn on pin 3 (logical output 4) ** shutter relay **
pause 1000 'wait 1 seconds

low 4,3
pause 2000
low 2 'reset to normal, wait for next event
=======

Looks great in the simulator. I've already ordered a starter kit and a
couple of extra chips. Should
be here by the weekend. Good stuff for what I'm doing.

So, if my motion sensor keeps sending 'events', I think that would
keep pin1 high (I'm not exactly sure
until I test it, unless someone can tell me how it might work). Then I
suppose I could write in a loop to
keep checking the status of pin1 ... and if it is still high within x
seconds, then I could keep hitting the
shutter relay.

How much current does a picaxe draw when running waiting to execute?
Gotta start thinking about power
requirements.

Thanks again folks for your assistance. Guess I need to start posting
in the picaxe forum now. ;-)
 
D

default

On Wed, 1 Oct 2008 19:38:23 -0700 (PDT), DorkyGrin

Glad you're enjoying it - get on the forum now and introduce yourself
as a newbie and tell them what you intend and ask questions there.
Like I said, I'm no programming wizard. My moniker is "flooby"
Looks great in the simulator. I've already ordered a starter kit and a
couple of extra chips. Should
be here by the weekend. Good stuff for what I'm doing.

So, if my motion sensor keeps sending 'events', I think that would
keep pin1 high (I'm not exactly sure
until I test it, unless someone can tell me how it might work). Then I
suppose I could write in a loop to
keep checking the status of pin1 ... and if it is still high within x
seconds, then I could keep hitting the
shutter relay.

The 8 and 14 M chips can both be programmed to use interrupts - where
an external event can be read(tested) while the program is processing.

The code looks like
SETINT (condition) mask
or
SETINT %00010000, %00010000 'enable interrupt on pin 4 high

It is used in conjunction with a loop before going back to the main
program - you could, for instance, write a variable to remember the
state and have your program check it (write just a single bit variable
in this case) to determine how to proceed with the timing

Words, bytes, and bits, are different length variables, b0 is a
variable byte - sixteen bit variables can be written and read in
"word" zero; word zero also comprises bytes zero and one - so they
can't be used more than once.

Does that make sense?

BTW you can also put a variable into (high) memory locations so that
it is written into memory in a part of the flash memory that your own
program doesn't occupy - that way it "remembers" the variable while
the power is off. Upon startup, or in the program, you can then go
back and retrieve the variable. I do that to count total pictures
taken.

My camera is water proof and goes on the kayak - when I'm out of the
boat I don't want it snapping pictures of the same weeds on the bank,
so turn it off and on.

I use a magnet on the outside of the watertight case to actuate a reed
switch inside - some day I plan to see if I can't make it use an
infrared communicator so I can change the delay time without opening
the case.
How much current does a picaxe draw when running waiting to execute?
Gotta start thinking about power
requirements.

Power is an ongoing and much debated thing on the forum. The actual
power would have to be measured since the chips are variable in that
respect (some use a little more than others)

In sleep mode (like pause, but you can't be processing while sleeping)
its only a few micro amps - but while running it is only a milliamp or
so.

Power depends on voltage too (naturally).

There are tricks you can use to minimize current drain. One is to
change the clock frequency - the slower the clock the less power used.
The procedure is in the manual - you "poke" (peek and poke) a number
into an internal register to set the frequency divider on the clock to
change the speed. That also has the effect of changing the length of
pause and other commands like the pwm and communications (serial
in/out baud rate).

Another trick is to turn off the brownout monitor to save a little
power.

All in the manual. But if you do nothing at all you won't use a lot
of power - the only concession I'm making to save power is to put it
to sleep for 15 minutes at a time to recheck the light level so it
doesn't use power when it is too dark to take photos - and get 10+
days out of AA batteries - same batteries that power the camera.
 
R

Rich Grise

How much current does a picaxe draw when running waiting to execute?

I have no idea. ;-)
Gotta start thinking about power
requirements.

Well, if it's got a "sleep" mode, you might be able to bring it way
down, then, if it's got interrupts, and a "wake on interrupt" feature,
then you could save power by sleeping until you get the "shoot" signal.
Thanks again folks for your assistance. Guess I need to start posting
in the picaxe forum now. ;-)

Well, let us all know how it works out.

Can it take a picture of itself? ;-)

Cheers!
Rich
 
R

Rich Grise

All in the manual. But if you do nothing at all you won't use a lot
of power - the only concession I'm making to save power is to put it
to sleep for 15 minutes at a time to recheck the light level so it
doesn't use power when it is too dark to take photos - and get 10+
days out of AA batteries - same batteries that power the camera.

Hey, if the whole schmear is running off one set of batteries, then
isolation becomes moot. And an opto can take 10-20 mA (albeit, it
doesn't have to be for very long); so I'd figure out how to not need
isolation.

Cheers!
Rich
 
Top