Shop OBEX P1 Docs P2 Docs Learn Events
Camera Project Help — Parallax Forums

Camera Project Help

UDCUDC Posts: 11
edited 2005-08-31 14:57 in BASIC Stamp
Hello,
I am modifying a digital camera (Minolta DiMage A2) to take time series photos on the ocean
floor. It will be taking a picture every 4 - 8 hours for a period of 4 months. The timing is variable,
based on the Microdrive size, 4GB=8hrs, 6GB=6hrs and hopefully soon 8GB=4hrs. I am using
a BASIC Stamp 2 and a Pocket Watch B. The Stamp is powering 2 ea 2N2222's, which power
2 ea., 9 vdc relays. 1 relay turns the camera on, 30 second delay for warm up, 2nd relay operates
the shutter, 20 second delay for file writing and then power down the camera and wait for the next
shot. I had a little trouble, possibly with the timing of the astable, in that it would fire twice before
shut down, I think I have solved it, but may be a kludge. Anyway, here are my questions:

1) What are others experiences with the Pocket Watch, how accurate/reliable?

2) Are there better timing devices for the Stamp (DS1302?)?

3) I don't see the Stamps current drop as much as expected during SLEEP, is it my program?
Run=0.49mA, Relay1=7.3mA, Relay2=7.7mA, Sleep=0.39mA

4)I tried working this same circuit using a DG441 CMOS Switch instead of relays, but they never shut off,
any ideas why?

5) Though it's alot to ask, could I get some pointers on programming? Timing is an important aspect, but
as much or more so is power draw, 4 months stand-alone ...
Program attched.

Many Thanks in advance.

Jonathan

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-19 20:28
    1) What are others experiences with the Pocket Watch, how accurate/reliable?
    The docs state the accuracy is better·than ±304 sec/year

    2) Are there better timing devices for the Stamp (DS1302?)?
    Yes, but is a deviation of ±101 seconds per deployment not good enough?

    3) I don't see the Stamps current drop as much as expected during SLEEP, is it my program?
    Run=0.49mA, Relay1=7.3mA, Relay2=7.7mA, Sleep=0.39mA
    Be sure to set unused pins as input, you may also want to configure all pins as input during sleep, then switch them back when you wake up.

    4)I tried working this same circuit using a DG441 CMOS Switch instead of relays, but they never shut off, any ideas why?
    did you include a strap resistor (resistor ~10K tieing the gate to ground)? If you didn't you could have injected charge into the gate of the switch that kept it activated

    5) Though it's alot to ask, could I get some pointers on programming? Timing is an important aspect, but as much or more so is power draw, 4 months stand-alone ...
    Ill leave this to others who have more knowledge of power saving techiques in stamps.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-19 22:53
    One more thing regarding power consumption, place resistors between any unused pins and ground (or Vdd). An input left floating can cause the input to enter a metastable state (neither logic high nor logic low), this causes both of the drive transistors inside the stamp to conduct resulting in extra current consumption.
  • UDCUDC Posts: 11
    edited 2005-04-20 16:41
    >>1) What are others experiences with the Pocket Watch, how accurate/reliable?
    >The docs state the accuracy is better·than ±304 sec/year
    Was wondering more along the lines of real world vs doc

    >>2) Are there better timing devices for the Stamp (DS1302?)?
    >Yes, but is a deviation of ±101 seconds per deployment not good enough?

    It seems like the Stamps Sleep is using an internal clock, my fear is that as I boost the
    sleep count to save power the PW may lose time and the two cancel each other out
    2 months down the road.

    >>3) I don't see the Stamps current drop as much as expected during SLEEP, is it my program? Run=0.49mA, Relay1=7.3mA, Relay2=7.7mA, Sleep=0.39mA
    >Be sure to set unused pins as input, you may also want to configure all pins as input during >sleep, then switch them back when you wake up. Also strap unused inputs.
    Thanks, not a huge saving (0.05mA) but every drop counts

    >>4)I tried working this same circuit using a DG441 CMOS Switch instead of relays, but they >>never shut off, any ideas why?
    >did you include a strap resistor (resistor ~10K tieing the gate to ground)?
    Yes, and just played with it again, to no avail. Think the BS2 just doesn't like·it. I'll try again
    later, the relays work and I'm getting close to launch.

    Much appreciate the help. Guess the programmers felt I was beyond help ... ;-)
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-20 18:56
    Quite a few users have recently been complaining of transistor based latch-up problems as of late. Without access to your circuit, I am afraid I am out of suggestions on this front.

    So that I may gain a little better understanding of your circuit, let me rephrase it as I understand it, and confirm I understand correctly.

    You have a camera deployed underwater for 4 months at a time, at periodic intervals a picture is taken, this interval is critical and must be precise.

    You are correct that there is some difficulty getting a precise sleep interval since SLEEP uses the internal clock reference. My suggestion is to use the long astable alarm feature of the Pocket Watch. Upon powerup the Pocket Watch will not have its alarm activated, thus the alarm level will be logic low, feed this through an inverter then into the reset pin of the Basic stamp. This means the reset pin will be high whenever the alarm is not activated and the stamp will be in full power mode, set the DURATION to one minute and the PERIOD to 4 (8) hours. The stamp will take the picture then execute END, which is like SLEEP but never wakes up on it own. After 4 hours the stamp will be placed into a state of reset for 1 minute then woken back up, take your picture then END. This way your sleep cycles will be 4 (8) hours and 1 minute long according to the time as computed by the Pocket Watch. There are some other ways to configure this if you must be exactly 4 (8) hours.


    Post Edited (Paul Baker) : 4/20/2005 7:05:19 PM GMT
  • UDCUDC Posts: 11
    edited 2005-04-20 19:38
    Your restatement is correct,except "the interval being critical and precise" might be overstating. Interval known and repeated is more how I would say it, though as long as the camera is logging it's metadata then we have a way to match it with other sensors. Blah, blah, you get it,·I'm blathering ...

    Using the reset pin is a great idea! Some point in the future I may work out using an event sensed on another instrument to trigger the camera ... ah the future.

    Thanks for the insights and I'll try and get a postable circuit made up.

    Cheers
  • UDCUDC Posts: 11
    edited 2005-05-05 13:44
    Well, I finally got around to making up a circuit schematic and so far everything is working fine. Going from the breadboard to solder board as we speak. I still find myself lacking in the programming department. I have 2 programs, 1) that sets the Pocket Watch (Timer)·and another that runs the camera (CamCon). I load the Timiner program and then just before it goes off and resets the BS2 I load the Camera Control. Works fine on the bench, but it requires access to the board and power being on all the time. Not a real world method for mounting out at sea.

    Is there a way to combine the programs, so that after the Timer part runs once and starts the Pocket Watch, it then deletes itself and all that's left is the Camera Control part? That way I could load the program, shut down power, button everything up and mount on the platform, then at the appropriate time apply power and it starts and runs ....



    Any help greatly appreciated.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-06 00:19
    You dont need to reprogram the stamp, you can combine the two programs and have an eeprom location which signifies the state. The stamp would be programmed with the location as 0. Your code would examine the location, if the location is 0, then initialize the timer, write 1 to the status location then place the stamp in sleep mode. When it is woken by the timer, it checks the status bit, sees intialization has occured and proceeds to the camera control portion of your code.

    BTW you chose a nice camera, I have the A1 and love it (except I cant figure out how to take macro mode pictures which are in focus).
  • John KauffmanJohn Kauffman Posts: 653
    edited 2005-08-26 19:32
    What is the temperature at the bottom of the ocean? Within range of PocektWatch for its spec accuracy?
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-26 20:12
    John -

    Please define "bottom of the ocean" in terms of feet, meters, leagues, or miles, and also where you are located. It's only inches deep in some places, and miles in others. Where you are also makes a difference in the ocean temperatures. The temperatures within the Altantic Gulf stream can be at least 10-15 degrees warmer than waters imediately surrounding it. I'm sure other areas may have higher localized temperature differentials than that.

    Regards,

    Bruce Bates
  • UDCUDC Posts: 11
    edited 2005-08-28 14:45
    John and Bruce,

    Without getting into the different temperatures ranging across the entire bodies of water on the planet ...;-)

    The areas·I am most interested in are coastal, max depth as rated by the current "can" I am using is 100 meters. I work for the U.S. Geological Survey and the majority of our work is the coastal waters of the mainland US, meaning temperate waters. I would hazard that almost all of my work will be warmer than the -10 C the PocketWatch is rated for.

    Version 2 of the camera system will be coming out of the water at the end of Sept. Version 1 using a Tattletale 4 came out in May and did not fair too well. Had some minor leakage, but seems like enough to cause problems with the electronics. It worked, per se, but not as planned. Timing and number of shots were off. Though it did take pictures and that's a plus. For other reasons we had to dive on the site and took a look at this one and did not see any water in the housing ... Yahoo!

    Will post comments and pictures if Sept is a success, comments only if not ... ;-)

    Cheers, Jonathan
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-28 15:52
    Jonathan -

    Your request still lacks some specificity, but in spite of that, you may find the following NOAA tables helpful. These are unfortunately monthly surface temperates, by month, for all the coastal regions of the United States. I suspect at depth temperatures can probably be extrapolated from that. Here is the link to the NOAA data:
    ··· http://www.nodc.noaa.gov/dsdt/cwtg/

    In investigating the data they're offing there, it's measured only at a 4 foot depth which is certainly less than optimal for your purposes. Additionally, that is apparently fairly raw data which hasn't been checked for errors.

    Here is a NOAA world ocean temperatures link which may be more appropriate if you zoom in on the area you're interested in. It should give you better at depth temperatures:
    ··· http://www.nodc.noaa.gov/OC5/indprod.html

    I hope that is helpful.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 8/28/2005 3:51:55 PM GMT
  • UDCUDC Posts: 11
    edited 2005-08-28 16:13
    Bruce,

    For you, I went and checked our records. The lowest temperature I have for this site at a depth of 104 feet
    is 3.467 degrees C. Still far above the - 10 C listed as the PocketWatch's lowest operating temp. Bottom of the ocean is relatively constant (and yes there are extremes and I don't plan to put down on a black smoker!). My read is that bottom temp will not be a major factor in reliablity of the Stamp and PocketWatch, although I do agree that it is a factor as well as with the batteries and should be considered.

    Jonathan
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-28 18:10
    JPL is using a BASIC Stamp (OWL2pe) to control a robotic arm for a sampler on the ocean floor near Antarctica, around volcanic vents. I don't recall what they told me about the temperature, but it was not extreme. Pretty close to 0 deg C, but highly variable near the vents as you might expect. The critical issue they faced more had to do with pressure. They were testing at 10,000 psi, 6.5 kilometer depth, and were concerned with the hermetically sealed Murata crystal, metal on ceramic. They perfer the epoxy packaged Epson crystals for reliability at those pressures.

    If you are concerned with accuracy of timing, consider the Dallas DS32khz. It is an ultrastable 32khz osciillator that can drive a real time clock chip. I think they are coming out with an RTC that has the DS32khz built in. The Pocket Watch is a PIC chip that runs all the time (?), and is therefore not a micropower option. It may be that a DS1302 or DS1307 is a much better option if current consumption is as big an issue as you say.

    You asked, <<I don't see the Stamps current drop as much as expected during SLEEP, is it my program?
    Run=0.49mA, Relay1=7.3mA, Relay2=7.7mA, Sleep=0.39mA>>

    Take a look at this URL: emesystems.com/BS2power.htm
    There are well known tricks for minimizing the current in the Stamp. This applies after you have taken care of external current hogs, and proper pin levels. Especially in the original BASIC Stamp, you have to adjust your final program code in a way that puts the SLEEP instruction on a byte boundary in the eeprom. That makes the difference between 390 microamps and 50 microamps. If you go for one of the multibank Stamps, the BS2pe is the champ for low current drain.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-08-28 18:36
    Tracy beat me to the punch.· =)· I was going to ask why you're not using a DS1302.· It's also a smaller package size, has a battery backup option, extra RAM (Which is also backed-up) and is very easy to program and use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • UDCUDC Posts: 11
    edited 2005-08-31 14:57
    Tracy and Chris,

    Thanks much, for the info. I am waiting on v3 until v2 comes home. If everything held together, then v3 may be
    very close to 2. If not then look at changing to the DS1302/07. That route was and still is considered. Original battery
    size was based on the consumption of the TT4, so it "should" be overkill for the BS2. But real life can always find a
    way to kick a little ...
Sign In or Register to comment.