This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
Sure, there are many actuated valves available on the market, but it is hard to find actuators that can “slip” onto your existing PVC ball valves. The advantage of decoupling actuator from valve is obvious from the stand point of independent maintenance: i.e. if the electrical components wear out, why should one be required to change a valve. PVC Ball valves are ubiquitous and cheap. Furthermore, CPVC is often the best option for corrosive flows. I use many ½” PVC ball valves in my environmental lab and I have a great desire to actuate them within an overall control circuit, however I do believe the concept would prove useful to others. That said, this is more of a proof of concept, the design is still somewhat rudimentary, and I will continue to upgrade the overall design as I become more skilled with the different software, tools and components.
To make this actuator, I started by creating an assembly in Autocad Inventor which allowed by to design my novel parts around imported part images representing those parts that I’d already purchased. I then had my novel parts 3D printed and laser cut. Assembling all the physical pieces is relatively straight forward: I started by installing the servo, its “Mount” and the “GoBetween.” Next, I wired the scripted installed Arduino to the servo, as well as an LCD display, 3 float switches and a 6.0VDC NIMH battery. Finally I fastened the assembled actuator to a valve and pipe with some custom brackets and plenty of 4 to 4 ½” hex bolts. Later I'll provide a link to a video demonstration of the project that will hopefully lend clarity to this explanation.
Step 1: Materials and Hardware
From the Arduino Starter Kit
· Arduino Uno (and Its USB cable)
· Small Breadboard
· The LCD Display
· Plenty of Male-Male and Female-Female Jumper cables
· 7.62 x 4.62 x 2.25 cu. In. Black Box Enclosure
From the Hobby (RC) Shop
· Hitec HS-M7990TH Monster Torque Servo (attach the 2” double-arm provided)
· Hitec HPP-21 Servo Programmer
· USB to Mini-USF cable under 3’
· Venom 6.0VDC NiMH battery
· DuraTrax DYNX110 AC/DC Peak Charger
Ordered online (Salvaged from my lab)
· 3 Float switches
· 0.22” sheet of black acrylic
· Hayward Grey Shd 80 threaded CPVC ½” Ball Valve
· Shd 80 Grey threaded CPVC ½” pipe
· Small Stainless Hose Clamp
· 8 4 1/2” 3/8” dia fully threaded Hex Bolts
· 8 3/8” endcap nuts
· 1 25pcks of 3/8” nuts
· 2 25pcks of 3/8” Washers
· 2 2” 8-32 machine nut and bolt assemblies
· 4 ½” 8-32 machine nut and bolt assemblies (+extra, you will drop them.)
· 3D Printer (MakerBots)
· Laser Cutter Operated with RetinaView
· Drill Press
· Soldering Iron, wire cutter and accessories
· Hot Glue Gun
· Screwdrivers (small Phillips)
· Sufficient lamps to be able to see what you are doing
· Teflon Tape
· Electrical Tape
· Hot Glue
· ABS plastic coil for the 3d Printer
· Small strip of Velcro with adheasive backing
Step 2: Required Software
· Autodesk Inventor Professional (http://www.autodesk.com/)
· Arduino IDE (https://www.arduino.cc/)
· “HPP-21” Hitec PC Programmer for Hitec Servos (http://hitecrcd.com)
I am running all of these programs on a 7 year old Sony Vaio running Windows 7 64bit version, certainly these applications are more compatible with newer Windows and Mac systems. I am able to have Inventor free of charge due to university enrollment.
Step 3: Novel Parts
3D printed parts
o Box – the Box Lid and Screws were provided at (http://makecourse.weebly.com)
o ServoMount – This was the first part I created. I drew it by creating a work plane within the box and using an imported .stl file of a similar servo (of identical dimensions.) For this project I printed this part with 60% infill.
o GoBetween – This is a 3 1/8” Cylinder with a rectangular gap that snuggly fits a ½” Hayward PVC ball valve. The fitting was determined by carefully measuring the flange dimension of three representative Hayward valves. I need to add two bolt hole to this part and for this project I carefully drilled bolt holes through my 60% infill finished part
o GoBetween2 – This piece was created by projecting the cross section of the GoBetween onto a work plane and extruding out two bolt holes and an aperture roughly concentric to Hitec’s 2” servo double-arm.
o GoBetween3 – This part is like a washer and an end cap that holds the entire GoBetween2 assembly together and against the servo arm. It is like a big washer with two 8-32 hex recesses about the bolt holes.
· Laser-cut parts
o Lid. Ultimately, I didn’t cut my lid out of clear acrylic as intended due to laser cutter maintenance. Instead I replicated this part as best as possible with my existing lid. Here is the file for you to laser cut or 3D print.
o Braces – These look a little rough and I think I should widen them a little, but they fit well and they actually work.
Step 4: Pre-Programming the Servo
Hitec HS-M7990TH Monster Torque servo requires pre-programming with the easy to use and understand HPP21 Hitec PC Programmer, supporting software and the fully charged NiHM Battery for power. Please refer to the two screenshots provided of the software GUI. Use the test page to familiarize yourself with your servo a little bit before moving into the programming. On the programming page you want to do a couple of important things. Primarily, you want to set the left and right positions position to correspond to the actual open and closed angle of your Hayward valve (n.b. it turns less than 90 degrees). You also want to reduce your Servo Speed to 20%, change the Dead Band Width to 5 and the Overload Protection Power Output Rating to 80%. Once you take care of these things you will ensure that you don’t kill this expensive servo as it is fighting to close an already closed valve. Reducing the speed reduces the impact and jerk to servo and overall assembly. Dead band width gives the servo more or less “play” at a set position. Overload protection set at 80% means that if the servo is producing it “stall torque” power draw will be cut to 80% to prevent overload; The servo will not be able to turn and it will drain the battery but at least it will not become destroyed. Take care in this and read all of Hitec’s instructions, and get to know your servo well.
Step 5: Control System
Regarding the block diagram, this project was originally conceptualized as a float switch controlled ball valve actuator used to drain and let fill a slowly filling reservoir similar to many projects in my lab. The Arduino receives input signals from three float switches, assesses their combination, determines the required state of the valve, and rotates the servo and displays the valve state on the LCD display. The whole control circuit is powered by an external 6.0VDC NiMH battery.
Please review the Fritzing diagram and the photos of the wiring. To summarize the wiring, a 6.0VDC NiMH Battery (represented by the AA battery in the diagram,) powers the Arduino, servo and LCD display via one of the power rails on the bread board. The Arduino Vin and ground pins are wired to the power and ground rails respectively (mixing these up will destroy the Arduino). The Arduino is also wired to: 3 float switches (represented by the tilt switches in the diagram) at digital (input) pins 2, 3 and 4; the signal wire of the servo at PWM pin 9; and to the SDA and SCL pins of the LCD display from its one SDA and SCL pins.
I drilled eight small holes in the lid of my enclosure and hot glued some female-female jumper there in so that the user can change out float switches without disassembling anything. I had solder some male jumper tips to my float switches to make plugging and unplugging them into the box a snap. In this iteration, I wanted to keep the battery external for recharging and safety purposes. It is simply held with Velcro to one of the brackets. It powers the system similar to the float switches, by plugging into and external jumper glued into the enclosure lid.
To summarize the Arduino code, it consists of a main script and calls only three simple functions. The main script: imports libraries wire.h, LiquidCrystal_I2C.h, and servo.h, and instantiates their objects; defines pins 2, 3 and 4 as digital input pins that sense the state of the float switches; defines Pin 9 as a PWM output pin used by the servo object; defines variables to hold the states of the float switches, servo object min. and max PWM frequencies (0 and 1023) to correspond to the open and closed positions, a mapping variable which should serve as the only variable you need to change in order to get the right degree of turn for your servo, and some character strings for the LCD to display; initiates the main loop which calls on the three functions levelSense, servoPosition and displayThis and then delays for 100ms. levelSense just attributes the state of the float switches by digital read to their respective integer variables. servoPosition analog writes the mapped “open” frequency with the servo object to pin 9 when all three float switches are lifted and sets the LCD char variable to a string “OPEN”. When the float switches are all dropped, Pin 9 analog writes the mapped “closed” frequency to the servo and the LCD display variable is changed to “CLOSED.” If the middle pin (3) is ever out of sync with the high (4) and low (2) pins the valve will be “closed” and the LCD variable is changed to “Error.” Finally, diplayThis is a two line function that that uses the LCD display object to display the current char variable on the bottom row of the LCD display.
Step 6: Assemble
Sorry I didn't take any pictures of the Assembly other than the wiring above. It's pretty obvious but here's a checklist just in case.
1. Assembly is easy, but sometimes a third or fourth hand really helps. You got this.
2. Compile parts.
3. Slide the servo in the mount and snap the mount in the box. Mind the wire.
4. Get the GoBetween assembly bolted to the servo double-arm with the 2 2” 8-32 bolt and but sets.
5. Hot glue eight female ends to the inside of your lid as the terminals for you level sensors and you battery leads. Don’t touch or move anything until the glue hardens (10 mins)
6. Bolt the LCD display onto the lid with the ½” 8-32 nut and bolt sets. And add some female-female jumpers to the LCD control chip’s pins.
7. Place the Arduino and the small bread board into the open half of the box and wire it according to the fritzing diagram remembering to take care regarding those wire going through the lid.
8. Fasten down the lid. Connect the float switches. Connect the power leads (DON’T GET IT BACKWARD) and test the servo rotation and the LCD display.
9. Apply to an actual working ball valve. Have your assistant hold the actuator in place with the GoBetween slipped over the flange of a downward facing Hayward ½” PVC ball valve. From either side of the actuator, in a horizontal fashion, slip each half of the bracket pair over bottom and top of the box until the bracket clips onto the pipe. Secure with two small nuts and bolts at the top and bottom holes.
10. Repeat step 9 with a second set of brackets such that a bracket pair nearly abuts the GoBetween and the other pair is near the far edge of the actuator. Uses the 4 ½” 3/8” dia fully threaded Hex bolts and plenty of nuts and washers to hold the two pairs of brackets firmly at the correct offset from each other. Replace the shorter bolts at the top and bottom with longer ones that also pass through other parts.
Step 7: Install, Experiment Improve
Experiment and help me improve on this design. Thank you.