First reflow with my workbench

Standard

I’ve recently started building my own workbench at home, and I just turned my first board out after solder paste reflow using a rework station. It was beautiful. I did not have a few components required (the design was based off sparkfun’s breakout for the MAX30105), so I winged it a bit. Pullup resistors are not 4.7k, but 5.1k and a few decoupling caps were 10uF instead of 11. The circuit itself simply has two bidirectional level converters, and a 1.8V voltage regulator acting as peripherals to the pulse oximeter chip.

A couple of things I still need to work on though

  • Getting an ESD safe bracelet and mat
  • Which is also heat resistant – I almost burnt the wood on the table I was working on.
  • Get a smoke evacuator AKA not die of lead poisoning/cancer.

I’ve been mulling over the idea of making my workbench accessible to people with open source electronics. Something similar to pro-bono work.

Updates on pulseOx prototyping

Standard

The Breakout PCB’s came in from OSHpark today, and so did the stencils from OSHstencils. I ordered 6 boards in total, 3 with the larger AMS1117 regulator, and the others will the much smaller SOT23-5 package. The stencil for the latter was made with the engphys laser cutter using the gerber files and inkscape.

  

The intended use for this breakout is a platform to use/modify the sparkfun MAX30105 (particle sensor) library for the MAX30102 (pulse ox) chip. This board can be considered the sensor layer v1.0. If required, a temperature sensor can be added on the same board with minimal modifications since the level conversion for the I2C and the power regulators are already on board.

Now that the sensor layer was taking shape, I began thinking about the other layers though which the physiological data had to pass through before it could be acted upon. From a bird’s eye view, the system has three main layers

  1. The sensor layer to acquire data
  2. The uController layer to process this data
  3. A Power management layer
  4. User Interface layer to interact with the used

Based on the conceptual framework that I’ve drawn up, the microcontroller layer would be physically sandwiched by the sensor layer and the battery/UI layers, primarily because the user does not interact with this layer directly in any way (higher level of abstraction). The top layer board will simply be a CR2016 holder or a JST header, with the LED, buzzer and button surrounding the battery footprint. The reason I’m looking at coin cell batteries (CR2016 is 3V, 100mAh) instead of LiPo (usually 3.7V, variable mAh depending on size) is the ability to replace them for cheap, unlike LiPo batteries which can be recharged but are expensive. However, if a LiPo solution needs to be prototyped, then the Adafruit LiPo battery backpack could simply be used.

