LPM013M126C tested

Just came here to say that the library works perfectly with the LPM013M126C  display as well! If you want I'll send a PR and add a note + a link to the breakout board I designed to the README file.

Thanks for the feedback! Yes sure, please feel free to send the PR!


Feature request: Add exact distribution to Wilcoxon test

The Wilcoxon-test currently reacts to small sample sizes by throwing the warning
Warning: sample size too small for normal approximation.

and then proceeds running the normal approximation anyway.
As the distribution of the test-statistic is not very complicated and the number of alternatives is bearable for less than 20 samples, one could enumerate all possibilities and use the exact distribution for those cases instead, which would yield a correct test for these cases.
Scipy/Numpy/Python version information:
1.2.0 1.15.4 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)

referenced explicitly in the "stats roadmap" meta issue gh-10577. so yes good idea, thanks for the suggestion @HeikoSchuett. PR welcome, or otherwise maybe one of us will get to it.
I'll close this since it's captured elsewhere.


Add unit test for Has in pkg/labels/labels.go

This PR is about adding a unit test for Has in pkg/labels/labels.go.
Signed-off-by: Hu Shuai<EMAIL_ADDRESS>

Done, PTAL.

Okay I've found the test issue, it's unrelated to your changes. Once that's fixed we can rebase again and confirm everything passes on your PR.
Thanks for your patience :)

Okay if you rebase again everything should pass :)

PTAL

PTAL. I've rebased twice again, but it still fails to pass all.

There's something going on with builds for multiple PR's, I'll check again tomorrow

If the PR is rebased on top of master the error will go

@roidelapluie @cstyan Should I rebase from the master  now?

@hs0210 yes please :)

PTAL.

LGTM


fix: server timezone

Change the time zone of the server to match the time of México City (GMT-06:00).

I moved this issue into conference-server repository


Don't close inbound notifications substreams immediately

This PR slightly modifies the behaviour of notification substreams.
The current behaviour is:

Node A opens a substream. Node A sends a handshake message.
Node B either refuses the substream by immediately closing it, or accepts by sending back its own handshake message.
After accepting the substream, node B closes its writing side.
Node A can then send messages.

This PR removes step 3, where B closes its writing side.
The motivation behind this PR is that in the future nodes would signal that they no longer want a substream by closing their writing side.
In order for this to work, they should not immediately close it.
The mechanism where node A detects when node B closes its writing side and closes as well in return can't be implemented before we first deploy this PR, as otherwise the substreams would just get closed immediately.

Doing the burnin' on my node, as usual.

Burning looks good. Since it hasn't reached maximum number of peers yet I'm going to let it run a few more hours before merging.

bot merge


Return an error for any queries that can't complete due to invalid data types

Currently, you can get into a scenario where you have the same field in multiple shards with different underlying data types.  This is due to how shards are created.  This is NOT a recommended strategy, and hopefully one users only end up in by accident.
There are two things that can happen.

When issuing a query that requires math against the specified field, if at least one of the shards has the correct data type, we can return just the data we can do arithmetic on.
If none of the shards have an underlying data type that is usable (such as string when the sum aggregate function is used), then we should return an error to the user stating that the query they asked for is invalid against the fields they specified.

Example:
select sum(bytes) from usage

If all of the data written to bytes was a string, an error should be returned.  However, if it was a float or an int then it would be fine.  If it was mixed, with both string and int, then only the ints would be added and returned, ignoring the non-valid data types.

@corylanou in the event of mixed types, how would the user know that only partial results had been returned? Can we put an error in the return as well?

I got bitten by this today and took quite some time to figure out that the datatype of the field I was trying to SUM() over was actually stored as string.
I would very much like SUM or any other arithmetic function to fail hard in case there are any shards with data type that is not applicable to the operation that is being performed. I found getting 0 as a result of SUM very confusing, but clearly an error somewhere. On the other hand, if I would get only partial results, that would be both very confusing and extremely hard to spot.

In the latest version, we fail if you are trying to use a field that doesn't work with an aggregate. We also now have #6529 for selecting a specific type and better support for casting types from different shards to the appropriate type.
I'm going to close this since I think the issue is outdated. Please reopen if I am mistaken.


Notification API (HTML5) doesn't work after Mac signing

Electron version: 1.6.10
Operating system: macOs 10.12.5

When I use the HTML5 Notification API, the notification works well with a simple electron . and:
new Notification('Hello', {
  body: 'A message here'
})

But if I package and sign my application with electron-packager & electron-osx-sign for the AppStore (with my Mac Developer), the application runs perfectly except the notifications; no notification appears.
Have you got some idea or suggestion?

@kcampion Just tested it myself... It seems working on my end.
Here's the demo code snippet: https://gist.github.com/sethlu/31e532511675a8255cb1a15f04aca1c3

Remember to put your development provisioning profile under the working directory where npm run-script build-mas is called to have it embedded automatically for correct app behavior after codesigning.

Let me know if the code functions expectedly 😺

@sethlu Thank you for your answer and your example.
In fact, my provisioning profile files were invalid while I had already used them (because they were valid). So strange.
I think this issue can be deleted because it's not a problem from electron-osx-sign ;)


ip-api does not work anymore

Well..

Are you sure? Because I tried today and it seems to be ok.

Very weird. I still can't get it to work. I even set up a VPN to the US. In any case, if it works for you, maybe something must be wrong on my side.


Release 1.0

Once this PR #22 is merged, I'd like to proceed with an initial release of 1.0 for Metrics Exporter.

Sure go for it

v1.0.0 is now created.
Closing this.


Not generating strings.xml for french languaje

I'm trying to implement this feature. I ran expo prebuild to check why I can`t change the languaje and I only get default strings.xml file in android/app/src/main/res/values/strings.xml, the file android/app/src/main/res/values-fr/strings.xml doesn't exits
I follow the instructions as suggested docs, I'm testing in emulator and physical device
import withAndroidLocalizedName from '@mmomtchev/expo-android-localized-app-name';

export default {
    name: 'my app',
    locales: {
        fr: './fr.json'
    },
    ios: {
        // iOS support is built-in in expo
        infoPlist: {
            CFBundleAllowMixedLocalizations: true
        }
    },
    plugins: [
        withAndroidLocalizedName
    ]
};

fr.json
{
    "CFBundleDisplayName": "mon app",
    "app_name": "mon app"
}

Yes, I didn't notice that something was crashing when I did the prebuild and now I see the right files. My mistake


Handle '401 token expired' error using HTTP interceptor in Angular api-service

Also get the configuration from a common config file for /api root etc.

We can actually generalize the auth/error interceptors.. just and idea.

Not doing this in favor of simplicity so closing.


Remove dependency on urllib3

@akhayyat discovered that when using Python 3 there is a dependency on urllib3 (infoportugal/wagtail-embedvideos#21). After review it looks like this dependency is unneeded. Built in libraries urllib2.open from Python 2 and and urllib.request.open from Python 3 can used instead.

:+1:

Any reason this pull request has not been merged yet? It'd be great if a new version is released with this change.

Ad least!


chore(types): make TS think that Element[Array]Finder extends WebElement

Another approach to #3721. The alternative is #3726.

Thanks!


ios: remove unnecessary setter functions

These setters are already defined by @property.

Ahh, so those setters were invisible (and therefore dead code) after all. ;). This makes #645 obsolete, right?

No, no, this PR is about ZXIEncodeHints while #645 is about ZXIDecodeHints 😉
The setters in ZXIDecodeHints, the ones that I corrected in #645, are actually necessary because they set the native ZXing hints, see here for example.
The setters in ZXIEncodeHints are just setting the property, which is already covered by @property.

Thanks for your patience in explaining the world to me ;). So the renaming is just a cosmetic change that is not observable from code using these properties and the spelling in terms of lower vs. upper case is irrelevant to the ObjectiveC compiler?

No problem, Objective-C is a bit weird from a C/C++ perspective 😉

So the renaming is just a cosmetic change that is not observable from code using these properties and the spelling in terms of lower vs. upper case is irrelevant to the ObjectiveC compiler?

Yes, oddly enough, setting a property is case insensitive in Objective-C, while methods are case sensitive.


drivers: nrf: Trigger STOP events and wait before disabling UARTE

Without first triggering TASKS_STOP{RX,TX}, I observed that the UARTE was never
disabled when using device_set_power_state which resulted in the HFCLK never
being shut down and several hundred microamps in unnecessary current consumption
when idle. This seems to fix the issue.
Signed-off-by: Benjamin Lindqvist<EMAIL_ADDRESS>

@pizi-nordic @Mierunski @jarz-nordic

@pizi-nordic perhaps?


Why is faster than standard library?

Any benchmark and proof?

😀 Benchmarks are working in progress, according my historical tests, when goroutines expand about to 5k-1w, the lib has a lesser time diff and lesser resources usage. The performance consideration is partial reason to create the lib, mostly to provide some easier method and patterns for async handler scene. If you are interested about it, welcome to PR for tests or features.

只是相对于标准库少了一些NewTimer和NewTicker的调用。如果对精度有要求，比如10ms或者1ms.这种。定时任务量大可以用，因为Timer的调用量固定. 否则感觉有点鸡肋。始终没解决linux下time.Timer的高CPU使用

@FJSDS 我自己是放在C10K/M的场景使用的，心跳、同步这些，量级会大一些


Nesting should work for more than one level

class Schema < Dry::Validation::Schema
  key(:name) { |n| n.filled? }
  key(:data) do |data|
    data.key(:invoice_address) do |invoice_address|
      %i[street zip city country].each do |f|
        invoice_address.key(f, &:filled?)
      end
    end
end

schema = Schema.new
schema.call({
                data: {
                    invoice_address: {}
                }
            })

/vendor/bundle/bundler/gems/dry-validation-57d86bbfc390/lib/dry/validation/rule.rb:61:in `block in call': undefined method `call' for :street:Symbol (NoMethodError

As discussed, this won't work, for generating rules programmatically you can use the rule ast and built-in compiler (info in the README).
FYI a block in the dsl must return last rule, because we're and-ing it with the outter rule. so every time you call invoice_address.key it adds new rule to invoice_address which may accumulate more than one rule, and if that block doesn't return a rule then we don't know what to and-with :) each returns that symbol array, so it can't work because that's what to whole block returns.
One more thing - we can come up with various interfaces to remove duplication. ie invoice_address.filled?(:street, :zip, :country) etc. Ideas welcome.

Yeah, sorry. Forgot to close this! I'm totally with you on why my code does not work.


Another array index error

