+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31

Thread: I need help making a servo open a hatch for a period of time then closing. Once a day

  1. #21

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    Look at pictures of R/C servos if you haven't already. They have either a disc mounted on the shaft or a cross-like "4-horn" adapter, either shape with holes for piano wire which becomes the "push rod". As the servo shaft turns, the piano wire can push / pull the door so it opens and closes. The "What's a Microcontroller?" tutorial and the "Robotics with the BoeBot" tutorial discuss how servos work and gives lots of examples. Both are included in the help files when you install the Stamp Editor which includes the Parallax Basic compiler. You can also download the tutorials by going to Parallax's main webpage and clicking on the Downloads button. On the downloads page, these will be under "Educational Tutorials & Translations". You can also download the "Basic Stamp Syntax and Reference Manual" under "Stamp Documentation". To wait 24 hours, you'd do:
    Code:
    hours   var   byte
    minutes   var   byte
    seconds   var   byte
    
    for hours = 1 to 24
       for minutes = 1 to 60
          for seconds = 1 to 60
             pause 1000
          next
       next
    next
    To move the servo through somewhere from 90 to maybe 120 degrees you'd do:
    Code:
    servo   pin   1   ' or whatever I/O pin the servo is connected to
    count   var   byte
    
    for count = 1 to 50   ' allow 1 second for the servo to move to the open position
       pulsout   servo, 500   ' this number could be as low as 250 depending on the servo
       pause 20   ' servos need about 20ms between pulses
    next
    for seconds = 1 to 15   ' whatever number of seconds the door should be opened
       pause 1000
    next
    for count = 1 to 50   ' again, allow about 1 second for the servo to move to closed position
       pulseout servo, 1000   ' this number could be as high as 1250 depending on the servo
       pause 20  ' servos need a 20ms pause between successive pulses
    next
    Somewhere in your program's initialization, you'd need to make sure the door is closed. Have
    another copy of the last 4 lines above to do this.

  2. #22

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    I have done some research and found its complicated to use a basic stamp as a long term timer due to errors. Is there a different controller that would work the best?
    Never mind this post.

  3. #23

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    It's not really complicated. I had an application very similar to yours except that I had to turn on a drainage pump roughly every 24 hours for one minute. I used a BS1 I had around ... worked great. The time would drift. The program was a little different and adjusted for the time the pump was on. You'd turn it on, the pump would run, then wait until 24 hours later and repeat. If the time drifted too much, all you had to do was to turn it off and on when you wanted it to start over again. Over a week, it drifted a couple of minutes.

  4. #24

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    What if you used something like this http://www.amazon.com/Fish-Mate-F14-...pd_sim_sbs_k_3 in conjunction with your stamp by modifying the compartments and the stamp auto loading the crickets? Lets face it..the BS2 is horrible at keeping time.
    Improvment....prototyping....radical development....call it whatever u want
    I call it "Having fun til it breaks...then makn it harder to break"

  5. #25

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    Quote Originally Posted by tobdec View Post
    Lets face it..the BS2 is horrible at keeping time.
    A couple minutes drift over a week (per Mike Green) is not horrible at all in my opinion, pretty good actually.

  6. #26

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    If you haven't chosen a microcontroller yet, you ought consider the Propeller. I think it would be a better time keeper and it could easily interface with a real time clock module or even a GPS unit (a BS2 could also be used with a RTC or GPS). Plus you can buy two Propeller QuickStart boards for about the same price as one BS2. They're even less expensive than a BS1 (and way more powerful).

  7. #27

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    The middle of the day is easier to determine than "once a day". you could have your BS2 activate the door an ammount of time after sunrise, determined by a solar cell or similar sensor outside. A solar cell could also be used to charge batteries if you don't want to plug it in to the wall. I suppose it all depends on if you live in Alaska or Arizona how much sun you get each day... lol. Other inexpensive time keepers include lighting timers like you would use for turning on and off house lights while you are away.

  8. #28

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    The problem is, sometimes he need it for 1-2 weeks. I could do it for one day but even a few days is tough because it needs to be alive. There are timers that can be used. All I would need to do regulate the current and build the holding box for the crickets. What do y'all think?

  9. #29

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    Have y'all heard of the seconds timer from mistking? Do you think that I could use it to power a motor instead of a mister?
    Last edited by greenanole; 05-15-2012 at 12:03 AM.

  10. #30

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    The problem you'll have no matter what kind of timer you use is the need to control the motor.

    Servos, are very easy to use with a microcontroller.

    I don't know how precise time kept by a Propeller wouild be but it should keep it will enough it keep your friends reptile happy.

    You could use QuickStart board and use its LEDs as a binary countdown to feeding time. If the time were noticeably off, you could use the touchpads to correct the time.

    I used the QuickStart's touchpads as inputs to control a servo in my QuickStart servo tester. I also used its LEDs as a way to indicate the various parameters of the tester.

  11. #31

    Default Re: I need help making a servo open a hatch for a period of time then closing. Once a

    The mist king seconds timer is used to power a pump continuously. Not turn a motor this way then that way. How about when the timer goes off, it triggers a vacuum of some sort that pulls them into the cage. That way I would have an idea of how many crickets went in instead of assuming that they were just going to fall, which they might not.

+ Reply to Thread

Similar Threads

  1. Serial Servo: Making a servo more intelligent
    By Rayman in forum Robotics
    Replies: 29
    Last Post: 11-11-2010, 11:56 AM
  2. Making More Time???
    By Bryce W in forum Learn
    Replies: 1
    Last Post: 08-29-2009, 01:58 AM
  3. Open two SD files at the same time?
    By Rayman in forum Propeller 1 Multicore Microcontroller
    Replies: 7
    Last Post: 01-05-2008, 10:58 AM
  4. How to code a rolling time period?
    By wolff in forum BASIC Stamp
    Replies: 4
    Last Post: 05-11-2006, 06:31 AM
  5. BS2 decision making time
    By Archiver in forum BASIC Stamps Archive
    Replies: 8
    Last Post: 08-10-2003, 11:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts