Shop OBEX P1 Docs P2 Docs Learn Events
Newbie to Servos/programming - small project — Parallax Forums

Newbie to Servos/programming - small project

DriviumDrivium Posts: 6
edited 2013-07-25 16:25 in BASIC Stamp
Interested in purchasing this kit: http://www.parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/ProductID/313/List/0/Default.aspx?SortField=ProductName,ProductName

Does this board support multiple types of input monitoring? For example, I'd like to be able to program this to monitor a temp & level setpoint. Is there a separate (small as possible) thermal wire and/or level indicator switch I can hook up to this? I'd be using this to control a small valve. The fact that this runs from a 9v is perfect, because I want this to be self-contained.

Again, new to this, so my terminology may be inaccurate. I read up on some basic programming (I program VB at work and it looks quite similar),so I am confident I can do this. I just want to make sure I have all of the components I need to accomplish my task. This will be a learning project.

thx

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-24 08:20
    Welcome to the forums. The kit you showed has most of the parts you'll need. Here's a temperature sensor that might work. You'll need to encapsulate it if you need to measure the temperature of a liquid. Parallax has a liquid level sensor that will work if the size is right. It depends on the details of what you want to sense. The Single Relay Board can be controlled by the Stamp and can turn on and off pretty much any valve, AC or DC. If it's a low power DC valve, you won't need the relay and the transistor in the kit can be used to switch the valve on and off.
  • DriviumDrivium Posts: 6
    edited 2013-07-24 08:47
    Ok, it sounds like I'm on the right track. So, this single relay board is needed to accomplish what I want? Also, is this servo capable of turning multiple times? Here is my vision, I'd attach this to a knob on a single knob tub and with the push of a button or flip of a switch on the device, it would open a valve and start flowing water into the tub. When a level setpoint is reached, it would turn back to starting position (off). But, I would need it to also monitor temp and adjust knob until temp range is achieved. So it's not quite as simple as On or OFF...
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-24 09:04
    You need the relay board if the valve takes more current than the transistor can handle (about 200mA). You could use a different transistor, but the relay board is ready-to-go and can handle AC or DC over 10A. Parallax also carries the 3-pin cables that make it easy to connect the relay board and the Stamp board.

    Most standard servos will turn 180 to maybe 240 degrees. There are servos (called "winch servos") that will turn maybe 3 times. These are used to make winches on model sailboats.

    The servo supplied with the kit may not have enough torque for this kind of application. There are others on the market with much more torque. SparkFun just started carrying a range of sizes.

    If you do use a servo motor to control the valve and don't use an electronic valve, you won't need the Relay Board.
  • DriviumDrivium Posts: 6
    edited 2013-07-24 09:09
    Ok. I need the servo to be as small as possible, yet have enough torque that can turn a knob that may be tough to turn from off position (as bath knobs can sometimes be). Are there any in particular you can point me to that meet this criteria? Also, I edited my previous post to inlcude this criteria: "But, I would need it to also monitor temp and adjust knob until temp range is achieved. So it's not quite as simple as On or OFF... " Does this change the components I'll need? thx so much - your replies have already been of great help.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-24 10:23
    Maybe someone else will have some suggestions other than that you'll have to experiment. A lot depends on the specifics of the valve. Those that use a cartridge and control both the flow and mix often have a much better controlled maximum torque needed than old fashioned valves.
  • ercoerco Posts: 20,256
    edited 2013-07-24 10:41
    "Don't throw out the baby with the bathwater!" is my friend's favorite quote.

    Post #1 says "yay, 9V"... don't expect any actuator to be powered by a small 9V battery. Electronics, maybe. You may need significant current. Expect to use a big battery or wall wart for sufficient power.
  • DriviumDrivium Posts: 6
    edited 2013-07-24 10:50
    lol@ "Yay"

    My goal is to design a set up to literally attach the servo to the knob, or unscrew the knob and attach to the valve stem. I want to be able to move this to any single-knob bath and have it work. But, I'll figure out THAT part. :) Just need to make sure I have something powerful enough. But, has to be small and battery powered. If not by 9v, battery power of some type.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-24 11:40
    Mike Green wrote: »
    Most standard servos will turn 180 to maybe 240 degrees.

    I don't know if the servo Parallax sells moves this much but in my experience it's relatively rare for a hobby servo to move even 180 degrees. Many servos travel limits are closer to 90 degrees.
    Drivium wrote: »
    Ok. I need the servo to be as small as possible, yet have enough torque that can turn a knob that may be tough to turn from off position (as bath knobs can sometimes be).

    I don't think you're going to get this right on your first try. You could attempt to measure the torque required to turn the knob but I bet there's going to be a lot of trial and error testing with this project. I have some links to a few of my favorite servos in post #10 (IIRC) of my index (see signature).
    Drivium wrote: »
    My goal is to design a set up to literally attach the servo to the knob, or unscrew the knob and attach to the valve stem. I want to be able to move this to any single-knob bath and have it work. But, I'll figure out THAT part. :) Just need to make sure I have something powerful enough. But, has to be small and pattery powered. If not by 9v, battery power of some type.

    In case you haven't guessed, this is going to be a lot easier said than done. Good luck with it and I hope you keep us updated with your progress.
  • PublisonPublison Posts: 12,366
    edited 2013-07-24 13:16
    Drivium wrote: »
    lol@ "Yay"

    My goal is to design a set up to literally attach the servo to the knob, or unscrew the knob and attach to the valve stem. I want to be able to move this to any single-knob bath and have it work. But, I'll figure out THAT part. :) Just need to make sure I have something powerful enough. But, has to be small and battery powered. If not by 9v, battery power of some type.

    Is this a single knob? That would need a x and y servo.

    If you could do an external version, it would be a big external box and HUGH servos.

    The best would be two valves, one for hot, one for cold. Do it behind the wall, and all is good.
  • ercoerco Posts: 20,256
    edited 2013-07-24 16:00
    @Publison: I love Hugh Servo. I have all his records! :)

    Per Mike, a modern single control lever valve requires less force to move than ye olde twist valve & rubber washer. For the latter, you'll need a monster gearmotor or its servo equivalent (not cheap). Neither will be a 5-minute bolt-up job.

    http://www.servocity.com/html/robotzone_servos.html
  • PublisonPublison Posts: 12,366
    edited 2013-07-24 16:05
    I was thinking a hot and cold solenoid type valve behind the wall would be the best. 9 Volt battery ain't going to cut it.

    Please post more of your design criteria.

    @ecro I'll have to look up Hugh Servo :)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-24 16:21
    I've been thinking of adding a motor to our sprinkler main valve. It has a nice ball valve with a lever to turn it on and off. I thought some sort of winch with pulleys would be the way to go. I'd use a powerful continuous rotation servo with a winch mechanism similar to what kfurem used in this project.

    I was thinking I could make the winch a pull-pull system with lines to both open and close the valve.

    This wouldn't be the universal power value you're hoping to make but it should let me get by with a weaker (cheaper) motor to control the valve.
  • ercoerco Posts: 20,256
    edited 2013-07-24 20:18
    @Drivium: You've picked a doozie of a first project. Beyond the Herculean task of getting proportional motor/servo control of your water valves, you have a substantial control system to design for water temperature regulation. Are you trying to maintain a setpoint temp in the water exiting the mixer/spout, or keep a certain temperature in the tub? There's thermal lag, water "warmup time", temperature gradients, whether the tub water is mixed, and how quickly, etc. And to maintain water level, will you drain cool water from the tub as you add hot water?

    Not trying to discourage, but inform. Your thread's title reads "small project" but it ain't. If you're just jumping into microcontrollers, you should first work thru the basic WAM text & other pertinent material at : http://www.parallax.com/Default.aspx?tabid=362 prior to tearing the tile out of your shower stall. :)
  • DriviumDrivium Posts: 6
    edited 2013-07-25 07:34
    Well, with the vision thats in my brain - I won't have to touch my tile, but rather overlay this device on top of the knobs and use some type of non-permanent sticky substance to attach to the wall. So if I need to go with a more powerful servo, the board I'm proposing will no longer work either, correct?
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-25 08:53
    The board will work although you'll have to change how the servo is connected to the board. Servos are usually designed to run off a high current supply from 4.8V to as high as 7.2V. 6V is a good middle point and a gel-cell or other motorcycle battery would be a good choice ... easy to charge ... high capacity, etc. You can also use a 7.2V LiPo battery made for R/C models along with a charger designed for these. There are 3 wires coming off any servo ... + power, ground, control. You'd connect the + power and ground leads directly to the battery and the ground and control leads to the Stamp board. You'd also run leads from the battery to the Stamp board's power input instead of using the 9V battery (you can get matching 9V clips from RadioShack ... be careful of polarity ... their clips are backwards for this usage ... red wire (-) and black wire (+) ... don't forget an on/off switch). Normally, with a smaller servo, you can connect the 3 leads directly to the Stamp board and the motor would be powered by Vin or Vdd from the Stamp board's regulator, but that doesn't have the capacity to handle a large servo motor ... hence the direct connection to the battery.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-25 09:22
    Mike Green wrote: »
    Servos are usually designed to run off a high current supply from 4.8V to as high as 7.2V. 6V is a good middle point and a gel-cell or other motorcycle battery would be a good choice ... easy to charge ... high capacity, etc. You can also use a 7.2V LiPo battery made for R/C models along with a charger designed for these.

    LiPo packs are great if you're going to be do lots of servo projects but as Mike said, you'll need a special charger for charging LiPo packs. Be aware that a "7.2V" LiPo pack can have a voltage of 8.4V (or higher) when freshly charged. This will quickly destroy many servos. It's not a good idea to use a supply over 6V unless the servo specifically states it can use a higher voltage source.

    You'll get your servo to behave much more consistently if you used a regulator between the battery and the servo. As a battery pack drains, the voltage decreases and the servos performance changes with the decreased voltage. It can be very frustrating trying to get a servo to perform consistently without a regulated power source. I discuss this a bit in my cheap bot thread.
    Drivium wrote: »
    Well, with the vision thats in my brain - I won't have to touch my tile, but rather overlay this device on top of the knobs and use some type of non-permanent sticky substance to attach to the wall.

    Brains can envision all sorts of impossible contraptions. When I first learned (I was very young) about how you can speed up rotation with gears, I envisioned a pedal powered helicopter. All I needed were gears to increase the speed of the pedal rotation and route it to the rotors. Following the advice of erco's signature will often help conform the envisioned to reality.
  • DriviumDrivium Posts: 6
    edited 2013-07-25 10:42
    You all have been so helpful and your insights are really helping. Ok, I THINK I have what I need to take a stab. I may fail, I may not, but I'll be a little more knowledgeable than I am right now. lol
  • PublisonPublison Posts: 12,366
    edited 2013-07-25 16:25
    Drivium wrote: »
    You all have been so helpful and your insights are really helping. Ok, I THINK I have what I need to take a stab. I may fail, I may not, but I'll be a little more knowledgeable than I am right now. lol

    Please let use know your progress, and feel free to ask questions along the way.
Sign In or Register to comment.