One of our avid readers named [Felix] suffers from sleep apnea, and needs a CPAP machine in order to not suffocate while he sleeps — After a recent power-outage, his machine broke, so he decided to try his hand at fixing it.
A CPAP (Continuous Positive Airway Pressure) machine ensures people suffering from sleep apnea breath throughout the night, by preventing their throats from closing. As a medical device, they tend to be super expensive, which is why [Felix] wanted to try fixing his (at least until he gets a new machine covered by insurance).
Upon opening up the machine, it was easy to see the problem: the circuit board was completely fried. Luckily, the machine is pretty simple. It has a brushless DC motor (12V), and two chambers with air filters, along with an air pressure sensor. Since the motor is brushless, it’s not quite as simple as just hooking it up to a power supply. It had a whopping 8 separate leads.
To figure out which was which he shorted the various leads together. If the motor still spun by hand it meant he was shorting a hall effect sensor cable — if he found the two wires going to the motors coils (which he did) shorting them would cause the motor to resist being spun (known as “plug braking” a motor).
Once he identified the various wires, he grabbed an 15A turnigy motor, an Arduino, and quickly found a sketch online to program it. It doesn’t have pressure control, or ramp up times, but it does the trick and allows [Felix] to sleep again.