Hey folks!
I'm also experiencing the Array index is out of range error. I checked your Wiki page and noticed that "symptom 2" pretty much suits my problem, and I tried all troubleshooting steps, except for reverting to a savegame from before the problem first occurred. I put a lot of work into the save in the meanwhile, so I'd love to avoid doing that if possible!
If you guys have any clues what might be going on in my logfile, I'd really appreciate a second set of eyes on it.
The short and sweet:
Simulation error: Array index is out of range.
at PassengerTrainAI.SimulationStep (UInt16 vehicleID, .Vehicle& vehicleData, .Frame& frameData, UInt16 leaderID, .Vehicle& leaderData, Int32 lodPhysics) [0x00000] in :0
at VehicleAI.SimulationStep (UInt16 vehicleID, .Vehicle& vehicleData, UInt16 leaderID, .Vehicle& leaderData, Int32 lodPhysics) [0x00000] in :0
at TrafficManager.Custom.AI.CustomTrainAI.CustomSimulationStep (UInt16 vehicleId, .Vehicle& vehicleData, Vector3 physicsLodRefPos) [0x00000] in :0
at VehicleManager.SimulationStepImpl (Int32 subStep) [0x00000] in :0
at SimulationManagerBase`2[Manager,Properties].SimulationStep (Int32 subStep) [0x00000] in :0
at VehicleManager.ISimulationManager.SimulationStep (Int32 subStep) [0x00000] in :0
at SimulationManager.SimulationStep () [0x00000] in :0
at SimulationManager.SimulationThread () [0x00000] in :0   [Core]
output_log.txt
TMPE.log

Hello,
enable One-Way Train Tracks mod because it's a dependency of one of your train stations (https://steamcommunity.com/sharedfiles/filedetails/?id=2209144173)

Hello,
enable One-Way Train Tracks mod because it's a dependency of one of your train stations (https://steamcommunity.com/sharedfiles/filedetails/?id=2209144173)

Hello,
enable One-Way Train Tracks mod because it's a dependency of one of your train stations (https://steamcommunity.com/sharedfiles/filedetails/?id=2209144173)

Thanks for the tip. I enabled the One-Way Train Tracks mod, but it didn't fix the problem, unfortunately. Here are my updated output logs with the mod enabled.
TMPE.log
output_log.txt

Could you try that again since enabling one-way tracks mod loaded all train/metro station? https://github.com/CitiesSkylinesMods/TMPE/wiki/Array-Index---Symptom-2

Just tried it again with the one-way tracks enabled and all train/metro stations, but the problem persists.

MOM mod is mentioned, looking at the stacktrace it might be broken asset. Since then a lot of code changed - irreproducible. Closing, reopen if problem still exist.


[Feature] ADDING A FEEDBACK SECTION

Description
I WANT TO ADD A FEEDBACK SECTION
Screenshots
No response
Additional Information
No response

Can you make this type of testimonial ? Have a look on design testimonial section.
https://www.figma.com/proto/XIGflIIAZWQf7tM5UXuOt4/DevsIn-Tech---Open-Source?type=design&node-id=1-474&scaling=scale-down-width&page-id=0%3A1

@AbhiPatel10, I can try making the testimonial section as it is in the figma file. But won't be able to animate it, like the cards wont move only the content will change. If you are okay with it please reply don't assign me this right now. Need to ask a few more things.

If you are able to make a design then well and good animation we can add later on. but design should be responsive and build only using tailwind css

@AbhiPatel10 I can make that . But i want to know that the testimonials will be submitted by the user and will be shown on testimonials page , something like that

It will just a static data how it looks on upper image.  @kharshita590 if you can do it then go confirm once and start building.use only tailwind css.
@ManasMadan let @kharshita590 do this.

Okay @AbhiPatel10 , I will use only tailwind css

Great go ahead


Include custom bootstrap.php file if one exists.

For background on why I created this read #8366 and #8077
I noticed that there is no way to set constants in SilverStripe before the constants.php file is loaded by autoload.php reliably. Altering index.php is not a good idea, since there are more entry points to SilverStripe (like sake)
The simples solution with no backward compatibility issues that I could see is to load a custom file before loading autoload.php if it exists (bootstrap.php seemed like a good name to me).
This needs to be changed in two places. In this repo (which this PR does) and the in the index.php file of SilverStripe - Recipe Core.
If you think this is useful, I will create a PR in SilverStripe - Recipe Core.
Also, documentation should be updated, but I am not sure where it should go.

I do not know what was going on in my head, this PR does exactly what I said should not be done, altering index.php.


Basic pump / inflator use :why not?

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?

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:

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 dirver 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.
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;
  }
}

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.

this is really great!  eager to hear how it runs over night going through breathing cycles.

Exactly what I have been looking for. Thanks !
Thinking about mixing it with decathlon snorkeling mask recently adapted by some hospitals in Italy
https://www.google.fr/amp/s/www.01net.com/actualites/comment-decathlon-pourrait-sauver-des-malades-du-coronavirus-grace-au-plan-de-son-masque-de-plongee-1881292.html/amp/

I hope bit 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
https://www.bigw.com.au/product/hinterland-electric-air-pump-12v-dc/p/8296727/

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<EMAIL_ADDRESS>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 https://github.com/jcl5m1/ventilator/issues/62#issuecomment-604719298, 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.
// the transistor which controls the motor will be attached to digital pin 9
int motorControl = 9;

//variables
int bpm = 16;
float maxPercent = 1.00;
float minPercent = 0.30;

// the setup routine runs once when you press reset:
void setup() {
  Serial.begin(9600);
  // make the transistor's pin an output:
  pinMode(motorControl, OUTPUT);
  //led pin
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  if(true){
    //LED On
    digitalWrite(LED_BUILTIN, HIGH);
    // ramp up the motor speed
    for(int x = 255*minPercent; x <= 255*maxPercent; x++){
      analogWrite(motorControl, x);
      delay(60000/bpm/2/(255*(maxPercent-minPercent)));
      Serial.println(x);
      Serial.print(" ");
    }
    digitalWrite(LED_BUILTIN, LOW);
    // ramp down the motor speed
    for(int x = 255*maxPercent; x >= 255*minPercent; x--){
      analogWrite(motorControl, x);
      delay(60000/bpm/2/(255*(maxPercent-minPercent)));
      Serial.println(x);
      Serial.print(" ");
    }
  }
}

You can set the BPM (beats per minute) as well as the min and max air flow percentage.
(Sorry if I did something wrong this is my first GitHub post)

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.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

int breath = 1;
int i = 0;
int inP=1028; int inT=1028; int inP_v=1028; int inT_v=1028;
int outP=1028; int outT=1028; int outP_v=1028; int outT_v=1028;

void setup() {
  Serial.begin(9600);
  pinMode(9, OUTPUT);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); // Don't proceed, loop forever
  }

  // Show initial display buffer contents on the screen --
  // the library initializes this with an Adafruit splash screen.
  display.display();

  // Clear the buffer
  display.clearDisplay();
}

void loop() {
  // clear the display and set up initial values

  // is the next breath an in or out?
  if (breath !=0) {breath = 0;}
    else breath = 1;
    Serial.println(breath);

  // apply the in breath or out breath code
  switch (breath) {
    case 0: //breathe in
    i = 0;
    Serial.println(i); Serial.println(inT_v);
      while (i <= inT_v) {
        // read the potentiometers and determin the in breath pressure and time
        inP = analogRead(A0);
        inT = analogRead(A3);
        inP_v = ceil(inP/100)*25.5;
        inT_v = round(inT/100);

        Serial.println("Breath in");

        // used to show the values on the OLED display
        display.clearDisplay();
        display.setCursor(0,0); display.setTextSize(1); display.setTextColor(WHITE);
        display.print(F("DIY Ventilator v1.0"));
        display.setCursor(0,16); display.setTextSize(2);
        display.print("BREATH IN");
        display.setCursor(0,40); display.setTextSize(1);
        display.print("Pressure: "); display.print(ceil(inP_v/2.55)); display.println("%");
        display.setCursor(0,50);
        display.print("Time: "); display.print(inT_v*400); display.println("ms.");
        display.display();

        // we will output the PWM voltage and delay only 400ms here and loop through a maximum of 10 periods
        // this allows us to re-read the pressure and time every 400ms instead at the end of each breathing cycle
        analogWrite(9, inP_v);
        delay(400);
        i++;
      }
      break;

    case 1: //breathe out
    i = 0;
      while (i <= outT_v) {
        // read the potentiometers and determin the in breath pressure and time
        outP = analogRead(A1);
        outT = analogRead(A2);
        outP_v = ceil(outP/100)*25.5;
        outT_v = round(outT/100);

        Serial.println("Breath out");

        // used to show the values on the OLED display
        display.clearDisplay();
        display.setCursor(0,0); display.setTextSize(1); display.setTextColor(WHITE);
        display.print(F("DIY Ventilator v1.0"));
        display.setCursor(0,16); display.setTextSize(2);
        display.setCursor(0,16); display.setTextSize(2);
        display.print("BREATH OUT");
        display.setCursor(0,40); display.setTextSize(1);
        display.print("Pressure: "); display.print(ceil(outP_v/2.55)); display.println("%");
        display.setCursor(0,50);
        display.print("Time: "); display.print(outT_v*400); display.println("ms.");
        display.display();

        // we will output the PWM voltage and delay only 400ms here and loop through a maximum of 10 periods
        // this allows us to re-read the pressure and time every 400ms instead at the end of each breathing cycle
        analogWrite(9, outP_v);
        delay(400);
        i++;
      }
      break;
  }

}//end loop

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.

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 :)

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
ENA / ENB ---> D9
IN1 / IN2  ---> +5V ---> To powered the breadboard
IN3 / IN4  --->  GND
Pinout Pot ---> Arduino
Pot 1 ---> A0
Pot 2 ---> A1
Pot 3 ---> A2
Pot 4 ---> A3
Line 5v breadboard line ---> Arduino +5V
Line GND breadboard line ---> Arduino GND
Pinout L298 --->  To motor
OUT1 ---> Red 12V
OUT2 ---> Black GND
      OUT3 ---> Red 12V
      OUT4 ---> Black GND

The potentiometers are noted 10K i do not know if it is good.

Thank you so much.

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 .

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.
What you are aiming for is to see if you can control the voltage from one of the motor outputs to make it different from the 12v in. You can run a code that just goes High Low High Low on the pin 9 output and see if you can see a change in voltage at the motor output terminals.
Once you can do that, you can then try bridging both sides of the L298N so that the voltage at motor 1 and motor 2 is the same and changes at the same time with your code.
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/

The potentiometers are noted 10K i do not know if it is good.

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, 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:
https://gitlab.com/alex.leblanc/ventilificator

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).

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.

 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.
Plus you need to run ground from the Arduino to IN2&3 as well as the ground on the screw terminal. This is the black wire below.
Finally, you need 12v going just to the 12v screw terminal. This is the purple wire below. Take all the jumpers off the board.
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 will try to see if hope is reborn.
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.

Adamculleeeeeeeennnnnnnnnnnn :)
Thank you from the bottom of my heart, it works very very well, it's incredible the settings step by step

No problem. Can I ask what country you are in?

I am of Turkish origin and I live in France, thank you again Adamcullen, I love you :)

I've seen how bad this is in France, Spain, Italy and the UK. Hopefully all our work can help save lives. Good luck.

Thank you dear friend, it is difficult because the government did not do its job, the hospitals were on strike before the appearance of this virus to denounce the lack of means but the government to shut the ears, then during the epidemic for lack of protective mask, the government to shout that it was useless to wear masks ...
Then the patients doubled, tripled. Especially for Italy and Spain, we pray that it stops, man has no strength in the face of this tiny virus, long life to the people of the world.

Dear Adamcullen, are you from Australia?

Yes.
Get BlueMail for Android
On 5 Apr. 2020, 10:19 am, at 10:19 am, Col68<EMAIL_ADDRESS>wrote:

Dear Adamcullen, are you from Australia?
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-609108335

In Australia there was a Turkish friend who makes homemade cheese, he shares other useful experience, I had realized a lot of these recipe :)
http://artizanpeynirci.blogspot.com/ ;)
Peace, success and happiness to the people of Australia.

Hello friends
I combine with the code to succeed but it is very difficult, the address of the LCD i2c is 0x27 after the scan but it does not display anything :(
I am sorry to be null, if a friend could oriented?
Thank you very much.

`#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16,2);
int breath = 1;
int i = 0;
int inP=1028; int inT=1028; int inP_v=1028; int inT_v=1028;
int outP=1028; int outT=1028; int outP_v=1028; int outT_v=1028;
void setup()
{
Serial.begin(9600);
pinMode(9, OUTPUT);
lcd.begin(16,2);
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("Adamcullen");
lcd.setCursor(0,1);
lcd.print("-Respirator-V1");
delay(5000);
}
void loop() {
// effacer l affichage et configurer les valeurs initiales
// le prochain souffle est-il une inspiration ou une expiration?
if (breath !=0) {breath = 0;}
else breath = 1;
Serial.println(breath);
// appliquer le code d'inspiration ou d'expiration
switch (breath) {
case 0: // Inspirer
i = 0;
Serial.println(i); Serial.println(inT_v);
while (i <= inT_v) {
// lire les potentiometres et determiner la pression respiratoire et le temps
inP = analogRead(A0);
inT = analogRead(A3);
inP_v = ceil(inP/100)*25.5;
inT_v = round(inT/100);
    Serial.println("Breath in");

    // utiliser pour afficher les valeurs sur l'ecran OLED

    // nous allons produire la tension PWM et retarder seulement 400 ms ici et boucler sur un maximum de 10 periodes
    // cela nous permet de relire la pression et le temps toutes les 400 ms à la fin de chaque cycle de respiration
    analogWrite(9, inP_v);
    delay(400);
    i++;
  }
  break;

case 1: // expirer
i = 0;
  while (i <= outT_v) {
    // lire les potentiometres et determiner la pression respiratoire et le temps
    outP = analogRead(A1);
    outT = analogRead(A2);
    outP_v = ceil(outP/100)*25.5;
    outT_v = round(outT/100);

    Serial.println("Breath out");
    analogWrite(9, outP_v);
    delay(400);
    i++;
  }
  break;

}
}// boucle de fin
`

Very nice setup adamcullen .
I think the confusion comes up from your original Fritzing SETUP PICTURE ,  which has IN1 & IN2 ARE tied to High and IN3 & IN4 to Low. which would make the motors to stop.
https://user-images.githubusercontent.com/23371950/77723103-9bf70b80-7043-11ea-8c95-ec787002c5e1.JPG
In this latest wiring is the correct way to do parallel wiring in my opinion (is the one I use normally).
Kudos !!

Hi friends
Small update,  i go step by step, now i managed to have 2 display lines :)
The first line "Adamcullen" then the second "Respirator V1.0" nothing else.
The Void Setup / Void Loop section must contain errors, i will continue my research and continue to modify.
`
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16,2);
int breath = 1;
int i = 0;
int inP=1028; int inT=1028; int inP_v=1028; int inT_v=1028;
int outP=1028; int outT=1028; int outP_v=1028; int outT_v=1028;
void setup()
{
lcd.init();
lcd.backlight();
Serial.begin(9600);
pinMode(9, OUTPUT);
lcd.print("Adamcullen");
lcd.setCursor(0,1);
lcd.print("-Respirator-V1");
delay(5000);
}
void loop() {
// effacer l affichage et configurer les valeurs initiales
// le prochain souffle est-il une inspiration ou une expiration?
if (breath !=0) {breath = 0;}
else breath = 1;
Serial.println(breath);
// appliquer le code d'inspiration ou d'expiration
switch (breath) {
case 0: // Inspirer
i = 0;
Serial.println(i); Serial.println(inT_v);
while (i <= inT_v) {
// lire les potentiometres et determiner la pression respiratoire et le temps
inP = analogRead(A0);
inT = analogRead(A3);
inP_v = ceil(inP/100)*25.5;
inT_v = round(inT/100);
    Serial.println("Breath in");

    // utiliser pour afficher les valeurs sur l'ecran OLED

    // nous allons produire la tension PWM et retarder seulement 400 ms ici et boucler sur un maximum de 10 periodes
    // cela nous permet de relire la pression et le temps toutes les 400 ms à la fin de chaque cycle de respiration
    analogWrite(9, inP_v);
    delay(400);
    i++;
  }
  break;

case 1: // expirer
i = 0;
  while (i <= outT_v) {
    // lire les potentiometres et determiner la pression respiratoire et le temps
    outP = analogRead(A1);
    outT = analogRead(A2);
    outP_v = ceil(outP/100)*25.5;
    outT_v = round(outT/100);

    Serial.println("Breath out");
    analogWrite(9, outP_v);
    delay(400);
    i++;
  }
  break;

}
}// boucle de fin
`
Thank

I don't think it matters as these pins are the forward/reverse pins. You can have either of them high or low.  The spec sheet says though, that to do it in parallel 1&4 must be tied and 2&3 must also. But you can reverse the polarity, the motor would just spin the other way.
Get BlueMail for Android
On 7 Apr. 2020, 2:48 am, at 2:48 am, zero48<EMAIL_ADDRESS>wrote:

Very nice setup adamcullen .
I think the confusion comes up from your original Fritzing SETUP
PICTURE ,  which has IN1 & IN2 ARE tied to High and IN3 & IN4 to Low.
which would make the motors to stop.
https://user-images.githubusercontent.com/23371950/77723103-9bf70b80-7043-11ea-8c95-ec787002c5e1.JPG
In this latest wiring is the correct way to do parallel wiring in my
opinion (is the one I use normally).
Kudos !!
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-609909457

I'm Integrating the ATmega328P-AU with the L298 altogether in a PCB (including Oled). I left a FTDI connector in case I want to communicate with Atmega328P-AU, also I exposed the remaining GPIO to external world.
Also I integrated a solder wire system in case I want to control the motor (FWD/RVSE) from software. Took in consideration the current handling of the PCB . So far this is what I have , without the PCB Zones yet.

Hi zero48
You are very gifted, bravo for the professionalism, this project is really cool.
Thank you for your sharing.
Respect to King Adamcullen for the gift of his project.
Thank you.

Hi friends
Mission accomplished, here is the final result of the Adamcullen project, Respect to Adamcullen for sharing, the code is compatible for 1602 I2C LCD screen with the address 0x27.
I was helped by a friend on Arduino France for the correct code, Thank you and Respect to the friend Lesept. It works perfectly, i still have found and adapted a mask and continue the project to add a nebulizer using a mini humidifier (banana) integrate in a small box with water heating, it seems difficult but not impossible, in all thank you very much to everyone.
Long live sharing and respect for everyone, health, peace, success and happiness for all people, special thanks to Adamcullen the king of the project "Respirator V1" and to "Lesept" for the help with modification of the code to make it compatible with a 1602 I2C screen and without forgetting.
Thanks and respect also to Johnny Lee for sharing in the service of all peoples.
Here is the compatible code 1602 I2C and some photos ... See you soon.
`#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int breath = 1;
int i = 0;
int inP = 1028; int inT = 1028; int inP_v = 1028; int inT_v = 1028;
int outP = 1028; int outT = 1028; int outP_v = 1028; int outT_v = 1028;
void setup()
{
lcd.init();
lcd.backlight();
Serial.begin(9600);
pinMode(9, OUTPUT);
lcd.print("Adamcullen");
lcd.setCursor(0, 1);
lcd.print("-Respirator-V1");
delay(5000);
}
void loop() {
// effacer l affichage et configurer les valeurs initiales
// le prochain souffle est-il une inspiration ou une expiration?
breath = 1 - breath;
lcd.clear();
lcd.setCursor(0,1);
lcd.print(breath);
Serial.println(breath);
// appliquer le code d'inspiration ou d'expiration
switch (breath) {
case 0: // Inspirer
i = 0;
Serial.println(i); Serial.println(inT_v);
while (i <= inT_v) {
// lire les potentiometres et determiner la pression respiratoire et le temps
inP = analogRead(A0);
inT = analogRead(A3);
inP_v = ceil(inP / 100) * 25.5;
inT_v = round(inT / 100);
    Serial.println("Breath in");
    lcd.clear();
    lcd.setCursor (0,1);
    lcd.print("Breath in");

    // nous allons produire la tension PWM et retarder seulement 400 ms ici et boucler sur un maximum de 10 periodes
    // cela nous permet de relire la pression et le temps toutes les 400 ms à la fin de chaque cycle de respiration
    analogWrite(9, inP_v);
    delay(400);
    i++;
  }
  break;

case 1: // expirer
  i = 0;
  while (i <= outT_v) {
    // lire les potentiometres et determiner la pression respiratoire et le temps
    outP = analogRead(A1);
    outT = analogRead(A2);
    outP_v = ceil(outP / 100) * 25.5;
    outT_v = round(outT / 100);

    Serial.println("Breath out");
    lcd.clear();
    lcd.setCursor (0,1);
    lcd.print("Breath out");
    analogWrite(9, outP_v);
    delay(400);
    i++;
  }
  break;

}
}// boucle de fin
`

Thank you .

Well , My PCB is ready to be ordered.
I think it is more practical Than the ones using ESC.
Thanks Adamcullen , your post Inspired it.

Adam, very interesting and can't get much simpler than this!
I'd been looking at various blowers etc and thought I'd let people know to be careful that some blowers put the motor in the air path for cooling.  Lots of cheaper devices use brushed motors which can spark a bit under load and this could result in ozone in the output to the patient which is bad.    Fortunately the mattress pump seems to be good in that it seems to bleed some of the output air off and run this through the motor - so it doesn't go to the facemask.  But people should check this on whatever blower they choose.   Or choose a brushless motor.   Brushless would also definitely be preferred in environments where oxygen might be being administered.    Lots of risks in these low-cost quick designs but, as you say, if things are going crazy and no place for you at the hospital then the balance of risk changes.
Here are some numbers that I found with the inflator I bought that looks very similar to yours.  It seems to be tuned for lower pressure and higher airflow in that it draws around 3.5A with not much resistance on the output.  This is probably where it does most of it's work if inflating a mattress.  This drops to about 2.5A when there is a facemask and a person on the other end, higher pressure and lower airflow.   I had attached a water U-tube manometer I made from some PVC tube attached to a piece of wood and I was seeing a bit more than 20cm pressure at 2.5A before I backed off so the pump seems quite capable.  20cm feels like a lot however it seems that this or even a bit higher  can be necessary for people in trouble.

The pump instructions say to give the pump a rest for 10mins for each 20mins of operation but the 2.5A compared to 3.5A peak and the intermittent operation in a respiratory cycle cycle which should allow continuous operation, consistent with your finding it was OK after 24hrs.
Small motors as in this inflator seem to be expected to last in the region of 1000hrs or so with the brushes being the weakpoint however 1000hrs is 40days which sounds plenty for the sort of situation you are considering.

@adamcullen Thank you for the extensive design. This is really good.
Power draw question:
I'm wondering if you've done a power draw and have a watts needed?  Looks like 30W-rated fan, and so maybe 70watts total?  If 70watts, that's 14amps at 5V, and that's going to be difficult to power (off standard USB pack that have a max of maybe 5A, of course it's not hard to power if you build your own battery pack for that spec.)
I know one can build their won 12V battery pack, but it may be easier to use widely available USB chargers.

You might be able to steal a few ideas from this recent design...
We are promoting a design from 4/6 of an improvised PAPR. Importantly:

Using commonly available hospital viral filters
Tested in a hospital setting -- so user story has been validated.
MAIN HALO DESIGN
https://www.youtube.com/watch?v=JMXP8jAmDKA&feature=youtu.be
https://3dprint.nih.gov/discover/3dpx-013544
https://bunnyscience.dozuki.com/Guide/Bunny+Science+HALO+Respirator+(Buildable+PAPR)/4

We are looking to iterate focusing on cost and to try to limit the 3d printed parts needed. Innovation to test: baseball caps, common irrigation fittings (PVC), and silicon repair tape coupling. Cardboard.
THE MACGUYVER-COVID19 DISCORD CHANNEL
If you are interested in a channel where we have vetted people for (a) helpfulness and (b) teamworkiness and (c) stick around for more than 72hrs, check this discord server out.
I'm @Hocho on this discord server: https://discord.gg/H3jUmar (all welcome)
or<EMAIL_ADDRESS>or<PHONE_NUMBER> (text/phone)
I'm working 12hr days, 7 days a week to organize and move the needle. Small team, but good team (vetted)

My pump only has a 12v 2.5A power supply, so it can't be much more than that.
Adam

On 11 Apr. 2020, 11:31 pm, at 11:31 pm, chonghorizons<EMAIL_ADDRESS>wrote:

@adamcullen Thank you for the extensive design. This is really good.
Power draw question:
I'm wondering if you've done a power draw and have a watts needed?
Looks like 30W-rated fan, and so maybe 70watts total?  If 70watts,
that's 14amps at 5V, and that's going to be difficult to power (off
standard USB pack that have a max of maybe 5A, of course it's not hard
to power if you build your own battery pack for that spec.)
I know one can build their won 12V battery pack, but it may be easier
to use widely available USB chargers.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-612421969

some one have the sketch for a basic pump air 12v dc, using in arduino nano v3.0, and a motro driver control L298N
also coulbe have a  sketch  2 steps. 1 turn on the motor, and second or doble push, start a breath resperation.
thanks I'm amateur Lol.

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.
Adam
On 12 Apr. 2020, 2:52 pm, at 2:52 pm, Ricardo<EMAIL_ADDRESS>wrote:

some one have the sketch for a basic pump air 12v dc, using in arduino
nano v3.0, and a motro driver control L298N
also coulbe have a  sketch  2 steps. 1 turn on the motor, and second or
doble push, start a breath resperation.
thanks I'm amateur Lol.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-612564257

Ok ok thanks My friend i will do it

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. Adam
…
On 12 Apr. 2020, 2:52 pm, at 2:52 pm, Ricardo @.***> wrote: some one have the sketch for a basic pump air 12v dc, using in arduino nano v3.0, and a motro driver control L298N also coulbe have a sketch 2 steps. 1 turn on the motor, and second or doble push, start a breath resperation. thanks I'm amateur Lol. -- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: #62 (comment)

Hi everyone :)
Is it possible to use this USB desktop fan ?
Would it have enough suction to pull through a decent N95 style filter ?

Hi everyone :)
Is it possible to use this USB desktop fan ?
Would it have enough suction to pull through a decent N95 style filter ?

I really don't think so. Its aperture is way too large and running off 5v USB is probably way underpowered.
Just buy one of these https://www.amazon.es/Appearanice-Electric-Inflate-Mattress-Inflator/dp/B083NV2SZK/

Hi @adamcullen , thanks for such a quick reply :)
I considered this 5V fan as it's easy to run off a small battery, as the 12V battery pack is a bit pricey :)   But ok, I'll buy the 5V fan as well..  AND stick with what works the 12V blower .. thanks so much for this ..!

My friend the diagram that you use is for  BLDC driver and this for a BLDC motor 3 cables.
that setup in my case is using a L298, the conections are diferent.
do you have a schematic for my setup 12v pump air?
my email. is:
<EMAIL_ADDRESS> thanks my friend

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. Adam
…
On 12 Apr. 2020, 2:52 pm, at 2:52 pm, Ricardo @.***> wrote: some one have the sketch for a basic pump air 12v dc, using in arduino nano v3.0, and a motro driver control L298N also coulbe have a sketch 2 steps. 1 turn on the motor, and second or doble push, start a breath resperation. thanks I'm amateur Lol. -- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: #62 (comment)

BLDC is brushless 3 phase, L298N is brushed DC, diagram attached. The full video is here.

Yes my friend you are rigth, and thanks for excelent video, but the video show using arduino Uno, I have arduino Nano V3.0 and sketch arduino from @adamcullen project.
thanks for help to make my project cut work.

BLDC is brushless 3 phase, L298N is brushed DC, diagram attached. The full video is here.

no voltage in arduino nano 3.0 and L298N, using the diagram from adamcullen
any idea?

Yes my friend you are rigth, and thanks for excelent video, but the video show using arduino Uno, I have arduino Nano V3.0 and sketch arduino from @adamcullen project.
thanks for help to make my project cut work.

BLDC is brushless 3 phase, L298N is brushed DC, diagram attached. The full video is here.

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.
What you are aiming for is to see if you can control the voltage from one of the motor outputs to make it different from the 12v in. You can run a code that just goes High Low High Low on the pin 9 output and see if you can see a change in voltage at the motor output terminals.
Once you can do that, you can then try bridging both sides of the L298N so that the voltage at motor 1 and motor 2 is the same and changes at the same time with your code.
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,
the setup and sketch mots have the 4 potentiometter? or can run with out them, I Mean not exist a sketch that can changue the speed (simulation breath ) with out use potentiometer
thaking the exaple from sketch of Johnny Lee @jcl5m1
https://github.com/jcl5m1/ventilator/blob/master/ventilator_control/ventilator_control.ino
thanks Adam

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.
What you are aiming for is to see if you can control the voltage from one of the motor outputs to make it different from the 12v in. You can run a code that just goes High Low High Low on the pin 9 output and see if you can see a change in voltage at the motor output terminals.
Once you can do that, you can then try bridging both sides of the L298N so that the voltage at motor 1 and motor 2 is the same and changes at the same time with your code.
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,
the setup and sketch mots have the 4 potentiometter? or can run with out them, I Mean not exist a sketch that can changue the speed (simulation breath ) with out use potentiometer
thaking the exaple from sketch of Johnny Lee @jcl5m1
https://github.com/jcl5m1/ventilator/blob/master/ventilator_control/ventilator_control.ino

Try this. I've just hard coded values where the analog read would be in the sketch 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.
int breath = 1;

void setup() {
  Serial.begin(9600);
  pinMode(9, OUTPUT);
}

void loop() {
  int inP = 1028; // was: analogRead(A0); // pot 1 - in breath pressure
  int outP = 512; // was: analogRead(A1); // pot 2 - out breath pressure
  int inT = 512; // was: analogRead(A3); // pot 3 - in breath time
  int outT = 256; // was: 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;
  }
}

With wiring like this.
https://user-images.githubusercontent.com/23371950/78415437-69fe2e80-766d-11ea-85b1-486723096fc9.JPG

Excellent Adam I wil try.
in my case Im using a arduino nano V3.0  the wiring are sames pines?
thanks for time to help me on my proyect

Thanks my friend,
the setup and sketch mots have the 4 potentiometter? or can run with out them, I Mean not exist a sketch that can changue the speed (simulation breath ) with out use potentiometer
thaking the exaple from sketch of Johnny Lee @jcl5m1
https://github.com/jcl5m1/ventilator/blob/master/ventilator_control/ventilator_control.ino

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.
int breath = 1;

void setup() {
  Serial.begin(9600);
  pinMode(9, OUTPUT);
}

void loop() {
  int inP = 1028; // was: analogRead(A0); // pot 1 - in breath pressure
  int outP = 512; // was: analogRead(A1); // pot 2 - out breath pressure
  int inT = 512; // was: analogRead(A3); // pot 3 - in breath time
  int outT = 256; // was: 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;
  }
}

With wiring like this.
https://user-images.githubusercontent.com/23371950/78415437-69fe2e80-766d-11ea-85b1-486723096fc9.JPG

Excellent Adam I wil try.
in my case Im using a arduino nano V3.0 the wiring are sames pines?
thanks for time to help me on my proyect

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,
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.

Hi Tim, Im from Mexico.
with the sipporth of this guys I make my own sketch and make a ventilator made in home with a air pump rigth now are in 24hr work test, and next day we makeing test in pressure PEEP.
Sent to me a email and i cant share my projetc, i will post here in next days but for more quick anser and you can get a ventilator contact to me.
bes regard

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.

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?
Anyway excellent project Adam Cullen!

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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616036581,
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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616169730,
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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-615988028,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNIXULYK34OXF4SOQJLRNI6Z5ANCNFSM4LS24XKQ
.

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 .

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.

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<EMAIL_ADDRESS>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)
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616169730>,
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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616229745,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNKG376HJLET7RJVZGTRNNV4JANCNFSM4LS24XKQ
.

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

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

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<EMAIL_ADDRESS>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<EMAIL_ADDRESS>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)
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616169730>,
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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-616229745,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNKG376HJLET7RJVZGTRNNV4JANCNFSM4LS24XKQ
.

Hi @adamcullen ,
I'm still waiting for my PCBs to arrive , however I found a sensor I used few years back in a project, which is a MPX5010DP Datasheet . My Idea is to create a sort of spirometer and monitor mass flow air so it can be displayed as well (KPA,PSi,cmh2o). I'm writing some code , would you adapt this calculations to your Sketch? .

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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-615988028,
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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-618274448,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNMXE6BCHCFAKJLSFADRN77HHANCNFSM4LS24XKQ
.

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:

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;
  }
}

[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?

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<EMAIL_ADDRESS>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:

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;

}
}

[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:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-673054475

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;
}

Try adjusting this line
if (buttonPresses == 3){ digitalWrite(pwm, LOW);
To
if (buttonPresses == 3){ digitalWrite(LOW);
Get BlueMail for Android
On 18 Aug 2020, 9:39 pm, at 9:39 pm, gaurav12294<EMAIL_ADDRESS>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:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-675427531

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<EMAIL_ADDRESS>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:
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-675427531

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<EMAIL_ADDRESS>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
https://github.com/jcl5m1/ventilator/issues/62#issuecomment-697879923,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APHXBNMBC3PKZNMK4KWPL6TSHI7VBANCNFSM4LS24XKQ
.


Archive page isn't showing anything

When I launch a clean copy of voyager theme with jekyll serve I got no error, but the archive page seems to be empty. This problem does not exists anymore when I change the permalink to something else then /potsts/. I do not know much about Jekyll but i think this has something to do with the posts.html in the root folder, that there is some kind of conflict.

Hi. I removed posts.html.  I suggest to use archive.md instead of it. You can set any permalink in this template. I have everything working well. Does that solve your problem?

Well, thanks for the issue! I think I can close it 1e5cf50037346c3ff2f392440011aae944b4f8eb


Add a Movex Redis-Store

What
Movex needs to be able to save the state data in Redis as well.
Why
Currently it only does so in memory using the libs/movex/src/lib/movex-store/MemoryMovexStore.ts but for production usages Redis is a far better solution.
Definition of Done

The MovexRedis implements the libs/movex/src/lib/movex-store/MovexStore.ts interface
Lives at libs/movex/src/lib/movex-store/ at least for now
CRUD operations tests

Hey @GabrielCTroia, I can look into this and try it out. Can you please assign it to me?

Hey @riteshmukim, thank you for taking this one too – this is a big one! I will assign myself to it too, and we can work on it together or be here to help if you need help with!
We do have this repo https://github.com/movesthatmatter/relational-redis-store that can be useful!
Let me know your thoughts!

Closing this for now