Dactyl Manuform For MechEs
Dactyl builds seem to mostly be done by people who either know what clojure is (professional keyboard pokers), or at least people who are in the electron herding/plumbing industry. This means that there’s not a whole lot of build guides written by people who know to hate STLs with a burning passion, and who might actually want to use typical feature-based CAD (and not keyboard mashing) to edit their keeb to their liking. While there are many reports of being able to open openscad files in freecad, that did not work for me.
Fortunately joshreve used python to make a generator that can create a STEP, albeit one with a lot of self-intersecting and bad geometry that prevented solidworks from opening it on the first go. After a few hours of editing, I was able to knit up all the surfaces and make a solid body. But shoutout to joshreve-this work was critical!
In the spirit of making this available to other mechanical types, you can get the fixed up .sldprt and .steps from here.
Goal: see if I can get used to this keyboard
I picked an extremely whacky keyboard to build, because why not? Worst case I get hooked on it, spend a lot of time making a keybord nobody else will use, and I have to build my own keyboard for the rest of my life. Best case, I make it and decide its awful and retreat blissfully into querty land.
Unlike most people who seem to tout the wonders of the manuform, I do a lot of CAD. CAD means you use a mouse, and you have to type a lot of numbers. I’d like to see what the manuform can bring to that- specifically, can I right-hand-mouse and left-hand-numpad? Would I like a layer for common shortcuts just for specific programs? Would it be cool to have a trackball built into my keyboard? I have questions that have not been answered by a cursory google search and so I will have to find out for myself.
What did I change?
As a mechanical-type engineer, I like things to fit together without having to drill extra holes or to hot glue in connectors. So it was important to get the case holes right, to prevent that. The micro however, will be taped (double sided) to the interior, since there will be no force on it from removing connectors etc.
I also moved the screw bosses to the inside of the case, since they will look better there. they are sized for M3 heat set inserts from McMaster.
Of course, there has to be some frivolous embellishment on it because it is both 3d printed and a keyboard. Instead of spending hours on this, I just threw some text on the “knuckles” of the keyboard. “PROTO–TYPER” seemed to be appropriate, as it is a prototype to see if I like split weirdo keyboards enough to keep using them.
There are better guides out there on this but overall it is straightforward to wire these keyboards and if done carefully, there is little danger of anything shorting out, and even if something is shorted, its easy to fix. If I were to do it again I would use enameled copper wire or fully stripped 28 ga wire and a wire wrap tool, with cut to size ptfe tubing as the insulator. I think this would be easier than carefully cutting 20 or so small wires per row. I will say that it took a surprisingly long time to solder this, even for someone who is fairly good at fiddly soldering.
Update: A Few Months Later
It took me a few months to button this project up, and in the mean time I have been using the keyboard. It is now my daily driver- for everything. Surprisingly I have been spending most of my time in kicad and altium instead of solidworks, but the time I have spent in all three programs has been pretty pleasant.
I think the most challenging thing will bet to remap all the important shortcuts to the left hand, and for those that cant be remapped, to make an application specific layer. For example, the ‘M’ key is really important for moving things in kicad- but its on the right hand. That means that to move stuff, one of my hands has to come off the mouse or the keyboard.
One thing that has been surprisingly nice is my navigation layer, which makes the left home keys arrow keys, and the right home keys the mouse directions. the thumb keys on the right side become left and right mouse clicks. I would say if I am not in a cad program, my hands stay on the keyboard, which is nice! The only issue is that its easy to get stuck in a layer (or my numkey layer) and not know that I am in that mode when I first sit down and start typing my password. some kind of indicator will need to be built into the next version.
Protected: Bootloader for Ender3 Board
Integrated Dive Information and Oxygen Transmitter (I.D.I.O.T)
Knowing your PO2 goes a long way towards making it safer to go deeper with an oxygen rebreather. If you want to go pure O2, it can be used to monitor how purged the loop is, and if you want to go a little deeper it can basically turn an O2 rig into a sort of mixed gas rebreather (or a full mixed gas rebreather with proper diluent addition).
In order to conveniently know my PO2, I have purchased O2 sensors. Having built in temperature compensation and having reliable manufacturing seems like a big plus vs fabricating, assembling, testing, QCing and calibrating my own.
For my first iteration I have started with just two cells. A third would be easy to add if this works out.
Layout and Logic
The electronics are going to be split into three parts- the cells/stuff in the counterlung, an electronics box, and a display. I decided that the only things in the counterlung should be the sensors themselves and a connector.
The “Electronics Box” will house the brains of the operation (an ESP32), and the battery. Batteries and other flammables will be kept outside of the oxygen rich environment of the rebreather, for obvious reasons. In the unlikely event of the battery shorting to the cells, hopefully the high impedance of the cells will limit resistive heating or fire. In the future, a USB port with a cap will be wired in for charging.
This box has been tested to ~80 FSW with just the cord grips+cord installed, and it passed without noticeable leaking. The cord grips are MSM-M SKINTOP connectors. They don’t seem like the should work, and yet they do. Mcmaster sells these as “submersible cord grips”. N.B. they make a face seal with the enclosure, and do not require a gland like an SAE o ring boss (ORB) fitting.
The main oring seal is a 1.5mm oring made from cord stock and superglued at the ends. You can see the join just above the middle heat set insert in this photo. Surprisingly this does not seem to create any significant leak paths, although there is always a slight possibility that I will have to eat my words on that someday.
The display will be upgraded to a HUD at some point, but for now it will be wrist mounted. It displays two PO2 cell readings, a compass heading, and (in the future) the depth. As you can see in the photo, the top row is “highlighted” to show a problem- the cells are disconnected and are reading a very high PO2.
Reading an off the shelf galvanic O2 cell is dead easy, since the temperature compensation and shunt resistor are built in. However, the output voltage is fairly low, and so it should not be fed directly into the ADC of a typical micro. It is possible to read such a voltage (~20mV), but it wastes a good portion of the resolution of the ADC.
For example, the maximum output expected is 2V (representing a PO2 of 2). With a 5v ADC, we are only ever using 2/3 of the range of the ADC, which effectively limits our resolution of PO2s to 2/3 the resolution of the ADC.
Since these signals are also not amplified or buffered in any way, it seems good to keep them away from the mcu. I have resolved to put them on an I2C DAC with an internal gain stage, which will let me both maximize resolution and keep the signal wires for the cells short. To this end, I used an ADS1015 breakout from adafruit.
Since it was on hand, I also threw in an LSM303 to use as an electronic compass. Since the compass has no “inertia” it has kind of jumpy readings, but doing some smoothing should help to get it to be a little less jittery. I could also try some compensation for nearby electronics, but they seem to have little effect. The LSM accelerometer/magnetometer lives in the wrist piece, although I did consider mounting it in the “head”, which would show you body heading, but not necessarily what you are looking at.
The display is the 128×64 OLED featherwing. Its easy to integrate, and it is fairly compact in terms of “extra space” for unused headers/buttons.
I headed to the mystical mystic lake to do some testing. The combination of near zero visibility to start with and a haze of sediment/algae/stuff I don’t want to think about made for a more-or-less night dive like conditions, even with a light, during the day. However, the little O2 cell reader and compass seemed to behave relatively well. Most importantly the firmware did not crash, and no water seemed to get in. Cant wait to test it somewhere actually fun!
Pivot to a Galvanic O2 Sensor
After a maddening time with polarigraphic sensor, I decided I would try to build the galvanic flavor of oxygen sensor. After reading this tech tip from Oakton Instruments, it seemed pretty obvious that galvanic cells have big advantages. The main draw for me was that the output was easy to measure, eliminating the need for the fancy DMM. This would also simplify the electronics needed for reading polargraphic cell.
Electronics Comparison- Galvanic vs Polarographic
Here is what I think would be needed to read a polargraphic cell- a precision buck or LDO to bias the cell, with a feedback pin at the top of the cell. This eliminates the burden voltage of the shunt resistor that is fed into some kind of stack of op amps that then produce a voltage on the other side. This might not be so bad, and given that we have a 0 drop shunt resistor, we no longer need to worry about having a tiny burden voltage.
For a galvanic sensor, its pretty much as simple as it can be- a single resistor and a high impedance amplifier to match the voltage output range to the desired ADC.
The first galvanic sensor I made just replaced the silver electrode with a zinc electrode. Platinum or gold (or likely any noble metal) makes a good anode for this system. Zinc, in contrast to silver or platinum, is a very, very agreeable metal to machine. I can easily take a millimeter or more off at a 25mm diameter. The rod I got from rotometals appeared to be cast, although without any apparent porosity after ~2mm into the diameter. The one offputting thing is that zinc fumes are toxic, and the melting point is alarmingly low~ 400C. So all the operations were done with a lot of coolant, and the soldering to the electrodes was done very gently to prevent or minimize any zinc vapors.
As you can tell from me stating that there was a first sensor, there is also a second sensor. The first sensor seemed to have the same drift problem as the polarigraphic sensor, which makes me suspect that the root cause of both sensors drifting is electrolyte loss through the membrane or leaking at the press fit of the metal to the delrin. I also wanted to increase the area of the zinc so that the electrode and the volume of the electrolyte. More zinc will alleviate any concerns about using up the electrode, and more electrolyte will reduce the impact of loosing small amounts of fluid, or bubbles. This is because each bubble or amount of lost fluid will be small compared to the sensor, since it is bigger.
Much like the polargraphic sensor, it kind of works. It certainly can detect a change in the level of oxygen, but it does it in kind of a non linear way. For example, I would expect that if 20% air is ~300mV, pure O2 should be 5x that, or 1500mV. It is possible that the cell just cant generate that much current, and that I should try a smaller resistor, but I certainly have not verified that yet.
With the improved sensor body, the sensor was also a lot more stable. It dropped a few mv over a fw hours, and its hard to know if that was related to temperature, drift, or the actual O2 concentration in the room. However, this stability was achieved over ~30 minutes as the sensor reached equilibrium. Likely the O2 in the bubbles in the electrolyte needed to be used up first, as they are in direct contact with the electrolyte. I suspect that after that happened, the sensor reached equilibrium with gas diffusing across the membrane and stopped sensing O2 trapped in the sensor.
On the other hand, it does seem very sensitive. Breathing on the sensor produces a small dip, and there is a noticeable difference in value (~30mV) from when I sit right in front of it and breathe on it vs when I leave the room- this is mostly anecdotal but interesting.
The linearity is not very good, as you can see. This is a plot of the pressure transducer vs the sensed voltage. Its all over the place, but is vaguely the right shape. Ideally the sensor should trace a straight line here, but there may be some hysteresis that causes non-linearity.
Unfortunately, just like with the step response, the change here should be much bigger. This test pressurized the sensor from 1 bar to roughly 6 bar- the reading should be about 6x as big, but it only went up a few mv! So this is not that impressive, as it shows either a non-linear sensor or some kind of enormous DC offset.
The last issue seems to be that the sensor leaks somehow. It may be that water vapor is permeating the membrane, because when left overnight the sensor dried out. In a humid environment like a rebreather this may not be a issue, but for storage it certainly is. This answers a question I have had for a while- why are rebreather sensors so slow? They are rated to a rise time of 6s to get to 90% of the final value. This is much slower than any of the sensors that I have seen, and does not seem to be an inherent characteristic of the sensor. My suspicion is that a much thicker membrane is used on rebreather sensors to reduce electrolyte water loss.
This sensor seems a lot easier to use, but it seems like a lot of the issues I have noticed may be due to my membrane selection and leaking. I have parts on order for a larger pressure pot (the under $50 cell checker) to see if I can get the larger sensor to behave in a linear way with a polyethylene or FEP (or even teflon tape) membrane. I think this cell checker will be very useful for a number of other things like depth gauges/computers/ingress testing so I am excited to have it on hand. I will have to make an effort to keep my pressure pot electrolyte free this time!
Oxygen Sensor and the Science Jr.
Testing the oxygen sensor will need to be done over a wide range of temperatures and PPO2s, and the cheapest, easiest, safest way of doing this seems to be to not use pure O2 gas. Not only is O2 a somewhat “spicy” gas, but I don’t have a huge tank of it sitting around in my house.
Instead, I intend to increase the PPO2 by increasing the pressure of the air- this will also prove out that the sensor works “at depth”. While that might seem magical, its pretty easy to imagine- as gas density increases at higher pressures, there are just more oxygens per volume bouncing around. The odds that one of these O2s bounces off the sensor go up as the pressure increases, and it is linear with depth.
The Science Junior
With this in mind, I set about what I am calling the Science Junior, since it looks like a generic science widget from KSP. Basically its just a small pressure chamber with a window and some NPT ports, which can be used for various purposes:
- Pressure port via schrader valve from bike pump
- Sensor wire pass thru
- Pressure sensor
- Gas infeed (?)
For those interested in the construction, the O ring is a just superglued out of cord stock and the sensor wires are run through a 1/8-27 NPT hose barb and epoxied in place.
Designed for a maximum pressure of 150 PSI, the 1/2″ thick polycarb cover and 8x M3 bolts should be more than enough to keep things together. There is about 1lbf per PSI so at 150 lbf I didn’t bother with the math.
One thing I would do differently is to use something removable for the sensor wire infeed, probably something that would get dropped in through the front and get captured by a lip on the inside, as shown in the sketch.
Testing and Learning
For testing, I set the bias voltage and logged the pressure (using a pressure to voltage transducer) and current of the sensor simultaneously while varying the pressure, which controls the PPO2. When the pressure is plotted against the current, it should be roughly linear. The chart above shows the sensor working reasonably well- however there is an odd drop of in current after being pressurized which manifests as a non-linearity in the chart above.
If we turn the scatter plot into a line plot to represent it as a time series, it looks a lot like a typical plot of hysteresis, but that seems like a red herring.
Looking at the normalized time series of the test, we can see that the sensor seems initially very linear, but then the current drops off after being exposed to pressure.
Here is some data from another test- the same strange trend occurs.
Looking at several sets of data we can see some that are complete garbage (blue data, yellow data, orange data) while some seem highly linear (green, red). Not exactly a good look for a mission-critical sensor that is helping you make life support decisions. Imagine trying to drive the speed limit if your speedo didn’t work!
I strongly suspect that pressure is playing a role here. First, sometimes gas is trapped under the sensor membrane, which causes the sensor to always read high, and to actually drop in current as pressure is applied. This seems to happen as the gas contracts and the membrane basically vaccum seals to the cathode. While oxygen is now coming into contact with the cathode, there is no opportunity for it to interact with the electrolyte, and this causes the current to drop.
Another factor is that in order to get the membrane closer to the cathode, I have had to burp out some electrolyte manually. This probably causes a slight negative pressure on the sensor as the membrane tries to regain its shape- I suspect that this can pull in gas and cause the gas blocking problem.
To solve this, I tried reducing the gap between the top lip of the sensor and the cathode, and making the sensors up “underwater” in electrolyte. This did seem to help with bubble elimination, but I still had a maddening and slow loss of current over time- uA over minutes or hours. these sensors show that good linearity can be achieved, but this drift is unacceptable for rebreather applications.
Additionally, I suspect that the sensor may not be fully watertight. That’s no good, since there needs to be electrolyte in there or it wont work! Some of the slow DC drift that I see could be due to this, or to evaporation through the teflon tape. The volume is <<1ml so even a small amount of evaporation could have an effect. I may try to remedy this or I may try to make a galvanic sensor…it turns out all I need is a little zinc or lead.
To be continued I guess!
DIY Polarographic Oxygen Sensor: Fabrication
I originally started by writing this post, but then decided to write a little more about the theory of polarigraphic O2 sensors first. This will skip most of the theory and just talk about how I built the thing.
Aside from a few small wires and a small knob of delrin, this is what is needed for an oxygen sensor. A teeny chunk of platinum, a silver tube and Potassium Hydroxide (sold for making soap).
Based on some unscientific googling, I made up a ~4M solution of KOH because it seems to be a relatively common concentration. The electrolung used a .5 N (normal) solution and other papers quote 1 N solutions. For KOH, normality is the same a molarity, so I will need a much less concentrated solution in the future.
The three big takeaways here are that:
1) KOH seems to be kinda nasty stuff, and it should stay far away from your skin.
2) KOH is hygroscopic (picks up water), so it should probably be baked at 100C to remove water before weighing. I didn’t do this so who knows what molarity my solution really is- its “4M or below”
3) Mixing KOH into water is exothermic and also takes a while to fully dissolve. If you don’t know what you are doing, it seems best to let the angry little salts do their own thing.
After writing this and doing some testing, I found that KCl was also a fine electrolyte. 1-3M solutions can be purchased for a reasonable sum on amazon as dissolved oxygen (DO) cell storage solution. It would also be quite easy to make a solution of KCl, but I didn’t want to deal with dehydrating the salts.
KCl is my preferred electrolyte since it is more like salty water than draino. It feels a lot safer to be pipetting salty water at my desk vs super draino, and were I to re-do this I would skip the KOH for this sensor.
The 6mm diameter platinum electrodes were cut from a small sheet of 95% Pt 5% Rh from Rio Grande. Pt is surprisingly dense, and actually very annoying to machine for many reasons- it is tough, and compared to other materials, expensive. So to get as many parts as possible, I went with a “boring” operation using a .5mm 4fl carbide endmill with ~.00025″ chip thickness and .0015″ feed per revolution. I think that sawing electrodes out with a jewelers saw is probably a little easier, since my fixturing method (2 side blue tape + superglue) did not hold up to machining for one of the electrodes. Fortunately, I recovered that electrode with some filing (which worked very well). The short version of this is that there is absolutely no reason to CNC machine this stuff.
The silver anodes (999 Ag tube) were machined on a lathe. Aside from the fancy oring gooves, there’s no reason this could not be done with a hacksaw (gently, so as to not mess up the tube). Originally I wanted to use a rubber boot instead of orings, but that would have taken longer with what I had on hand. The electrodes are 6mm long with an OD of .375″ and an ID of .335″.
The body of the sensor was made of delrin. As you can see in the cross section above, there are some grooves here and there for things like wiring the Pt electrode as well as a pocket for the electrode. There is even a hole for wiring the silver electrode, which is not necessary (but it is nice).
Since the o-rings were a last minute addition to avoid finding and drilling a hole in rubber, I also made a delrin sleeve to fit over the orings and hold on the membrane.
First a wire was soldered onto the Pt disc. This was done with normal SnPb electronics solder. This wire was run through the sensor body, and a dab of silicone was used to seal it to the body housing. NB these electrodes are pricey and a pain to make, but are also extremely reusable. Using silicone makes them more recoverable. For a “real” sensor, there is also room in the wiring hole to fit a thermocouple for temperature compensation.
Next, the silver electrode was added, and a wire was soldered on. This extra hole gives me some pretty slick wire routing. NB this was done by sanding down the silver a little to get the solder to wet. I don’t think silver oxides are easy to solder to so this needs to happen before the sensor is used.
With the orings assembled, a few drops of electrolyte are added to the surface and a teflon membrane was stretched overtop, before placing on a retaining ring to hold the teflon in place (pinched between the orings and the ring). The “teflon membrane” is plumbers pipe tape.
With the sensor wired up, of course I was curious if I had just completed an expensive art project or if I had actually made an oxygen sensor. Fortunately I had enough spare rebreather parts around to shoot some O2 at the sensor.
Initially I was disappointed because the sensor seemed to not do anything aside from operate like a galvanic cell that reacted to oxygen (see previous post). However, after switching to a very sensitive DMM (keysight 34465a) I was able to read uA changes based on O2 concentration with .6-.8 V of bias voltage. Typical current of the cell in air was very low- maybe less than 10uA. Blasting it with oxygen bumped it up to ~100uA. The response time was extremely low (immediate, as far as I was concerned).
I intend to do a little more work on this sensor, including improving the membrane, making up a proper electrolyte solution, and (of course) testing and temperature compensation. This kind of sensor is cool- unlike gold-lead galvanic cells, it seems like they can be revived with a little electrode cleaning and adding fresh electrolyte (kind of like sea monkeys). In the electrolung, they were actually hard-wired into the rebreather*.
According to the electrolung designers, they are also less sensitive to water covering the membrane. Another nice feature is that in theory, because they constantly consume all the O2 in the electrolyte, a polarographic sensor should fail low if it looses contact with the gas to be measured. This is more obvious than a galvanic cell that may have an O2 concentration “locked in” by water, which could make the PPO2 appear good when it is not good. A cell failing low will be an obvious indication that it has gone off the rails because if the cell reads 0 and you are still breathing, there must be oxygen somewhere.
To Be Continued…
This does not mean that is necessarily a good idea. The electrolung was not a huge success, in part because sometimes people drowned while using it. Additionally, to my knowledge, nobody has decided to use polarigraphic sensors in breathing equipment since then, although they are used for some really cool stuff like measuring cellular respiration rates and dissolved blood gasses.
DIY Polarographic Oxygen Sensor: Theory
If I had a dollar for every time someone tells me I’m going to die using my oxygen rebreather, I would have about $6. However, I did royally freak out two local divers who were mystified by how I could use a rebreather and not know my ppo2. While I kind of know my PPO2, I thought it would not be a bad idea to actually measure it. And with O2 sensors in a global shortage, and with a smidgeon of knowledge from rebreather history, I figured I would try to build my own. This has turned into a much bigger project than I expected initially, and the project is certainly not done, but I have learned a ton about oxygen sensors.
History: The First PO2 Sensors
1969 is when Walter Stark and John Kanwishwer introduced the ‘Electrolung‘, which was among the first electronically controlled rebreathers. It seems like it was the first time that one could really know their PO2. John Kanwisher had recently improved the Clarke Electrode (1962, used to prove that extracorporeal oxygenation works), creating a non-fouling oxygen sensor by using a teflon and polyethylene as an oxygen permeable membrane to protect the electrode.
Construction of the Electrode
Mechanically, as you can see, the electrode is pretty simple. A Platinum disk with a silver-silver oxide electrode is covered by teflon, after trapping some KOH electrolyte underneath it. Less simple is the reaction. As I understand it, at the platinum electrode, dissolved O2, water, and electrons from the bias voltage to form hydroxides. At the silver anode, silver and hydroxides form silver oxides and electrons. One difference between the original clarke electrode and modern electrodes is that modern cell use KCl. Both certainly work, although KCl makes AgCl instead of Ag2O. I believe the reason for this switch is that KOH solutions are very chemically active and will turn people into soap, while KCl is a lot less active. Oddly both are food additives, although KCl has an LD50 of about 10x that of KOH.
The original paper suggests sticking the whole sensor into a vat of KOH solution and capping the sensor under the solution, so it seems a lot less scary to do that with salt water instead of a strong base. I hope they wore gloves (but I suspect they didn’t)!
Most importantly- it is key to understand what dissolved O2 is supposed to do in this sensor- it allows current to flow with a bias voltage across the cell (variable impedance), unlike a galvanic cell which causes current to flow (fuel cell/battery).
Observed Sensor Behavior
This type of oxygen sensor seems simple, but there are some subtleties that make the behavior a little difficult to understand. Below I will try explain some interesting observed behaviors of the sensor, and why these things happen. The chart above is a handy key to the rest of this post, which will discuss what happens as the bias voltage on the sensor is increased from 0V.
No Bias Voltage (Galvanic Mode Pt-AgAgO cell)
In this mode, the sensor is producing a voltage instead of a current. As most people know from things like potato clocks and glavanic corrosion, two dissimilar metals in an electrolyte will tend to produce a voltage (across the metals). Based on my measurements and not my knowledge of chemistry, it seems like it is still the case with this cell- a small voltage (500mV) is produced between the Pt and Ag in the electrolyte. However, when exposed to oxygen, it seems like that voltage is reduced, probably by discharging the accumulated charge (voltage) back through the electrolyte. This can be considered an internal short across the electrodes of the electrical cell. However, measuring oxygen based on the blocking of this charge accumulation (voltage) does not make for a good sensor and since the voltage source is very weak, has a long recovery time (minutes/seconds). It also reads 0V (saturates) below an amount of oxygen that is useful to measure. In other words, the readings get clipped below the O2 fractions that would be useful.
Insufficient Bias Voltage (constant current)
In this mode, there is enough oxygen that the cell produces a constant current, since the “use” of the O2 is much slower than how fast the O2 is replenished. This mode should be avoided for sensing since an increase in O2 will not be noticed, since the O2 in the cell is always not depleted.
Sufficient Bias Voltage (Current proportional to O2)
In this mode, the voltage is high enough that O2 is immediately used when it enters the sensor. Therefore, the current that is produced is related to how much O2 is moving across the sensor membrane. This is the “sensor” mode of a polarigraphic O2 sensor. Again, if the size of the electrode is too small or if the membrane is too large, at high O2 concentrations the O2 diffusion could possibly catch up to the current and saturate it.
One interesting thing is here is that when the bias voltage is switched on, there will be a large spike in the current for a short time (<1s) before it settles into its “sensing” current. This is the current produced when the dissolved oxygen in the sensor is initially depleted, and it can be large- on the order of 1000s of uA (~1 mA)! If operated in the insufficient bias mode, this spike will not be seen.
Hydrolysis Bias Voltage (Constant current)
At this voltage, the water in the electrolyte will start to break apart and form gas. I would imagine that the current here is dominated by the conductivity of the electrolyte, but I haven’t made any measurements here.
What the heck is a Polarograph?
That’s a good question- the polargram is a representation of the sensor output, so called because it measures the response vs the electrode vs. the polarization voltage. The chart above shows what we should be able to measure with the sensor.
What O2 Sensors Really Measure
In the sufficient bias range, more oxygen speeds the reaction and therefore increases the current. Current is proportional to the dissolved oxygen in the electrolyte, which should be limited by the diffusion across the membrane and the size and proximity of the Pt electrode to the membrane.
Polarigraphic and galvanic lead-gold sensors are sensitive not to oxygen mass or oxygen fraction (% makeup of gas that is O2), but essentially measure the rate of diffusion across the membrane (assuming they are working right). This is then calibrated to some known O2 concentrations, usually two of whatever is conveniently available- 0% (nitrogen purge), ~21% (air) and 100% (O2 purge).
This diffusion should be related to the prevalence of O2 in the sensed gas or liquid. Normal air, at a higher pressure, will have a higher availability of O2, and O2 will diffuse faster. Oxygenated media flowing by the sensor will have a higher availability than non-moving media. Temperature will also affect gas solubility and diffusion.
Oxygen Gas Sensors for Diving
For diving, the pressure plays a large role in O2 sensing. As breathing gas is compressed, the pressure increases quite a bit (up to about 4x pressure at recreational limits). When divers talk about oxygen sensors, they really are talking about measuring the oxygen partial pressure. Given some container and gas mixture, a partial pressure is the pressure a gas would have if it were allowed to take up the whole container without the rest of the gas mix. Surprisingly (or not) the sum of the partial pressures equals the pressure of the whole mix.
For nitrox-savvy folks, reading PPO2 at the surface works out easily to O2 fraction (% of gas by volume) since the oxygen measurement is happening at the surface at 1 ATA. For nitrox, this PPO2 is then used to figure out how deep you can go (increasing PPO2) before you hit a maximum PPO2 limit.
For rebreathers applications, the thing that is interesting is direct reading of PPO2, so there is no need to convert to O2 fraction. As pressure increases, so does partial pressure of oxygen, creating a higher pressure differential of oxygen across the sensor membrane, resulting in faster diffusion, which is then sensed.
Oxygen Rebreather Design and Fabrication
To Swim is Human,
…To Dive is Sublime,
……To Suck Thine Own Bubbles is Extreme— Dr. Robert R. lannello, Director, CEDU
There is something romantic about making a machine that to allow you to travel past the limits of terrestrial physiology. From the early sci-fi of Jules Verne to the Apollo missions, life support systems have been an icon of adventure for hundreds of years. Here I will document my own prototype oxygen rebreather, as well as some figures for those seeking to make their own dive equipment, including detailed drawings of the prototype rebreather I made.
Theory Of Operation
Click through slideshow for annotations
The type of rebreather I built is the oldest and simplest type- an oxygen rebreather. As its name implies, the gas that is breathed and added is 100% oxygen. If a human breathes in a breath of 100% oxygen, they will breathe out a mixture of CO2 and oxygen. If the toxic CO2 is removed, you can re-breathe the remaining gas- hence the name.
In a rebreather, CO2 is removed by a chemical scrubber, which is the white stuff in the horizontal tube in the above photo. In order for the CO2 to be removed, it needs to be pushed through this tube of scrubber. In a rebreather, the lungs of the diver are used to move gas by breathing. Obviously, a diver would not be able of compressing all the gas in their lungs into a rigid container, so there are soft counterlungs in the gas path. The gas moves back and forth from the lungs of the user and the counterlungs, through the scrubber. The simplest oxygen rebreathers do not even move gas in a loop- they are of a type called a “pendulum rebreather”, where the bulk of the gas is in the counterlung or in the lungs of the user. This rebreather is slightly more sophisticated- the gas moves in a loop instead.
This is achieved by a one-way valve in the mouthpeice. It only allows exhalation to one side of the scrubber, and inhalation from the opposite side of the scrubber. In a pendulum rebreather, it is easy to have dead volume on the ends of the pendulum- short breaths can create a buildup of CO2 which is bad. This is less likely to happen with a loop.
Of course, with oxygen is consumed by the body, and CO2 is absorbed by the scrubber chemicals, so over time the volume of gas in the loop decreases until the diver can no longer breathe. The silver item with two hoses coming out of it is the manual add valve (MAV). This allows injection of oxygen into the system.
Experienced divers (or even beginner divers, or anyone familiar with boyles law) will realize that on ascent, gas expands and that there needs to be some kind of gas dump. In order to minimize leakage potential, the gas dump for this unit is the users nose, which vents from the lungs to the water.
The driving philosophy behind this rebreather was to make something that was simple, but not too simple. For example, instead of using zip ties, clear PVC tubing and hose barbs, I went to the trouble of machining fittings for proper scuba hoses- in my opinion these are a lot safer, even though they are more expensive and require more complicated machining. On the other hand, there is no overpressure dump valve, because I did not want to botch something that could accidentally allow water into the system, which would be unpleasant.
Engineering and Physiological Constraints
The kernel of this rebreather design and sizing is the duration that it can be used to support life. In this case, the limiting reagent is oxygen. If you use more oxygen, you will be up and out of the water faster. The amount of oxygen also determines the amount of scrubber which is appropriate. For this prototype, I am using disposable welding gas cylinders. They are quite low pressure, roughly 450PSI*. This is calculated from knowing that there are roughly 30L in the cylinder, and the volume of the cylinder is about 1L. Therefore it should be 30*15 PSI. This corroborates the information found here.
*N.B. feeding this directly into scuba inflator hoses violates the hoses 300 PSI rating- a regulator would help with that. However, the volume of gas is so small that after only a small amount of O2 is dispensed, we are back under the pressure rating. I can’t say anything here aside from that I turn the O2 on very slowly, and that these hoses will probably have a very low cycles.
An M4 medical cylinder of about the same size filled to 2200 PSI might carry 113L of gas, and a scuba AL6 cylinder would carry ~160L gas. These are all very similarly sized cylinders, but the higher pressure allows for a HUGE improvement in capacity.
One question to ask is “how long will 30L of O2 allow someone to live?”. The answer (as always) is that it depends. The rule of thumb for O2 consumption that I used (pulled from here) is 3.5mL/(kg*min) at one MET where the weight is you body mass. That means as a 90 kilo person I consume about 19 L of oxygen per hour at one MET. One MET (metabolic equivalent) is if I am sitting in a chair- a walk might be 3 MET and something like running could be higher- therefore, the duration that the oxygen will last is heavily dependent on body size and personal physiology. However for a very relaxed dive, it seems like 30L could last 15 minutes or so (testing on the couch seems to confirm this rough estimate). Unlike OC scuba, there is no volumetric penalty for breathing at depth, since the gas is recycled- although more gas is required to fill the lungs to the minimum volume at depth.
The next question to ask is “How big should the scrubber be?”. One of these disposable oxygen cylinders contains about 32.5 L of oxygen, which is 44 grams. Using some math (and chemistry) we can see that 44 grams of O2 means that there are 60.5g of CO2 produced. I used this paper to derive what the ratio mass:mass of sofnolime to CO2 should be. The paper gives the time until complete scrubber breakthrough, where ppCO2 is about .1 Atm, which suggests a 3.3:1 ratio of sofnolime to CO2. I backed off of that to where the curve started to really take off around .05 Atm, and calculated using a 3.7:1 mass:mass ratio. In my calculations I also added a factor of safety of 2 to account for any variations in scrubber quality or condition. This gives me a scrubber length (for the designed diameter) of about 4″, but embarrassingly I decided to make the canister much longer to match it with the width of the O2 bottle+regulator I had, assuming they would also be mounted horizontally. On the bright side, I could pack the scrubber once, do a dive, swap tanks, and then get in another dive. You can see my math here.
On this iteration, I decided that the end caps of the design would route the hoses out horizontally. Ultimately, this made the unit very wide, and I think it would have been wiser to have the hoses routed straight up. However, this did allow for more configurations- front mount or back mount with a larger bend radius, and therefore less force on the divers jaw.
The next few sections describe details of various components of the rebreather.
A dive surface valve (DSV), allows the loop to be closed off by closing the opening to the mouthpeice when at the surface. This is useful for when you are between dives and do not want to let ambient air into the system. The DSV I chose is labeled NOT FOR REBREATHER USE- it is the Argonaut kraken DSV. It’s definitely another part that one could make, but the complicated shape makes it more appropriate to buy since it will be easier to maintain/replace.
The previous design I worked on had a huge counterlung problem: the lung tended to form a bubble at the top, far away from the hole which led back into the loop. This caused the fabric of the lung to close up against the inlet, like a flapper valve. Gas would get trapped in an un-breathable portion of the lung, which led to excess buoyancy and to gas getting trapped outside of the loop- this is bad for breathing, and scary for the diver.
For this next design, I opted for two counterlungs- one on either side, which should make it easier to breathe at any diver attitude. I used hydrapak 4L “seeker” bags. As best as I can tell, these are RF welded urethane, and they are tough and O2 compatible (or at least they are not contraindicated).
The new design better accommodates changes in diver attitude. Rolling to one side should cause at least some gas to be forced into the other lung. Pitching up and down should be accommodated by the piccolo tubes fitted to the lungs. The volume of the lungs was determined by breathing into empty 4L hydrapak seeker bags. The metric here is vital capacity- the most you can breathe out after the deepest breath (about 6L for me). My tidal volume is much much lower than that, and that is the minimum the bags need to be inflated to. However, excess capacity is not bad, in that it can help prevent immediate lung overinflation on ascent.
These 4L bags were fitted to pipe unions, allowing them to be removed and rinsed. The sheet metal casing of the unit forms a boundary for the lungs as well, preventing them from floating up and torquing the scrubber, or pinching themselves off. Two colors were used to indicate inhale and exhale, as one piccolo tube is longer than the other for hose routing reasons.
The last system was the MAV. Originally it was to have a CMF orifice as well, but that was not installed due to concerns about pre-dive leaks/overfilling of the lungs prior to the dive. The MAV is one of the more fraught parts of the system in terms of cost and rework, and thought. Originally I was planning on machining the whole valve myself, but that is annoying- parts corrode quickly in seawater, and I don’t want to have to re-do hours of lathe work every time it leaks. I want to build a rebreather, not a valve.
After some research, I found Duncan Price’s website which turned me on to clippard cartridge valves. These things are awesome! Drill a hole, drop it in, and you are good to go, aside from the rest of the plumbing.
Ultimately, that plumbing consists of two BC hoses with the 3/8″ end screwed into the MAV, and a single -4 SAE port plug to plug up the end where the valve goes in. Because the hoses are very different lengths, I opted to make both connections on the MAV side the same, because there’s little danger of assembling the unit with the wrong length of hoses.
The hoses place the MAV mid chest for ambidextrous use, which is very important, since the MAV provides life-giving oxygen.
Mistakes Were Made
I think it is important to address a few safety errors in the design of the unit. The two major lapses in the design are the use of aluminum in the MAV and scuba hoses which are not rated for an appropriately high pressure.
The hose issue is obvious in retrospect, and could easily be resolved with a regulator by finding a higher pressure rated hose and actually, I have no idea what the output pressure of the regulator I have is- I dont have an gauge that can read it- I have assumed it was tank pressure, but it may be reduced. The real trouble is with material compatibility and high pressure oxygen.
I recently got a copy of Vance Harlows Oxygen Hackers Companion (highly recommended- worth the money and you won’t find a pdf). It explains in great detail that material compatibility with high pressure oxygen is critical for preventing rapid unplanned and uncontrolled oxidization (oxygen fires). While unlikely, a sparking metal shaving, accelerated by the high pressure oxygen from the cylinder, could spark and cause the MAV to catch fire. Brass would be a much better material than 6061 (NB- 6061 does contain a small amount of iron and could possibly create sparks) brass is considered to be “non-sparking”.
On the bright side, the lack of ferrous metal shavings and oils by careful cleaning seems to have prevented any kind of unpleasant exothermic reaction. The only removable threaded connection is that of the oxygen cylinder to the brass regulator. The regulator is very soft and is unlikely to create steel slivers from the steel oxygen bottle. The other two connections are scuba BC inflator hose QDs which do not have tight metal-to-metal fits.
Here are the drawings of the entire unit, including part numbers for off the shelf parts. N.B. that all the mistakes under the “Mistakes were made” heading are documented here- not corrected. Keep that in mind when you look at them.
CEDU diver website, by Robert R. lannello. Down to earth and tongue-in-cheek (or perhaps very serious?), this website has a huge amount of information for and shows what you can do with a garage and a little knowledge.
Right up there with Dr. Bob is Alex Pierce. His youtube series covers many many dive subjects, including a DIY O2 rebreather that he and his friends built!
Jef Mangelshots excellent collection of links on the starck electrolung, one of the first closed circuit mixed-gas rebreathers was very inspirational and incredibly informative.
The rebreathersite is of course, about rebreathers. It is probably the greatest resource for research, complete with detailed photos of commercial and DIY units, including non-diving rebreathers. It also has information on the theory and operation of rebreathers.
DIY rebreathers has a lot of information, but is mostly a good collection of links to random information.
Rubicon foundation (possibly down) hosts some amazing images/text from the development of early rebreathers, including early lambertsen reabreathers (LARU).
The airspeed press has great books on technical subjects for divers, especially divers playing around with voodoo gasses. I have read the oxygen hackers companion and I am excited to dig into the rest of the books published there soon!
Richard Kinch’s website, which is mostly not about scuba, but provides some good tips on how to make a dash 3 SAE ORB fitting without a reamer.
Written by Hans Haas, an influential oxygen rebreather diver, is an honest-to-goodness book. “MANTA: Under the Red Sea with Spear and Camera” is an interesting look back at history, and a lens into early diving. Some parts of the book have not aged well, but the photos and the sense of adventure it conveys are worth a read.
These websites also are chock-full of useful info and are staffed by smart people. The difference compared to the above is that they will also sell you stuff! Good stuff!
Mcmaster-carr.com (need I say more?) Screws, aluminum extrusion, aluminum sheet…almost anything you could need.
vintage scuba supply and vintage double hose are good places to look for hose sets. Much nicer than anything I found at home depot.
dive gear express– sofnolime, hoses, fittings galore. Be sure to check out their BCD parts section too!
Just in Time Implementation of Travel Ukulele
After coming back from two weeks of traveling with my normal sized soprano uke, I decided it would be neat to build a smaller, quieter, and more robust travel uke before I headed to red river gorge to go climbing for a week. The goal was to go from a sketch in my notebook to a finished instrument in five days. Since I have limited woodworking experience, no experience with building instruments, and barely any experience playing instruments, I knew it would be a challenge.
This is a pretty text-dense post, but it should give you an idea of what I did. With only a few days to finish this, there was no time for taking nice photos!
Day 1: Research prior art, initial design, order long lead time items
With only five days, there was no time to reinvent the ukulele, or even the format of a travel uke. After looking at a lot of different designs I settled on a travel uke design by circuits and strings. It avoided a lot of things I did not have time or experience to deal with, like building an actual body for the uke. It was also suitably small and seemed to be quiet, which would be great for playing without disturbing anyone.
However, aside from the shape, I decided I would need to redesign the instrument. This was a pragmatic decision, since the tools and experience I have are very different than what the original designer has.
The major parts that I needed to fabricate or buy were:
bridge and saddle
Some of these (strings, tuners, frets) were only available from online specialty stores or amazon. Acquiring and fitting these parts was critical to the project, and if there was going to be any second chances on component selection, I needed to order them as early as possible- so I did.
After looking at many tuners, I decided that friction pegs were out, and geared tuners would be awkward to accommodate on the inside of the body, so I went with banjo tuners, because they use a planetary gear system. Unfortunately, they are heavy, and it is difficult to adapt lower profile knobs on them, so next time I would go with a typical gear tuner- even one that requires a tool.
I decided I wanted to make most of the other parts out of brass, which I imagined would look good on the maple body. In retrospect, walnut might have given it more contrast. These parts required some modeling and sizing to get right, so I waited to order them. Due to coming from mcmaster carr, they would arrive in one day instead of two.
Day 2: Wood removal begins
On this day, I bought a large piece of maple (5″x .75″x 60″), chosen carefully to have a straight grain, and to be a quarter-sawn piece to avoid cupping/warping issues. Instead of printing a paper template, I laser engraved the template onto the wood, which gave me very accurate hole dimensions and fret locations. This made it very easy to drill out the holes for the strings, and to circular-saw out the “caps” of the slot on the bottom. After that I started removing the waste from inside the slot.
Day 3: Wood removal continues, frets go in!
After finishing the slot, I roughed out the outline of the body, and cut down the thickness of the neck down to about 3/8″. After a lot of rasping, the neck started to round out and become comfortable to hold. After the neck started to look good, I sawed the slots for the frets very carefully on the lines I had cut, and installed the frets. This was harder than it looked! I definitely should have practiced the cuts more, and tested a little more to make sure I had the right width of kerf on my saw!
Day 4: So much machining!
On this day I machined the bridge, turnaround, and the pin that holds the turnaround. The bridge was CNC milled, and the pin and turnaround were turned manually. I also CNC machined special heads for the tuners, but these ended up being impossible to install. This is something that I could not have know was going to happen until I got my hands on the tuners, which did not arrive until the previous night.
With pretty much everything on hand, I decided it was time to install the tuners and cut the slot for the bridge. I also sanded the body down and gave it its first coat of tru oil. The obvious thing for this is to sand and finish the body before installing hardware, but it was too late for that because the frets were in,
Day 5: Details and Assembly!
This was the last day to work on this before getting into a car for 16 hours and going rock climbing for the week, so I had a pretty hard stop. This is when I dealt with details, like cutting the holes for and installing fret markers (sections of turned down 1/8″ brass), as well as installing the bridge and tuners.
Things that did work:
The ukulele makes the right sounds when you fret it, and it is pretty compact and tough. The zero fret works surprisingly well. It is also very quiet compared to a normal uke, but audible. And loud if you use an amp!
Things that did not work:
The low profile brass tuning knobs I made did not work- they were impossible to install because they require a profile to be cut in them that is hard to mill (but easy to broach), and because my design for them did not allow any downward force on the shaft- this is bad because the tuners require friction to prevent them from turning backwards, because it is only a 4:1 reduction.
I also went with an aluminum saddle instead of a polystyrene tube saddle. The polystyrene deformed under even moderate string tension, which seemed to make it hard to tune.
Things I would change:
Instead of brass I would use aluminum for most of the parts, or significantly reduce the size of the brass parts. Brass is heavy!
I would also get rid of the banjo tuners and go with open geared tuners. They are lighter and easier to use, and probably easier to clean if grit gets into them.
The holes for the strings could use some modification. A relief for the knot to go into on the backside would be nice, and the holes themselves need a little reinforcement- the strings cut into the wood a little.