This project is for a set of automated water samplers, which use peristaltic pumps to slowly draw in water samples over the course of the day and/or night. This current design is the third iteration for this project, and the first one to use a programmable microprocessor as opposed to off-the-shelf components. My Goal- To control 2 separate pumps (1 for day time and 1 for night time) for multiple days of underwater deployment. Equipment : Rocket Scream Mini Ultra 8MHz board- I love this little board. For my first attempt at using a microprocessor to control this project I used an Arduino Uno with a relay motor shield, which worked fine on the bench but used way too much power for our deployment needs (see below for a power draw comparison). The power regulator on this board can only take a range of 3.3-6v (as opposed to the 3.3-12v range on the SparkFun Pro Mini), but the regulator itself is more efficient than the other boards I've tested. MOSFET- As stated above, I started off using relays to turn my pumps on and off. But the relays themselves are incredibly power hungry, so I needed to swap them out for a more efficient control method. I briefly toyed around with using a latching relay, which only requires a momentary use of power to change the state of the relay (as opposed to a traditional relay which requires constant power to change states). But I scrapped the idea of using latching relays as I was concerned that in the event of a power loss to the board, the pumps might remain on indefinitely. So I ended up using a MOSFET, which has the benefit of a traditional relay (only energizes the pumps when the board is powered) but has a much lower power draw. I decided to use the SparkFun MOSFET power control kit, which is a small kit that has all the little pieces I need plus a small PCB board, but in the future I will probably just build the MOSFET parts without the actual kit. RTC- Using a DS3231 RTC. Peristaltic Pumps- I've been very happy with the Welco WP10-P1 pumps I chose for this project. I've used them for the previous version of these samplers, and they have proven to be very dependable. I purchased some of the cheaper pumps out there on the market and was extremely disappointed. At $100 a pump they are pricey, but well worth the money. Lithium Battery- Since I'm using DC motors in this circuit, I need to keep the motor power supply separated from the board power supply. The Rocket Scream VIN only has a range from 3.3v-6v, so I'm using two SAFT 3.6v AA batteries wired up in parallel to power my board. Pump Battery Supply- I need to get at least 12 days of deployment time from each water sampler, so I need a sizeable battery pack to run the pumps. Most similar oceanographic instrumentation is powered by commercially available pre-made alkaline battery packs. These packs work great, but are extremely expensive. The packs themselves are basically a large bundle of D cell batteries wired up in series/ parallel, and then shrink wrapped to make a compact battery pack. I plan to make my own battery packs for this project, and will discuss the making of these packs in a separate blog post. Below is the breadboard diagram of the wiring for this project. Please note the added text describing the actual components used (may differ from the icon used in diagram). Pin Layout: RTC GND -> Common GND RTC VCC -> 3.3v RTC SDA -> Pin A4 RTC SCL -> Pin A5 **Note Pins A4 and A5 can be used as I/0 pins, but also have the special function as I2C protocol pins. Since the RTC runs using 12C, we must use pins A4 and A5 for the SDA (Data Signal) and SCL (Clock Signal). MOSFET Kit 3 Screw Terminal + -> 6v Batt - -> Common GND C-> Pin 3 (Pin 5 for Pump 2) MOSFET Kit 2 Screw Terminal + -> Positive Pump Terminal - -> Negative Pump Terminal The code for this project is not nearly as straight forward as I had hoped it would be. It's pretty simple to set up a timer to turn things off and on at certain times of the day, but I ran into several issues when the pump control crossed over the midnight hour. The logic I was using was "greater then or less than time X", which got funky with the changeover from one day to the next. So the result is a clunky, far from elegant, hunk of code that also just happens to work well. So while I'm not proud of it, I'll post it here because it works. But I'd be happy to hear from anyone who has a better approach.
Power Comparison: My original design involved an Arduino Uno with a relay motor shield. The amp draw for the UNO was 56mA when not driving a pump, and 98mA when driving a single pump. Even when putting the unit to sleep the unit still used 48mA. Between using a much more efficient board (Rocket Scream) and switching to MOSFET technology I've brought my power consumption waaaaaaay down. My current draw is 6.30 mA for driving a single pump (at 230 speed). When not driving a pump the board draws 5.99mA, and when sleeping the board draws 2.16mA. The power draw is dramatically less with the new configuration and the samplers should last well over the planned deployment period. How long will the board last you ask? How about a little back of the envelope math to ballpark how long my board should last in the current configuration. The life of a battery can (roughly) be calculated with the following formula: Battery Life (in hours)= Battery Capacity (in mA Hours) / Load Current (in mA) * 0.7 Side Note- The 0.7 is a fudge factor to take into account various environmental factors as well as the power consumption rate, both of which can affect battery life. The Saft AA battery has a listed capacity of 2450 mA. So at my maximum amp draw of 6.3 mA I have: 2450 mAh / 6.3mA * 0.7 = 272.22 hours/ or approx 11 days of deployment time But as I have set up my sampling schedule, I'm only running the pumps for 12 hours out of each day. The rest of the time the board is using much less power. How much less power you ask? Let's dive in a little deeper into the back of the envelope. The sleep cycle is controlled by a watch dog timer on the RTC, which puts the board to sleep on 8 second cycles. So the board sleeps for 7 seconds, wakes up for 1 second to make sure it doesn't need to be doing anything, and then falls back asleep for another 7 seconds. So while the board is sleeping 1/8 of each cycle is using 5.99 mA, and 7/8 of each cycle is using 2.16 mA. If we start thinking about a day as a single cycle lasting 86400 seconds, our board is awake for 43200 seconds per cycle and sleeping for 43200 seconds per cycle. Of that sleep cycle 1/8th of the time (5400 seconds per cycle) the board draws 5.99 mA. And 7/8ths of the time (37800 seconds per cycle) the board is drawing 2.16mA. So if we want an average current draw over the course of a deployment, we need to add all the above factors together like so: Driving Pump= 6.3 mA * 43200/ 86400 = 3.15 mA Watchdog Cycle= 5.99mA * 5400/ 86400= 0.374 mA Sleep Cycle = 2.16mA * 37800/ 86400 = 0.945 mA 3.15 mA + 0.374mA + 0.945 mA = 4.469 mA And finally to calculate our final battery draw: 2450 mAh / 4.469mA * 0.7 = 383.75 hrs or ~ 15 days of deployment time. And since I'm going to be extra cautious, I'll be doubling my battery power by placing 2 SAFT batters in parallel which will double my deployment time giving me a large enough buffer where I shouldn't have to worry about the current draw of my board (......famous last words). Future Goals- It strikes me as a bit wasteful (in terms of space and $$) to have two different pumps running (one for daytime samples and one for night time samples). Further down the road I'm hoping to design a similar system capable of taking up to 24 discrete samples. Thinking of a project like this it quickly becomes untenable to use 1 pump per sample. So I'd like to design a new system that only uses 1 pump to take samples, with downstream sample control to shunt water into the proper collection bags.
I can envision a set up that uses only 1 pump to draw water in, which passes the water into a solenoid controlled gang valve system. But like relays, solenoids are power hungry and I'll have to find another way to control water downstream of the pump.
1 Comment
7/26/2021 07:20:42 pm
Thanks for pointing out that peristaltic pumps slowly draw in water samples over the course of the day or night. I would imagine that any industry would need pumping solutions for their daily operations and applications. I think that they should look for high-quality peristaltic pumps that can transfer fluids without contaminating them.
Reply
Leave a Reply. |
AuthorAn electronics enthusiast looking for a place to gather his thoughts, ideas, diagrams, and code Archives
October 2016
Categories |