-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic pump / inflator use :why not? #62
Comments
Hi, I've just had a go at building an open source ventilator using the main thread as inspiration. I didn't have access to a CPAP pump, so I decided to give an air mattress pump a go. Here are my findings. I used (all prices in Australian dollars):
Here are some pics of the testing setup: I decided to re-use my 3M 6800 full face respirator mask, which I have following the last disaster to strike Australia earlier in the year - bushfires. This mask has 3 filter ports, and the large one at the front takes a very course 1 1/4" thread. I found the 1 1/4" BSP thread will get about a 3/4 turn and make a reasonable seal, threadtape or plumbing sealant would make a solid seal in an emergency. This mask has the added advantage of being able to hook up an air feed line to the other 2 ports, which I can add in concentrated oxygen if needed. I used the 4 potentiometers to control the strength of the pump on in and out, as well as the length of the in and out breath. As you'll see in my crude arduino code, the pots basically divide the analogue signal by 100 and round (so instead of reading 0-1028 on the analogue port, they get a value of 0-10) making the pots able to have 10 steps from 0 to max volume, and I have arbitrarily set the breath (in and out) length to 4000ms. The only other tricky part was wiring up the L298N motor driver so that it used the A and B motor outs in parallel. The L298N will only drive up to 2A, I needed at least 2.5A, so by running it in parallel I could get up to 4A. This is possible per the spec sheet on page 7, by bridging inputs 1 & 4 and 2 & 3. https://www.st.com/resource/en/datasheet/l298.pdf Here's my code for the arduino.
Hopefully this helps someone. I've spoken with an ER doctor friend, who said using an inflation pump cant be any worse in an emergency than someone having to manually "bag" a patient for a couple of weeks! I haven't been able to run a water lift test as my hose isn't opaque, but I'll try to find some and report back. I'd also like to do a test running the pump overnight to see if the motor burns out cycling up and down. Edit: I can report that the pump has survived an 8 hour test, I'll keep it running for the rest of the day to test for 24 hours. Seems promising so far, no obvious loss of power. |
this is really great! eager to hear how it runs over night going through breathing cycles. |
Exactly what I have been looking for. Thanks ! |
I hope it helps you guys in Europe. |
Final update: pump has been tested continuously now for more than 32 hours. It is still going strong, so in a dire emergency, I think this represents a viable solution. |
Where did you source the pumps? |
Just at a local department store like Target. I'm sure you could also source from camping, sports, hardware stores. (Target/Big W in Australia, but something like Walmart in the US) https://www.target.com.au/p/bestway-sidewinder-ac-dc-air-pump/58980521 Look for air mattress inflation pumps - but they have to be 12v dc, and not battery rechargeable (otherwise it will run at 12v from the battery and you can't vary the speed). |
FDA waiver just issued for alternative ventilation assistance devices. Sponsor role still required but will allow broader use by hospitals and guidance by commercial manufacturers.
https://www.fda.gov/media/136423/download <https://www.fda.gov/media/136423/download>
… On 26 Mar 2020, at 15:26, adamcullen ***@***.***> wrote:
Where did you source the pumps?
Just at a local department store like Target. I'm sure you could also source from camping, sports, hardware stores. (Target/Big W in Australia, but something like Walmart in the US)
https://www.target.com.au/p/bestway-sidewinder-ac-dc-air-pump/58980521 <https://www.target.com.au/p/bestway-sidewinder-ac-dc-air-pump/58980521>
https://www.bigw.com.au/product/hinterland-electric-air-pump-12v-dc/p/8296727/ <https://www.bigw.com.au/product/hinterland-electric-air-pump-12v-dc/p/8296727/>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#62 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AO5MJLXOHBYBY43RMTCOYE3RJPJA7ANCNFSM4LS24XKQ>.
|
Hi friends Very great respect to Adamcullen for sharing this wonderful tutorial with the Arduino code as a gift. This is exactly what i was looking for and my research was successful, thanks to you dear Adamcullen I wish you good health, peace, success and happiness. I would share images of the final result, i would have liked to use it with an STM32F103 OR STM8 if possible with the Arduino IDE but as my knowledge is limited i would be content to use an Arduino Uno. Thank you so much. |
Hello, I have been playing around with controlling a DC motor via a Mosfet. The code I have is fairly basic but if possible could someone look over it? I haven't setup potentiometer's yet for settings / speed, currently its just code variables.
You can set the BPM (beats per minute) as well as the min and max air flow percentage. |
An update - added an OLED screen to give some visual feedback about in and out breath times and pressures. This requires the use of some libraries, so not quite as straight forward as a raw Arduino code. The inclusion of the OLED screen forced me to be slightly more elegant with the code too, instead of using a raw delay for the timing, I use a set of loops with a constant delay. The number of loops is calculated based on the potentiometers. This allows me to make real time adjustments on the pot, which are output to the pump and to the display, without having to wait until the next cycle before the change takes effect. The most you have to wait is 400ms. Also included comments to make the code more readable.
|
Hello dear Adamcullen You continue to spoil us, thank you very much for your very informative, understanding and very well explained sharing. Too bad for me for not having an Oled screen, is it possible to modify it for use with the 1602 I2C screen ? I will do research and shared ... In any case, Bravo and Respect for the unforgettable Adamcullen. Thank you. |
A 1602 i2c led will work, it just needs some code modification. The oled is i2c as well, so if you get your addressing right, set up the screen size and how the output works. Sorry, I can't be much more specific than that because every screen will be different. |
Hello dear friend Thank you very much for the confirmation, i will do my research to succeed in adapting the screen to your project, it is for a personal experience. Here is an image during the test editing in amateur mode :) Sorry for my amateurism, the potentiometer are worth 500K or 250K? I go to the job to modify the code in order to adapt it, I would share my final results and my tests to contribute to this very good project. Respect at Adamcullen |
Hi friends Result, does not work for me, i notice that the L298N module is different from that of Adamcullen, i do not know if it is also necessary to supply the motor with an external power supply because the outputs of the L298N module do not supply the motor . Here is the assembly carried out: Pinout L298N ---> Arduino Pinout Pot ---> Arduino Line 5v breadboard line ---> Arduino +5V Pinout L298 ---> To motor
The potentiometers are noted 10K i do not know if it is good. Thank you so much. |
My advice is to just start with your arduino and the L298N board. If you have a small 12v motor, just wire up one of the motor outs to it and see if you can just control one small motor. if you dont have a motor, a voltmeter or even a 12v light would help fault find. Have a look at this video: https://www.youtube.com/watch?v=wjFW-TNq8Og and this how to: https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/
Any resistance on the pots is fine. You're just supplying 5v from the arduino and reading it back on the arduino through the pot. All pots vary from 0 to their max which will just scale the voltage. |
Hello Adamcullen Forgive my amateurism, thank you for your patience and your instructions which i will follow to the letter to make tests of good functioning of the module. Indeed the dissipator was very hot I think that maybe i made a bad assembly or that the module L298N is unfortunately out of service. On the Arduino monitor i can see the unanswered expectations of the module and the potentiometers ... Thank you again for your confirmation of the value of the potentiometers, thank you for your follow-up and thanks for the links , sincere greetings to King Adamcullen. |
I have an open source design that was intended to use an off-the-shelf DC pump, check it out here: EDIT: note that this has not been through design review yet |
Hello dear Adamcullen, following the functional test of the module L298N + Arduino + motor as you advised me, I notice that the module does not work, no output voltage is available on the outputs OUT1 and OUT2 towards the motor by supplying with + 12V and GND, I will order new L298N modules, no joy for me for the moment. Again thank you again for your support, my respect for you. Hello Alexandre-leblanc Thank you for sharing, it's cool to use a more powerful STM32xx than Atmega-328P. I visited your link but i found nothing of "Open Source", no necessary components, no assembly diagram, no code or sketch to inject, this could not be useful for us (the world of Open Source sharing) please specify the components and steps so that people in need try this project to evolve it ... Thank you for your understanding. |
Hi Col68, I've just done the hardware (no mech or software) and provided the raw design files (in Altium format). If I have some time later I can generate the outputs (gerbers, fab drawings, assembly drawings, BOM). I haven't set up the outjob file for it yet (nor have I created my fab/assembly notes). |
Col68, I burned up one of my L298N modules too playing around with them! So don't worry, you're not alone. The main issue is how to supply 5v to the board so it runs, while using 12v for the motors. I found that if you keep the jumper on the board to supply 5v through the onboard regulator, it also means the maximum output voltage is 5v. I dont know why. Anyway, a way around this is to supply 12v through the screw terminal and 5v and a common ground (by this i mean the wire together your ground from the 12v supply and the ground from your arduino) between the screw terminals on the L298N and the 5v output on your arduino. In summary, you need to use (from the Arduino) 5v going to IN1&4 as well as the 5v screw terminal. This is the red wire in the diagram below. Then you can control the voltage coming out of the Motor 1 and Motor 2 screw terminals by using pulse width modulation from pin 9 on the arduino to EN1 and EN2 on the L298N. This is shown as the yellow wire below. |
Hello dear Adamcullen Respect and happiness for you, i will try your modification, thank you very much for your support, the diagram and the detailed instructions. I did other experimental tests with a PWM module max 24v but the motor capacitor was extremely hot :), then i used an IRF520 module + 50K potentiometer. The main power supply is a 12V 5 Amp transformer, i used 12V + GND on the VIN / GND outputs of the Arduino and motor inputs on the IRF520 module, i was impressed by the good functioning of the modules. The PWM setting with the 50K potentiometer is very precise and the IRF520 chip has not heated but hey it's still a basic experiment. I have a lot of STM32F103 and STM8S106 cards but only one arduino uno and one mega available. Thank you for all your sharing, i wish you peace, success and happiness. Thank you. |
Adamculleeeeeeeennnnnnnnnnnn :) Thank you from the bottom of my heart, it works very very well, it's incredible the settings step by step, you are a Genius, it only remains for me to integrate the project in a box and add the tube and the mask for continue the experience in practice to understand the proper functioning, it's incredible i respect you, i will share the result of the final assembly. All the happiness for you. Long live ADAMCULLEN. |
no voltage in arduino nano 3.0 and L298N, using the diagram from adamcullen any idea?
|
My advice is to just start with your arduino and the L298N board. If you have a small 12v motor, just wire up one of the motor outs to it and see if you can just control one small motor. if you dont have a motor, a voltmeter or even a 12v light would help fault find. Have a look at this video: https://www.youtube.com/watch?v=wjFW-TNq8Og and this how to: https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/ |
Thanks my friend, thaking the exaple from sketch of Johnny Lee @jcl5m1 https://github.com/jcl5m1/ventilator/blob/master/ventilator_control/ventilator_control.ino thanks Adam
|
Try this. I've just hard coded values in my original sketch where the analog read would be to simulate values it would read from the variable pots. It should breath in for about 2 seconds at full power, then breath out for about 1 second at half power. This should get you started.
With wiring like this. https://user-images.githubusercontent.com/23371950/78415437-69fe2e80-766d-11ea-85b1-486723096fc9.JPG |
Excellent Adam I wil try.
|
Ricardo, you should be able to use my sketch with an arduino nano. Use the same wiring and the same sketch. You just need to select the nano from the boards manager. |
Hi All, I have been working on a similar device in the UK. I tried to engage with the One Million Ventilators Group with not much response. I am still working on it anyway but been considering that carbon and copper particles from the motor can contaminate the air as there is deliberate low pressure pull through the motor core through the backplate of the impeller rotor (for cooling). Also I heard that brushless motors are needed as 03 (ozone) can be generated by sparks from brush commutation. I think the voltage are too low for that but I have come up with a possible solution if anyone is interested. |
Hi Tim, |
Hi Tim, Im from Mexico.
|
Thought I'd mention for anyone thinking about these mattress pumps - they are very noisy! Especially when you are ramping the power up and down. If you listen to a CPAP machine you can appreciate the huge effort that those designers have put into the design of their air pumps to keep them quiet. However I guess if you need a ventilator you aren't going to be too bothered about noise? |
There is one problem for me with this pump. It inflate at both direction +/-. Somebody can help? |
Yes, very true, for people with sleep apnea that a prime requirement, but
for people struggling to breath it might be a nice reassuring sound
…On Sun, Apr 19, 2020 at 6:18 AM brian-mckeon ***@***.***> wrote:
Thought I'd mention for anyone thinking about these mattress pumps - they
are very noisy! Especially when you are ramping the power up and down. If
you listen to a CPAP machine you can appreciate the huge effort that those
designers have put into the design of their air pumps to keep them quiet.
However I guess if you need a ventilator you aren't going to be too
bothered about noise?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNLFIJUNA3TQPPIQALLRNKCR3ANCNFSM4LS24XKQ>
.
|
the flow is fixed, centre port for suction, peripheral port for pressure
…On Sun, Apr 19, 2020 at 5:00 PM sean4545 ***@***.***> wrote:
There is one problem for me with this pump. It inflate at both direction
+/-. Somebody can help?
Anyway excellent project Adam Cullen!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNJQO3DW2NCUIQYCRSDRNMNY3ANCNFSM4LS24XKQ>
.
|
Hi brian, Thanks for the tip on the brushless motors, that probably the
best way if the are reliable, but can they push the high volume flow at
40cmH20? . It doesnt work for my aim of an ultra easy/cheap/quick
respirator for less than $20 though. I seek to use an unmodified pump as
changing the motor over is destructive, prone to error and time consuming.
I will do some tests on the flow direction though as i assumed that as it
drew from the center it would be a low pressure area but i may be wrong.
Cheers Tim
…On Sun, Apr 19, 2020 at 1:13 AM brian-mckeon ***@***.***> wrote:
Hi Tim,
have a look back at my post on Apr 11. I was also concerned about ozone.
However I found that the motor cooling airflow in this mattress inflator
seemed to be bled off the output pressure side and then out the vents below
the motor. A bit different to vacuum cleaners etc but makes sense as the
small motor ducts could often be facing a dirt campground and you wouldn't
want to be drawing cooling air in from there. I used deflection of a small
piece of paper to try and determine airflow and it seemed to be exiting
these vents. Let me know if you find different. If you want to go brushless
you could simply buy a 12V CPAP motor and pump from DHgate or others,
https://www.dhgate.com/product/daniu-wm7040-dc-12v-24v-high-pressure-blower/505193494.html?dspm=pcen.sp.list.1.E97VPnotXnnR3Wuw0dtf&resource_id=#s1-0-1;searl|2412079574:1.
They are not that expensive although shipping times would be pretty poor at
the moment.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNIXULYK34OXF4SOQJLRNI6Z5ANCNFSM4LS24XKQ>
.
|
Yes, I see that. But can't imagine, how can it work with this arduino setap? No matter if procedure breath in or breath out- pum is still do thesame- do pressure. Should I connect two pipes? Or do something else? |
output port only, pump to inhale, slow down pump to exhale. need a small
pressure to stop lung tissue collapsing , about 2 to 4cm of water.
…On Sun, 19 Apr 2020, 22:42 sean4545, ***@***.***> wrote:
the flow is fixed, centre port for suction, peripheral port for pressure
… <#m_-140302477150017201_>
On Sun, Apr 19, 2020 at 5:00 PM sean4545 *@*.***> wrote: There is one
problem for me with this pump. It inflate at both direction +/-. Somebody
can help? Anyway excellent project Adam Cullen! — You are receiving this
because you commented. Reply to this email directly, view it on GitHub <#62
(comment)
<#62 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNJQO3DW2NCUIQYCRSDRNMNY3ANCNFSM4LS24XKQ
.
Yes, I see that. But can't imagine, how can it work with this arduino
setap? No matter if procedure breath in or breath out- pum is still do
thesame- do pressure. Should I connect two pipes? Or do something else?
I've not sufficient 12v souce yet, so cant connect pump phisically.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNKG376HJLET7RJVZGTRNNV4JANCNFSM4LS24XKQ>
.
|
Thank you! Now, I understand |
1 similar comment
Thank you! Now, I understand |
i believe you need a small voltage to maintain PEEP during exhale but needs
to be calibrated with water manometer to a couple of cm water. calibrate
inhale pressure also, maybe 25 cm water but can be less or more depending
on patient. you need to calibrate the pressures against voltage with all
your filters etc in place.
…On Sun, 19 Apr 2020, 23:03 Tim Hurdle, ***@***.***> wrote:
output port only, pump to inhale, slow down pump to exhale. need a small
pressure to stop lung tissue collapsing , about 2 to 4cm of water.
On Sun, 19 Apr 2020, 22:42 sean4545, ***@***.***> wrote:
> the flow is fixed, centre port for suction, peripheral port for pressure
> … <#m_9208433651541181752_m_-140302477150017201_>
> On Sun, Apr 19, 2020 at 5:00 PM sean4545 *@*.***> wrote: There is one
> problem for me with this pump. It inflate at both direction +/-. Somebody
> can help? Anyway excellent project Adam Cullen! — You are receiving this
> because you commented. Reply to this email directly, view it on GitHub <#62
> (comment)
> <#62 (comment)>>,
> or unsubscribe
> https://github.com/notifications/unsubscribe-auth/APHXBNJQO3DW2NCUIQYCRSDRNMNY3ANCNFSM4LS24XKQ
> .
>
> Yes, I see that. But can't imagine, how can it work with this arduino
> setap? No matter if procedure breath in or breath out- pum is still do
> thesame- do pressure. Should I connect two pipes? Or do something else?
> I've not sufficient 12v souce yet, so cant connect pump phisically.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#62 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/APHXBNKG376HJLET7RJVZGTRNNV4JANCNFSM4LS24XKQ>
> .
>
|
Hi @adamcullen , |
Hi Brian, I've done some pressure tests which confirm your findings that
flow is positive from the motor housing. Approx 2cmH2O with both ports open
and up to 10cm with output blockage. Suction blockage can be a problem
though as a even a modest restriction will cause suction through the motor
core. There needs to be care not to put restrictive filters in place unless
there is a balancing restriction in the supply side also.
…On Sun, 19 Apr 2020, 01:13 brian-mckeon, ***@***.***> wrote:
Hi Tim,
have a look back at my post on Apr 11. I was also concerned about ozone.
However I found that the motor cooling airflow in this mattress inflator
seemed to be bled off the output pressure side and then out the vents below
the motor. A bit different to vacuum cleaners etc but makes sense as the
small motor ducts could often be facing a dirt campground and you wouldn't
want to be drawing cooling air in from there. I used deflection of a small
piece of paper to try and determine airflow and it seemed to be exiting
these vents. Let me know if you find different. If you want to go brushless
you could simply buy a 12V CPAP motor and pump from DHgate or others,
https://www.dhgate.com/product/daniu-wm7040-dc-12v-24v-high-pressure-blower/505193494.html?dspm=pcen.sp.list.1.E97VPnotXnnR3Wuw0dtf&resource_id=#s1-0-1;searl|2412079574:1.
They are not that expensive although shipping times would be pretty poor at
the moment.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNIXULYK34OXF4SOQJLRNI6Z5ANCNFSM4LS24XKQ>
.
|
Hi Tim, excellent point about suction blockage possibly changing airflow direction through the motor. |
thanks. now on second day of continuous endurance test at 7.2v, looks good
as 2 pumps in series gives good results with redundancy and less heat
…On Thu, 23 Apr 2020, 09:57 brian-mckeon, ***@***.***> wrote:
Hi Tim, excellent point about suction blockage possibly changing airflow
direction through the motor.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNMXE6BCHCFAKJLSFADRN77HHANCNFSM4LS24XKQ>
.
|
Hey, sorry for being late to the party Can I use SmartElex 15S DC Motor Driver 15A (30A Peak) (https://robu.in/product/smartelex-15s-dc-motor-driver-13a-30a-peak/?gclid=CjwKCAjwps75BRAcEiwAEiACMazatx_J8pUB3IL4915iBznwlnsVFXsPhPsdaNhSU3eIoQcyIARvUhoC64IQAvD_BwE) To make the circuit less complex, while using the same code and connections? |
Hi, sure, I think that motor driver would work fine. Exactly the same inputs, simpler driver.
Get BlueMail for Android
…On 13 Aug 2020, 5:03 am, at 5:03 am, gaurav12294 ***@***.***> wrote:
> Hi, I've just had a go at building an open source ventilator using
the main thread as inspiration. I didn't have access to a CPAP pump, so
I decided to give an air mattress pump a go. Here are my findings.
>
> I used (all prices in Australian dollars):
>
> * 12v DC air pump (A$19)
> * Arduino (I've used a mega as that's whats in my test lab, but in
reality I'd use a nano) (about $5)
> * WB291111 motor driver board (which looks to me like an L298N knock
off) (about $2)
> * 4 potentiometers (less than $1)
> * washing machine flexible hose (about $30, but I'm sure there must
be cheaper options)
> * 3M 6800 full face respirator mask (about A$90, but I had one
following the bushfires!)
> * 1 1/4" to 1" BSP reducer (A$2.50)
> * 1" to 3/4" BSP reducer (A$2.50)
> * 3/4" to 20mm pressure pipe adaptor (A$2)
>
> Here are some pics of the testing setup:
> ![IMG_20200325_134845
1](https://user-images.githubusercontent.com/23371950/77499786-2bb38300-6ea7-11ea-8dd0-0dbc6addf706.jpg)
> ![IMG_20200325_134903
1](https://user-images.githubusercontent.com/23371950/77499812-3ec65300-6ea7-11ea-8be1-cc8bae74f27d.jpg)
> ![IMG_20200325_134929
1](https://user-images.githubusercontent.com/23371950/77499828-4d146f00-6ea7-11ea-8032-3a8e87859d30.jpg)
>
> ![IMG_20200325_135533
1](https://user-images.githubusercontent.com/23371950/77499869-6cab9780-6ea7-11ea-81b7-662fc51ce7c7.jpg)
> ![IMG_20200325_135624
1](https://user-images.githubusercontent.com/23371950/77499891-79c88680-6ea7-11ea-936d-89ab8e60c5aa.jpg)
>
> I decided to re-use my 3M 6800 full face respirator mask, which I
have following the last disaster to strike Australia earlier in the
year - bushfires. This mask has 3 filter ports, and the large one at
the front takes a very course 1 1/4" thread. I found the 1 1/4" BSP
thread will get about a 3/4 turn and make a reasonable seal, threadtape
or plumbing sealant would make a solid seal in an emergency. This mask
has the added advantage of being able to hook up an air feed line to
the other 2 ports, which I can add in concentrated oxygen if needed.
>
https://www.ebay.com.au/itm/Indusry-Safety-Spray-paint-Supplied-Air-Fed-Respirator-System-For-6800-Gas-Gask-/264207440778
>
> I used the 4 potentiometers to control the strength of the pump on in
and out, as well as the length of the in and out breath. As you'll see
in my crude arduino code, the pots basically divide the analogue signal
by 100 and round (so instead of reading 0-1028 on the analogue port,
they get a value of 0-10) making the pots able to have 10 steps from 0
to max volume, and I have arbitrarily set the breath (in and out)
length to 4000ms.
>
> The only other tricky part was wiring up the L298N motor driver so
that it used the A and B motor outs in parallel. The L298N will only
drive up to 2A, I needed at least 2.5A, so by running it in parallel I
could get up to 4A. This is possible per the spec sheet on page 7, by
bridging inputs 1 & 4 and 2 & 3.
https://www.st.com/resource/en/datasheet/l298.pdf
> Input 1&4 go to 5v, 2&3 to ground, enable A&B go to the arduino
analogue pin out (in my code pin 9).
>
> Here's my code for the arduino.
>
> ```
> int breath = 1;
>
> void setup() {
> Serial.begin(9600);
> pinMode(9, OUTPUT);
> }
>
> void loop() {
> int inP = analogRead(A0); // pot 1 - in breath pressure
> int outP = analogRead(A1); // pot 2 - out breath pressure
> int inT = analogRead(A3); // pot 3 - in breath time
> int outT = analogRead(A2); // pot 4 - out breath time
>
> int inP_v = round(inP/100)*25.5; // take the value from the pot,
divide by 100 and round, then multiply by 25.5 so the output value is a
multiple of 255
> int outP_v = round(outP/100)*25.5; // take the value from the pot,
divide by 100 and round, then multiply by 25.5 so the output value is a
multiple of 255
> int inT_v = round(inT/100)*400; // take the value from the pot,
divide by 100 and round, then multiply by 400 to get a proportion of
4000ms
> int outT_v = round(outT/100)*400; // take the value from the pot,
divide by 100 and round, then multiply by 400 to get a proportion of
4000ms
>
> if (breath !=0) {breath = 0;}
> else breath = 1;
>
> switch (breath) {
> case 0:
> Serial.print("Breath In. Pressure: "); Serial.print(inP_v);
> Serial.print(". In Time: "); Serial.print(inT_v);
Serial.println("ms.");
> analogWrite(9, inP_v);
> delay(inT_v);
> break;
>
> case 1:
> Serial.print("Breath Out. Pressure: "); Serial.print(outP_v);
> Serial.print(". Out Time: "); Serial.print(outT_v);
Serial.println("ms.");
> analogWrite(9, outP_v);
> delay(outT_v);
> break;
> }
> }
> ```
>
>
![driver](https://user-images.githubusercontent.com/23371950/78617600-34e71b80-78bb-11ea-8c68-7753d4333c02.jpg)
> [sorry, there was a mistake in my image, I had wired the pins wrong
in the previous image. Again, Pins 2&3 must be wired togehter and Pins
1&4 must be wired together for parallel use of the driver. Very sorry
if people have blown their L298N's because of this].
>
> Hopefully this helps someone. I've spoken with an ER doctor friend,
who said using an inflation pump cant be any worse in an emergency than
someone having to manually "bag" a patient for a couple of weeks! I
haven't been able to run a water lift test as my hose isn't opaque, but
I'll try to find some and report back. I'd also like to do a test
running the pump overnight to see if the motor burns out cycling up and
down.
>
> Edit: I can report that the pump has survived an 8 hour test, I'll
keep it running for the rest of the day to test for 24 hours. Seems
promising so far, no obvious loss of power.
Hey, sorry for being late to the party
Can I use SmartElex 15S DC Motor Driver 15A (30A Peak)
(https://robu.in/product/smartelex-15s-dc-motor-driver-13a-30a-peak/?gclid=CjwKCAjwps75BRAcEiwAEiACMazatx_J8pUB3IL4915iBznwlnsVFXsPhPsdaNhSU3eIoQcyIARvUhoC64IQAvD_BwE)
with a 75W (12V) pump
To make the circuit less complex, while using the same code and
connections?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#62 (comment)
|
Thanks for all the help, but I am coming across a problem related to the switch control of the motor that I am using. My switch responds to 1 click (CPAP mode) and 2nd click (BiPAP mode), but does not turn the device off for the 3rd click., additional clicks do not do anything. Below is my code, please suggest some solutions. int pwm = 5; byte buttonPresses = 0; // how many times the button has been pressed void setup() { void loop(){
lastPressCount = buttonPresses; } |
You've been using analogWrite for the pwm pin.
if (buttonPresses == 2){
digitalWrite(dir, HIGH);
analogWrite(pwm, 250);
delay(2000);
analogWrite(pwm, 40);
delay(2000);
}
Try it again here
if (buttonPresses == 3){
analogWrite(pwm, LOW);
}
Get BlueMail for Android
…On 18 Aug 2020, 9:39 pm, at 9:39 pm, gaurav12294 ***@***.***> wrote:
Thanks for all the help, but I am coming across a problem related to
the switch control of the motor that I am using.
My switch responds to 1 click (CPAP mode) and 2nd click (BiPAP mode),
but does not turn the device off for the 3rd click., additional clicks
do not do anything. Below is my code, please suggest some solutions.
int pwm = 5;
int dir = A1;
byte switchPin = 2; // switch is connected to pin 1
byte buttonPresses = 0; // how many times the button has
been pressed
byte lastPressCount = 0; // to keep track of last press
count
void setup() {
pinMode(switchPin, INPUT); // Set the switch pin as input
digitalWrite(switchPin, HIGH); // set pullup resistor
pinMode(pwm, OUTPUT);
pinMode(dir, OUTPUT);
Serial.begin(9600); // Set up serial communication at
9600bps
}
void loop(){
if (digitalRead(switchPin) == LOW) // check if button was pressed
{
buttonPresses++; // increment buttonPresses count
delay(500);
}
if (buttonPresses == 3) buttonPresses = 0; // rollover every 8
press
if (lastPressCount != buttonPresses) // only do output if
the count has changed
if (buttonPresses == 1){
digitalWrite(dir, HIGH);
analogWrite(pwm, 40);
}
if (buttonPresses == 2){
digitalWrite(dir, HIGH);
analogWrite(pwm, 250);
delay(2000);
analogWrite(pwm, 40);
delay(2000);
}
if (buttonPresses == 3){
digitalWrite(pwm, LOW);
}
lastPressCount = buttonPresses;
}
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#62 (comment)
|
Hello everyone, I had built a working prototype with a commercial inflator pump which had a brushed DC motor; but it gave a maximum of 15 cm H2O. I want to improve it by keeping the same housing of the pump and replacing the motor by a better brushless or brushed DC motor. Can you guys help me with the specifications required for the motor to get pressure of 40 cm H2O. I did not find a concrete motor which was selected in this thread. Any links will be very helpful. |
Hi everyone. I am persuing an approach that uses 2 low cost dc brushed
motor pumps in series, this allows up to 40 inches of water pressure
delivery with less voltage so the pumps will last longer and you have some
redundancy if one fails. You only modulate one pump and set the other for
the minimum pressure to prevent lung collapse. If a motor fails, an
emergency mode can kick in which triggers an alarm and provides a safe
respiration mode with the single working pump. Testing showed good pump
life and performance. cheers. tim
…On Wed, 23 Sep 2020, 21:52 gaurav12294, ***@***.***> wrote:
Hello everyone, I had built a working prototype with a commercial inflator
pump which had a brushed DC motor; but it gave a maximum of 15 cm H2O. I
want to improve it by keeping the same housing of the pump and replacing
the motor by a better brushless or brushed DC motor.
Can you guys help me with the specifications required for the motor to get
pressure of 40 cm H2O. I did not find a concrete motor which was selected
in this thread. Any links will be very helpful.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHXBNMBC3PKZNMK4KWPL6TSHI7VBANCNFSM4LS24XKQ>
.
|
What about using a basic pump like the one on amazon proposed in the read me ? Has someone tried ?
Any help with which Arduino extension card to purchase to pilot such a motor?
The text was updated successfully, but these errors were encountered: