hacking a broken cpap machine

my cpap (constant positive air pressure) machine broke during a power outage, this is how i fixed it, its a very crude fix but it works

Similar projects worth following
a few weeks ago there was a big power outage here in sollentuna/stockholm/sweden where i live, a big transformer fire left me with a burnt cpap machine, and since i can't sleep at all without it, i set out to fix it although i must admit its a very ugly hack and some of the parts are under par, but it actually works better than before, when i tore the machine apart i found that the big filter on the bottom was full of different kinds of mold, i mean FULL of mold, no wonder i had sinusitis all the time, the parts i used are what i had lying around.

I used the original motor and filter after some cleaning, an arduino uno rev 3, a spare turnigy multistar 15 amp brushless ESC to power the motor, i used masking tape, solder and a lighter, telephone cable for the wires, scissors, a piece of fruit box, and my least favorite part, menstruation pads for air filters hehe

i googled for the code until i found one that worked and i could finally sleep again

sleep apnea....

is what i suffer from

i cant sleep if i dont have a cpap machine , mostly because i get so nervous about sleeping without it

when i first got sleep apnea i was in my early 20's i remember waking up in the middle of the night gasping for air breathing in saliva and coughing to near death... 

so i got a machine, which broke so ... i made this hack to sleep since im poor and cheap hehehe

i found the code i needed here thanks to these guys for posting it

navillus5 wrote the code i think...

/ This sketch uses the servo library to arm the Hacker X-5 Pro ESC.

#include <Servo.h>

Servo esc; // Define the ESC as a servo object

int arm = 1000; // defines pulse width of 1000 us
int speedvalue;
int steady = 300;
int initiate = 0;

void setup()
esc.writeMicroseconds(arm); // This command sends a pulse train
// from pin 9 that continues until
// the pin is called to do something else.

/* Once armed the setup could also be used to specify the
run speed of the motor. The commented out lines provide
a 2 second delay between changes in speed.

void loop()

Calls a sub to throttle up motor from 0 rpm to a steady running value.
The if statement is used to run the throttle up once.
if (initiate < 1){
initiate = 1;

You can then change the speed in the main loop by changing the pulse width.
If nothing else is going on in the loop, a delay must be included otherwise
the servo writeMicroseconds is called to fast and there is not the proper
time delay between pulses (I think this is the case...need to check this
on a scope. The minimum delay is 15 ms. The lines below use a 1 second delay
between speed settings. The loop also causes this to be run once

if (initiate < 2){
for (int count = 0; count < 5; count++){
speedvalue = speedvalue+50;
for (int count = 0; count < 12; count++){
speedvalue = speedvalue-50;
initiate = 2;

esc.detach(); // Disengage ESC from pin



void throttleUp(){
speedvalue = arm;
for (int count = 0; count < steady; count++){
speedvalue = speedvalue + 1;

  • 1 × brushless cpap motor with fan
  • 1 × 15a turnigy multistar esc
  • 1 × arduino uno rev3
  • 1 × solder
  • 1 × masking tape im cheap

View all 7 components

  • 1
    Step 1

    take old broken cpap apart

  • 2
    Step 2

    remove filters and clean motor

  • 3
    Step 3

    find wires going to the motor coils

View all 11 instructions

Enjoy this project?



f3n0 wrote 08/21/2014 at 13:35 point
thanks :D , no it didn't it was a pain in the a$$ to open since it had custom screws, and the filter was a non-removable type pad that had probably never been changed, and since i rent the machine and i can't verify if the technician actually changed the filter before giving it to me it might as well have been full of mold when i got it which is kind of disgusting, but the mold was everywhere, i took the whole motor and casing apart and dipped it in vinegar alcohol and water (ättiksprit) to remove the mold and then i cleaned the intake filters with soap and water and let it dry in the sun, i should have documented this but i was so stressed to make it work the first day that i didn't think of it :(

  Are you sure? yes | no

judebrisson wrote 08/21/2014 at 13:08 point
Good share! Not everyone can afford a replacement.
Does the cpap in its original design permit access to the filter for cleaning?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates