Most deployable oceanographic instruments use alkaline battery packs for long term power. These battery packs are usually just a bunch of off-the-shelf 1.5 volt D cell batteries soldered together in series/ parallel to output the desired voltage. It seems a little anachronistic that these kind of high tech instruments are using such a basic battery technology, but I see 3 issues that keep this technology in use: 1- Deploying and recovering instruments takes time, and as researchers we want to maximize the amount of time instruments can stay out in the field, and minimize the number of retrievals. Rechargeable battery packs still don't match up to alkaline cells for battery life, so alkaline packs are the choice for lengthy deployments. 2- Lithium battery packs are great for electronics, but don't hold up as well when driving a motor. So if an instrument uses a sampling pump to move water through the housing (and many oceanographic instruments do), Lithium batteries don't hold up as well during a deployment. But if your instrument has a passive sensor and is just recording data, then Li battery packs may be the way to go for long deployments. 3- Solar/ Wind methods for recharging are difficult to implement on the ocean surface. And if you are using a bottom mounted mooring, it may be logistically impossible to get power to your instrument. If you find yourself using Alkaline battery packs, purchasing them from commercial vendors can be cost prohibitive. Considering these battery packs are nothing more than D-cells soldered together, the mark-up on these battery packs is many fold over what you might pay for the batteries alone. I've had luck making my own battery packs, so I've put together a short tutorial on how to assemble your own alkaline battery pack below. And while I'm using my battery packs for oceanographic instrumentation, battery packs like these can be used for any application that requires long term battery life. HOW TO MAKE YOUR OWN BATTERY PACK: Step 1- Rough up the ends of your batteries I'm using standard Duracell D-cell batteries for my pack. In order to solder them together, I'll need to rough up the ends of each battery so the solder will adhere properly to the battery. I used a dremel tool with a grinding tip to rough up my batteries, but sand paper or a file could work as well. Step 2- Shrink wrap batteries I want my battery pack to output 6 volts, so I will need to wire up 4 of my D cell batteries in series in order to get 6 volts. The easiest way to do this is to use shrink wrap hold the batteries in place, in essence creating a new "mini-pack" 6 volt battery cell out of four 1.5 volt cells. To do this, I line up the batteries in the configuration I will want them in to create a 6 volt cell. Then I cut the shrink wrap to a length just larger than the size of the batteries. The idea is to have a little overlap on the top and bottom size of the mini-pack in order to pull the batteries together, but not so much as to cover the ends of the batteries. I've found this shrink wrap works well for two D-cells placed side to side. Use a heat gun to shrink the wrap, causing the battery terminals to maintain good contact. Step 3- Solder battery tabs to bottom end of battery pack The configuration I have chosen for each mini-pack is two batteries pointing down, and two batteries pointing up. In order to wire up all 4 batteries in serial, I will need to connect one of the ends with a soldering tab. The red you see on the ends of the batteries is flux. I put a dab of flux on each end of the battery before I soldered the tab on. The flux will improve your solder contacts, and quickens the time it takes to melt the solder. This is important as we want to minimize the amount of time the solder iron is in contact with the battery, as it is possible to damage the battery by overheating it with the iron. After you have put together all of the mini-packs you will need for your main battery pack, check each tab to make sure you have a good solid solder connection. Step 4- Compress/ stabilize mini-packs together I have chosen to use hose clamps for this step, but most commercial companies will use a combination of glue internally with an outer layer of shrink wrap to keep their mini-packs together. The important thing is to make sure all of the mini-packs are compressed and will stay together as one unit. It's imperative that the mini-packs not move in relation to each other as they will be soldered together in the next step, and if there is even a small amount of movement between the mini-packs the solder connections can be compromised . I decided to use hose clamps as opposed to shrink-wrap and glue to compress my mini-packs as it will make it easier to break down my main pack for recycling. For my particular pack I am including a spacer (grey inserts in the middle) and I want to be able to re-use this spacer. Using hose clamps allow me to easily disassemble my used battery pack to recover the spacer. Step 5- Wire up the mini-packs in parallel. Once the mini-packs are stabilized, they can be wired up in parallel. Looking at the below image, you can see I used a combination of more battery tabs (for short lengths) , and insulated wires (for longer stretches between mini-packs) to connect the mini-packs. The end result is a battery pack that still outputs 6 volts, but with a much larger amp hour capacity. Step 6- Always Use Protection
The last step is to include some sort of circuit protection. I've chosen to add a diode, as well as a fuse to protect my electronics down stream in case of an issue with the battery pack. The diode will protect against any instance of the battery pack being hooked up with reverse polarity (though any diode will also drop the voltage by a bit). And the fuse will protect against any sudden increase in current in case of a short in the pack.
2 Comments
Currently, I'm working on a device that will control 25 different solenoids. As my little Arduino doesn't have enough pins to handle this many controls, I need to venture into the realm of Multiplexers. Using a multiplexer will allow me turn 4 of my I/O pins into 8 individually controllable signals for control. How does a multiplexer manage to do this? I assumed it was some sort of dark magic when I heard about this, but the logic behind the magic is pretty simple once you pull back the curtain. Each multiplexer takes in 4 different signals from 4 different pins on an Arduino. One of the signals is just a simple Off/ On signal, and the other 3 supply the logic behind the magic. For the 3 logic pins, it's a matter of mixing and matching the states of the 3 pins (High vs Low) to create multiple possible Output signals. Let's take a look at the board itself to help explain how this works. For this project I'm using SparkFun's Multiplexer Breakout board. The top half of the board contains the logic signals from my Arduino (S0, S1, S2), a common Off/ On signal (Z), as well as the connections for Ground and Power (GND and VCC). The bottom half contains the hookups for all 8 independent I/O signals (Y0-Y7). My solenoid controllers (MOSFETs) will be hooked up to these pins, allowing me to control 8 solenoids from each multiplexer. In order to send a control signal from one of the Y Out pins, you need to program the Arduino to do two things: 1- Set the Z pin to High (This is a basic Off/ On signal to turn the board on) 2- Send a specific permutation of High vs Low logic to the S0-S1 pins Using three different pin permutations, it is possible to get 8 different outputs. I've included the possible logic states from my code here below: /* Mux input/ Output matirx Input S0 = H S1 = H S2 = H Output = Y7 Input S0 = L S1 = H S2 = H Output = Y6 Input S0 = H S1 = L S2 = H Output = Y5 Input S0 = L S1 = L S2 = H Output = Y4 Input S0 = H S1 = H S2 = L Output = Y3 Input S0 = L S1 = H S2 = L Output = Y2 Input S0 = H S1 = L S2 = L Output = Y1 Input S0 = L S1 = L S2 = L Output = Y0 So as an example, if you set Z= HIGH, S0= LOW, S1=LOW, S2=LOW, the YO pin will be energized. If you set Z= HIGH, S0= HIGH, S1=LOW, S2=LOW, the Y1 pin will be energized If you set Z= LOW, SO= HIGH, S1=LOW, S2=LOW, nothing will happen because Z needs to be set HIGH to turn the board on. This little trick is nice as it allows you to control multiple multiplexer boards (which I will be doing), but keep the same 3 logic pins. **Note- For Rocket Scream pins A6 and A7 are analog input only and can't be used as output pins for this project In the above breadboard diagram, digital pins 0, 1 and 2 are being used as multiplexer logic pins for all 3 multiplexers. These pins are able to control the S0, S1, and S2 logic for all 3 boards. Digital pins 4, 6 and 8 are connected to the Z pins on each board, and control which of the 3 multiplexers are activated. And since this configuration only gives me 24 control signals, I need to add one extra which will be controlled by digital pin 10. **Note- Digital pins 0 and 1 are used by the hardware serial port on the Arduino Uno, and it's best not to use these pins as it can interfere with serial communications as well as uploading sketches. However this is not an issue with the Pro Mini's. This code is just a bare bones Arduino sketch outlining how to setup your multiplexer boards
My first few projects involving controlling motors used relays, but since most of my designs are deployable and thus battery powered, reducing power consumption is a priority. Since relays require a constant voltage to reverse their normal state (Off -> On or On -> Off), I've tried to stay away from using them. I've had success using latching relays, but I've always been concerned that in the event of a power loss to my Arduino board, a latching relay could potentially remain open indefinitely. As I've mentioned in previous posts I've been happy using MOSFETs, which have the benefit of closing a circuit in the event of a power loss, but also use minimal power to keep a circuit open. I've had success using Sparkfuns MOSFET breakout board for previous projects, and found them to be an easy, straight forward product to use. But for an upcoming project I will need to control up to 25 solenoids, and due to space limitations and organization it's impracticable to squeeze in 25 breakout boards. Plus each kit costs $4, but a single N-channel MOSFET component sells for less than $1. So I can save a pretty penny if I ditch the breakout board kit and build the power control circuit from scratch. So what is a MOSFET anyway? A MOSFET is just a special kind of resistor, used for amplifying or switching electronic signals. And if your curious, "MOSFET" stands for Metal–Oxide–Semiconductor Field-Effect Transistor. For my purposes here I will be using a MOSFET as a simple ON/ OFF switch. MOSFETs have 3 pins, a "Source" pin, a "Drain" pin, and a "Gate" pin. Or as I like to think of it: In= Source Out= Drain Control= Gate To use the MOSFET as a switch, you raise the voltage to the gate (set pin to "high" using Arduino), which allows electrons to flow from IN -> OUT or from Source -> Drain. So like any switch, the MOSFET conditionally completes a circuit allowing power to flow through. A quick side note: I'm using an N-channel MOSFET. For an N-Channel MOSFET, the source is connected to ground. This is opposed to a P-channel MOSFET, where the source is connected to power (Vcc). So lets wire this puppy up! Remember, on this MOSFET the pins are (from Left to Rigth) Gate, Drain, and Source. So as I have it wired up here, the Arduino is connected to the Gate and will send a "high" voltage to turn the MOSFET on. The Drain is connected to the DC motor, and the Source is connected to ground. When the MOSFET switches ON, the circuit to the battery is completed allowing the battery to power the motor (The Arduino does not power the motor in this example). A few notes on this design: 1- There is a 10k resistor connected to the Arduino control pin. This is used as a pull-down resistor, which holds the gate in a low state (connected to ground) when the Arduino is not sending a "high" signal. 2- There is a 1 amp/ 50 volt diode connecting the + and - sides of the motor. This is used as a rectifier diode, and it is recommended you use one of these anytime you are working with a coil (motor, relay, solenoid, ect). Whenever you stop power to a coil, you can get a powerful reverse voltage spike. The spike only lasts a few microseconds, but the voltage is high enough it can fry your poor MOSFET. The rectifier diode is installed facing the "wrong way" (stripe facing V+ of motor), so that under normal operation it does nothing. But given a reverse spike, the diode allows voltage to flow back to the coil itself (which can handle the spike), as opposed to flowing back to the MOSFET (which can't). I recently attended a developer program put on by AT&T for their M2X Data Service, which is a cloud based time series data system. The course was pretty handy and I'd recommend it to anyone working in the IOT sphere. The course covered the basics of using a M2X connected device, and I'd like to devote this blog post to my first attempt at using M2X to create a simple, real-time data plot that can be displayed here on my website. So first things first (I hate this part)- you will need to sign up for yet another online account. Click here to create a M2X account: https://m2x.att.com/signup Once you have an M2X account, you will need to set up a device on your new account. 1: From the "Setup your Device" page choose "Device" (as opposed to "Virtual Device"). 2: You will then be guided through the (hopefully straight forward) steps to set up your device. 3: Once you have your device set up, you will be given a unique Device ID and API key associated with your device. You will need these two items for setting up your Arduino sketch later. 4. Next you will need to set up a "stream", which allows for a series of time stamped data points routed through the MX2 cloud. Scroll down to the bottom of the device page and hit the "Add Stream" button. Follow the steps to set up your stream. 5. Once you have a stream, we can now start pushing our data around. But to easily publish the real-time data onto a personal website, the last thing you will need to do is to set up a widget (found under the dashboard tab). Once you attach your stream to a widget, you will be given a link (a few lines of html code) that you can paste into a website allowing for a real-time plot of your data stream. The dev program course used the Texas Instruments Launch Pad dev board. I liked the Launch Pad hardware itself, but the Launch Pad uses an IDE called Energia which looks exactly like the Arduino IDE....... except it's a red colored background (as opposed to Arduino's blue). But the two IDE's use completely different libraries, so unless I hear some compelling evidence to switch over, I'm going to stick with the Arduino hardware. Plus M2X has a few pre-written code files for Arduino, so I'll be ditching the launch pad and port over what I learned in the class to my ESP8266. For this project I've chosen to monitor the temperature in a climate controlled room, and luckily for me M2X has a good Arduino code for doing this. But first you will need to download the M2X library for Arudino from GitHub. https://github.com/attm2x/m2x-arduino I've attached the code I used for the ESP board. The code itself is almost entirely lifted from the M2X example, I just changed a few things to work with the 3.3volt logic of the ESP.
I've used a rudimentary TMP35 temp sensor for this project. Left Leg -> 3.3v Right Leg -> GND Center Leg -> AO So the hardware setup is pretty simple. But the TMP35 sensor I'm using is cheap and I don't have a lot of faith in it's accuracy. So I wouldn't use it for anything you really cared about. Once you have the sketch loaded onto your board, it should connect to your M2X stream and start sending data to your website. Granted, as of now I don't see a lot of options for customizeability of the of the data (playing around with x and y axis, graphical parameters, cleaning data and removing outliers, ect). But what you gain in ease of use, you often loose in the ability to tailor to your needs. Though there are few parameters you can customize by changing the actual code behind the widget. For my plot I chose to specify a start time, as well as expanding the window of data displayed (the default is only 100 points of data). You can find directions on how to change these parameters here:
https://m2x.att.com/developer/documentation/v2/widgets All in all, it's a pretty easy and straight forward way to hop on board the IOT train and play with your data. I will update this blog as I find more ways to customize and play with this data stream. Next post- setting up a trigger to alert me when certain conditions are met. Many of my projects are meant for autonomous deployment (set it and forget it). But for some of the projects I've been working on, I'd like to have some sort of real time control and/ or monitoring. And if I'd like to join the Internet of Things Party (IOTP), I need to incorporate some sort of wireless component to my work. So thanks to my friends down at Acrobotic Inc, I was introduced to the ESP8266 ESP-12E development board. This is a little dev board similar in layout to the Arduino Pro Mini, but with wireless capability. The ESP also has an on-board USB -> Serial converter, so while not as power stingy for long-term deployments, it has the added bonus of not requiring a special download cable. The ESP board can be programed using the Arduino IDE, but it's not a straight forward process getting the IDE to talk to the ESP. Luckily for me the folks down at Acrobotic have great customer service, and Cisco and Sonia are really helpful when it comes to project guidance. They put together a great tutorial to get you up and running with the ESP board here. Controlling/ talking to the ESP board is the tricky part, so for this post I'll keep the project simple and just use the example of controlling a 110v relay. But keep in mind being able to control an Arduino board over a wireless network really opens up what you can do with this kind of technology, and acts as your official invitation to the IOTP where all the cool kids are hanging out. Equipment List: Board- I used the ESP8266 ESP-12E, though there are other ESP boards out there on the market that are similar. Relay- I used a four channel relay board I picked up at Acrobotic as well. You don't need 4 channels for this project, but it's nice to have the option to control up to 4 different pieces of equipment. Computer- You will need a computer connected to a wireless network to control the relay. Equipment to control- In this project I just used an ordinary desk lamp plugged into a power strip as my equipment to control. But anything that plugs into power (and is not sensitive to being rapidly unplugged) can be used. The Set Up: A relay is a simple switch that can be turned on and off. It can either be configured as "Normally On" or "Normally Off"- meaning it's "Normal" resting state is either allowing electricity to flow through, or not. The relay requires an active signal from your board to flip the switch from it's "Normal" position. So if your device is going to spend most of it's life powered down, and only occasionally being powered on, you would want to configure your relay as "Normally Off". Conversely, if your device spends most of it's time in the on position, then you will want to configure your relay as "Normally On". The relay requires active power to work against it's "Normal" state, so it's important to configure your relay properly ahead of time so as to avoid needlessly overworking it. And a quick disclaimer on my part- most of my projects deal with low voltage DC current. The example provided below uses 110V AC current, so please be careful whenever you work with this kind of electricity (AKA- don't attempt this at home). As usual, the relay GND and VCC attach to the board GND and 3.3v. I'm using Digital Pin 2 as my signal to the Relay. As can be seen in the video below I have cut the insulation on the power strip cord (unplug power strip from wall outlet first!) to access the red and black wires. With the wires exposed I left the black wire untouched and cut the red wire in half. The red wire on the side of the plug (Plug End) attaches to the "C" screw terminal on the relay. The red wire on the side of power strip (Power Strip End) attaches to the "NO" or Normally Open screw terminal of the relay. Configured as above, I have now set up a power interrupt for my desk lamp that is controlled by the relay. Pin Layout: ESP 3.3v -> Relay VCC ESP GND -> Relay GND ESP D2 -> Relay IN4 Plug End BLK -> Power Strip End BLK Plug End RED -> Relay C Relay NO (Normally Open) -> Power Strip End RED The Code- For this project I'm using the aRest library to set up a simple ON/ OFF button in a web browser window that can control my relay setup. To use the below code you will need to enter the name of the wireless network as well as your password. After the code is loaded up on the ESP board, you will need to open up the Arduino Serial Monitor to find the IP address the ESP board is using. Once you have the IP address from the serial monitor, just paste it into your browsers address bar. The IP address will now open up a web page containing a simple ON/OFF button interface for your ESP board. Note that while this example only has one set of ON/OFF buttons, you can adjust the code and add more buttons (which is nice as we are using a 4way relay).
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. My current project is for a PAR (Photosynthetically Active Radiation) Logger. PAR is a specific spectrum of sunlight (400-700 nanometers) and is an important measurement for marine biology and ecology. The sensor I use as part of my research is a Li-Cor Li-193 Spherical Underwater Quantum Sensor. I've been happy with the sensor, but the Li-Cor logger is not the best fit for my research needs. My goal is to design a logger for this sensor that meets the following requirements: Compact- I want the logger to fit into a small underwater housing to reduce buoyancy and for ease of deployment Low battery draw- Lower amp draw equals less batteries used per deployment Real Time Clock- Need a RTC for Time Stamps, and potentially for controlling sampling protocols and instrument sleeping Data Logging- the whole point of a logger! I'm a fan of a simple csv file on a removable SD card LED- visible through housing to insure logger is running A time stamped data logger is a staple for any monitoring project, so I'm happy to start off my blog with this one. So here is what I have so far- Equipment List: Board- The brain of the logger, I'm going with an Arduino Pro Mini. After being burned by the more common Arduino Uno and it's heavy amp draw, I've switched to using these smaller boards for all of my battery powered projects. Not all Arduino's are equal, and not all Pro Mini's are equal. I've noticed a lack of quality with some of the cheaper boards I've picked up, so I've been using the original SparkFun Pro Mini. But my absolute favorite board so far is the power stingy Rocket Scream Mini Ultra, mainly for the fact that this board has an awesome power regulator and draws incredibly low amps. But also because the A4 and A5 pins (used with the RTC) run along the edge of the board, as opposed to inset on the SparkFun board. SD Card- I'm using the SparkFun SD breakout board. It's a straight forward SD card board, and I've been happy with the results so far. RTC- I'm using a DS3231 RTC. This is the RTC I've been using for a while now, so I'm comfortable with it. I'm not a huge fan of this particular model, but I've got a code library for it and it's been pretty reliable for me so I'll stick with it for now. Universal Transconductance Amplifier (UTA)- I need a signal amplifier to increase the sensor signal for use with the 3.3v logic on my board. Li-Cor makes an amplifier that will work for my needs, but I came across this great article on a similar PAR logging system which is where I found out about the UTA made by EME systems. I decided to go with EME systems as its a great product and the owner was very helpful in explaining to me exactly how to set up my UTA. A picture is worth a thousand words, so here is a breadboad mockup of what my logger ended up looking like: Pin Layout: SD CD -> Pin 5 SD DO -> Pin 12 SD GND -> Common GND SD SCK -> Pin 13 SD VCC -> 3.3v SD DI -> Pin 11 SD CS -> Pin 10 RTC GND -> Common GND RTC VCC -> 3.3v RTC SDA -> Pin A4 RTC SCL -> Pin A5 UTA Red -> 6v Batt UTA Green -> Pin A2 UTA Black -> Common GND UTA Black/ Blue -> Yellow Dot Pin on PAR sensor UTA Brown/ Green -> Opposite Pin on PAR sensor LED + -> Pin 3 LED - -> Common GND (through 1K resistor) The above drawing lays out the all the equipment used and how it is connected. I'm going to hold off fitting all the above components into a waterproof housing until I've had a chance to bench test this set up vs. a certified sensor. But as of now I've got the above components soldered together on a PCB prototype board and so far the logger gives me values within the expected norm. Arduino Code: The code I wrote for this is pretty simple for now. For other projects I've done I usually put my boards to sleep when not in use. And this makes even more sense with this project as no one is concerned with PAR values during the middle of the night (spoiler....... it's just a lot of zeros). But for now the code runs 24 hours a day. Even over a time frame measured in seconds, PAR can vary greatly depending on environmental conditions (cloud cover, turbidity, ect), so I've chosen to use an averaging routine to log the data. Ultimately I'll choose to log the data once per minute, with each logged data point representing the mean of 60 measurements (60 seconds per minute). But the included code logs data every 10 seconds as I didn't want to wait that long when troubleshooting my code.
Above: The housing sled for mounting all of the electronics Below: The logger in a water proof housing ready for deployment Future Goals:
The above code is pretty basic, and as I mentioned I'd like to add a sleeping function to it. I'd also like to add the option of using a LCD screen to display real time PAR data. The LCD would not be used when logging data due to power constraints, but would be helpful to use in hand held lab situations. Yahoo! My first entry- After spending many hours (sometimes satisfying hours, sometimes frustrating hours) teaching myself electronics and building my first few projects, I've got a small project library building up. And I find myself with a fair amount of information I'd like to remember about each project, but with a brain that loves to forget all the little important bits. So my hope for this blog is to use it as a diary to keep track of my progress, as well as a place to document whatever notes, diagrams, and code I write for each project. Most everything I've learned about electronics has come from online reading, so in addition to keeping this space as a reference for myself I'd hope other people can come through and pick up useful bits of information. |
AuthorAn electronics enthusiast looking for a place to gather his thoughts, ideas, diagrams, and code Archives
October 2016
Categories |