For the purposes of prototyping, the microcontroller layer can simply be a Adafruit Pro Trinket. It has a footprint of 38mm by 18mm, with an microUSB port for simple reprogramming of the atmega328p. However, the FTDI port will have to be used for communication through the serial port. At the very early stages, and Arduino Uno would be a better prototpying platform (#ObviousOstrich) Though the Pro Trinket is rated for 5V operation, it can work with a 3.7V supply, though the system would not be very robust.

The image above shows a 100mAh LiPo battery connected to the battery management breakout board in the corner, which sits on the microcontroller board.

Building a prototype with a small form factor while including all the desired functionality will require some clever solution to connection to connect these multiple breakout boards to each other. This is a critical step before redesigning the board to include all the components on the same board. Thinking out loud, I can come with flex cables as a possible solution. The ones you see in mobile phones are way out of my league, flex cables with TE AMP connectors might be plausible.

A 2 inch length FFC connector with 4 solder tabs costs around 70cents and is custom made by digikey. A crude but effective solution might be to solder small gauge wire between the boards directly.

 

Disc golf and blinking LEDs

Standard

Sydnie introduced me to disc golf, which is a really cool sport. Think golf, but replace the clubs and the ball with frisbees. Vancouver, well being vancouver has quite a few disc golfing courses (which also double up as public parks – disc golf isn’t elitist). When winter sets in at the 49th parallel, it can get dark pretty early in the evening. Some amazing soul came up with the idea of putting LEDs on discs to light them up at night.

Sydnie has a bunch of them, and they’re really similar to these you can get off amazon. They’re powered by a coin cell battery and have a tactile switch that can toggle between 4 states – OFF, always ON, fast blink and slow blink. I was super impressed that all of this could be done under a price of 25$ for 12 and in that form factor. The bill of materials for each piece was definitely less than 1$. The engineer in me wanted to replicate this, and I set with much academic naïveté.

I knew the circuit definitely had

  • A dual 555 timer or equivalent to enable blinking at a slow and fast rate
  • A CR2016 battery (as mentioned in the battery specs)
  • A tactile switch
  • An LED

As engineers are always wont to do, I wanted to better the current specs and put in an RGB LED whose colors could be toggled through and blinked at different rates. I still wanted to theoretically make it cheaper than the amazon price, so $2 was my limit. There was no way and design could could come under that limit if it featured a micro controller. (An attiny85 itself costs $3 in singles). I would have to stick to using some kind of a digital IC.

An initial idea for a prototype that toggles through multiple states involved a decade counter. A decade counter IC pulls one of its 10 pins high in increasing order when it receives a clock pulse as input (detects the positive edge). A momentary tactile switch (with a capacitor across to prevent key bounce) could be used to pull up the clock pin to VDD from ground through a pull up resistor. As each of the pins of this decade counter can sink more current than the rated supply current of the LED, no additional circuitry would be required. 3*3 pins for (R,G,B)*(ON, Fast Blink, Slow Blink) and 1 pin for OFF. The plan sounded great in principle. I started making the schematics and routing the signals on a dual layer PCB. There was no way I could get this fit in the footprint of a CR2016 battery (which was a vague yardstick and also because I could get a circular PCB). I was definitely doing something wrong in my design.

However when I held Sydnie’s LED against bright light, I couldn’t see any circuitry other than the LED module, switch and the the battery terminals. There were only traces on the PCB. When i looked closely at the LED, it seemed to have too many components on the die for a single color LED. And then it clicked… the 555 die was wire bonded directly to the LED. Putting both dies on the same substrate and wire bonding them together results in a far smaller footprint than laying out a PCB and routing them external to the package. (as an aside, I was listening to the macrofab engineering podcast the other day where there’s a company trying to make systems in chips for products such as the beaglebone, cool!).

I tried finding LEDs with timers integrated, but I was probably using the wrong search terms, nothing turned up. Serendipitously, during one of my good for nothing jaunts on aliexpress, I found flashing/blinking LEDs! They look totally similar to the non flashing ones.

The LEDs I’m getting

  • 60pcs blinking solid smd 0805 LEDs for 5.5CAD (fast blink)
  • 100pcs 3mm blinking RGB DIP LEDs for 2.7CAD
  • 50pcs 0807 RGB LEDs for 6.35 (slow blink)

Ideally, connecting these LEDs to a switch and a battery is all I need to do!

But the engineering doesn’t end there and that’s the most fun part of it all. OFF-ON switches are way more expensive than simpler OFF – momentary ON switches and this makes a huge difference especially when cost is a huge specification. An OFF – momentary ON switch can either produce positive edge or negative edge clock pulses and these can be used to turn a JK flip-flop’s output high or low.

Lines in BOM

  • Tactile switch EG4621CT-ND – 2.86 CAD per 10
  • JK type flip flop 296-31493-1-ND – 5.22 CAD per 10
  • ON – OFF switch – 10.7 CAD per 10
  • Battery holder CR2016 – 4.1 CAD per 10
  • Batteries CR2016 – 9 CAD per 25
  • 470 Ohm resistor – Negligible
  • LED – negligible
  • PCB – Assuming OSH park medium run at $1/sq inch – 3 CAD per 10

Total price – 18.78 CAD per 10

YAY!

 

The MAX 30100/2 chips

Standard

A breakout for the MAX 30105 on Sparkfun introduced me to this chip family from Maxim. 30105 detects smoke using IR, Red, Green LEDs to illuminate the surroundings and a photon detecter to sense. The cool part is that the the light source and the detector are part of the IC package, along with an ADC, LED driver electronics. The sensor output to microcontrollers is through i2c.

As it turns out, Maxim has a couple of other chips (MAX 30100/1/2) in the same family, which work on the sample principle but are specialized towards measuring heart rate as well as SpO2.

(oops, sorry Premier Farnell – Totally non commercial purposes)

The easiest way to prototype would be to use a development kit offered by maxim, but unluckily the board is not in stock, and will take atleast 6 weeks for the shipment to come in. Maxim was really kind to offer me free samples of the MAX 30100 and the 30102, so the next logical step was to make my own breakout board.

Sadly, the package is non standard and features an 0.8mm pitch necessitating the need for a custom breakout board and a stencil to solder the component to the PCB using reflow. I relied on my trusty purple gold PCB supplier, OSH Park. I made the OLGA chip package for Eagle myself, so I’m not sure if it turned out right. I guess I’ll cross the bridge when I get there.

I was too cheap to order a breakout from OSH Stencils, but I could possibly use the Eng Phys project lab laser cutter to make a very basic mylar or kapton stencil.

As I dug more into the datasheet of this IC, I found that it shared a lot of similarities with the MAX 30105 – The chip used in the sparkfun breakout. I just decided to send the eagle brd files (which are open sourced under OSHW licensing – I owe Nate Seidle a beer when if I ever meet him) to OSH park as well as get a kapton stencil at OSH stencils. There’s some level converted circuitry on the breakout as well as a 1.8V SMD LDO. As I have not broken into my SMD reflow/hot air rework setups yet, I think a combination of the simple breakout shown above and circuitry on the breadboard has the greatest chance of success.

I’ve been thinking about how to miniaturize this system if it works, and here’s my thoughts on the topic

  1. Integrating it into a fitness band/watch form factor is useful to make it unobtrusive and ensure compliance.
  2. The round face can be as large as the 3V/3.3V coin cell battery required to power the system. Alternatively a LiPo battery can also be used. If a LiPo battery is used, a battery management IC needs to be used.
  3. A low power microprocessor capable of I2C
  4. A high frequency speaker and a high intensity LED.
  5. The PulseOx would have to be on the opposite side of the battery and the electronics, on the wrist.

 

Opioids and Vital Signs

Standard

Even before Rohit messaged me with a problem statement on developing an early alert system on the opioid crisis (which converted an academic interest into a tangible goal), I was intrigued by the effects of opioids on the nervous system and breathing in particular. I found this really cool review paper talking about the specific mechanisms of opioids binding to receptors in the parts of the brain (the brain stem) known to influence respiration.

The questions I’m asking myself

  1. Once a drug bolus is injected intravenously, how long does it take for the drug to reach the target receptors in the brain stem?
  2. What is the time delay between receptor binding and apnea (cessation of breathing)?
  3. By how much time does hypoxia lag apnea?

Coincidentally, my roommate Ryan is a PhD student in zoology working on the nervous system control of respiratory rate (specifically hibernation) in murine models. When I directed these questions to him, I found out a few facts that surprised me.

  1. The opioid binding to receptors is immediate once introduced into the blood and so is the respiratory depression.
  2. However, loss of consciousness can occur before the SpO2 drops, which might mean that pulse oximetry itself is redundant as an early marker.
  3. The drop in SpO2 is sharp with respect to time.

Respiratory rate and pulse oximetry are therefore crucial signs that need to observed post OD. As a change in respiratory rate precedes one in SpO2, an early detection system must rely on the former. Respiratory rate can be measured through multiple invasive methods such as capnography (measuring CO2 concentration in the expired volume) and impedance capnography (4 probe electrodes on the chest which measure impedance change). However, I came across the Nellcor technology from Medtronic-Covidien which is a software that calculates the respiratory rate using nothing but the photo plethysmograph (PPG). They allude to observing changes in the baseline value, amplitude and frequency in the pleth waveform, assigning weights and averaging over a 40 second interval to compute respiratory rate.

I found an academic abstract that discusses respiration induced variations in the PPG waveform which concludes that amplitude variations correlate with the respiratory rate. However, this correlation is confounded and overshadowed by motion artifacts. Applying excessive pressure through the pulseOx sensor has similar effects.

To conclude, a pulseox vital signs system can and should definitely be prototyped as a possible solution to early diagnosis. The next few posts will focus about issues such as human centered design, user compliance and technical details of the prototyping of a PulseOx system.

Addressing Fentanyl ODs in Vancouver

Standard

r/vancouver is my go to place for all the local news. A recent post gave me a huge jolt. 9 people had overdosed on drugs in a single night. Drugs such as heroine and cocaine are being increasingly cut with fentanyl to increase their potency. As the amount of fentanyl can vary from batch to batch, a “safe” dose could easily cause a user to overdose.

As a reactive measure, the civic authorities have started programs to educate users and the general public about fentanyl, signs of an overdose and safety precautions. At-risk users are also given a Naloxone/Narcan kit for free, which counteracts the effects of the drug.

(BC Coroners service)

Clearly there has been a downward trend over the latter half of 2016 ever since a public health emergency was declared in April. As of October 27th, 2600 Naloxone kits have been distributed by Vancouver Coastal Health. Additionally, the Provincial Health Safety Authority (PHSA), through the British Columbia Center for Disease Control (BCCDC) has a take home Naloxone program which has handed out approximately 6,000 kits so far.

In an ideal world, everyone at risk of a fentanyl overdose would be next to a bystander carrying a naloxone kit. Sadly this isn’t the case. In a real world scenario, identifying the signs of an overdose and reacting to it faster could save more lives. As a working hypothesis, I think that a vital signs tracker and alert system given out for free to the population at risk can substantially reduce fentanyl OD deaths.

A technological solution/road map furthering this hypothesis will be presented in the next post.

Making – To Make

Standard

I’ve recently had this really strong urge to make. Simply make, no strings attached.The one thing I probably have the technical training to make, are electronic circuits. After 4 years of an electrical engineering degree and an year into my masters, I’ve picked up lots of interesting skills and bits and pieces of knowledge, but rarely have I ‘made’ anything.

I have fabricated organic transistors and microfluidic channels from scratch. Somehow fabrication does not equal make. Perhaps it was because the tools and protocols for their use were already set in stone. Perhaps the desire to ‘make’ comes with an implicit desire to show and tell. A desire to inscribe your signature on your creation for the whole world to see (or the minuscule fraction of it that is interested).

Continue reading