
Picard
weiiwang01/picard
PiCard is a miniaturized Raspberry Pi Compute Module carrier board optimized for Linux server use cases.

DIY membrane nitrogen generator for home brewing nitro cold brew and beer. 50L/h output at 99.5%+ purity, 100 PSI, ~$2,200 build. Includes KiCad PCB, STM32 firmware, SolidWorks CAD, and full P&ID. Open source hardware alternative to $4,500+ commercial units.
NitrogenGenerator is an open-source printed circuit board by tinic, from the tinic/NitrogenGenerator repository on GitHub. It is a 2-layer board of 160 × 55 mm with 30 parts on 31 nets, routed with 258 tracks and 56 vias.
It is built around the IRM-45-24, R-78E5.0-0.5 and TLV70433DBVR, with the AA28F-R1 among its other parts. Its parts include 9 capacitors, 7 resistors, 6 connectors, 4 ICs and 2 diodes. It belongs with the STM32 boards of this library.
DIY membrane nitrogen generator for nitro cold brew coffee, nitro stout, and beverage push-gas service. Extracts 99.5%+ pure N₂ from compressed air. Total build cost $2,222 — about half the price of commercial alternatives like NitroBev 360 or NitroBrew.
| Spec | Value |
|---|---|
| Output flow | 50 L/h (2 CFH) at 100 PSI |
| Output purity | 99.5%+ nitrogen (≤0.5% O₂) |
| Compressed-air input | ≤ 30 L/h (1 CFM) |
| Operating pressure | 75–100 PSI |
| Air-to-N₂ ratio | ~5:1 |
| Power | 120/240 V AC (idle = 0 W; runs only when refilling) |
| Membrane | KL-AIR MNH-1512A |
| Holding tank | 5 gal Cornelius keg |
| Total cost | $2,222 |
| Option | Cost |
|---|---|
| This DIY build | $2,222 |
| NitroBev 360 | ~$4,500 |
| Industrial PSA nitrogen generator | $8,000+ |
As a home brewer CO₂ is the gas of choice for most purposes, including pushing beverages to the tap. But sometimes you don't want to just serve beer but also cold brew coffee and other non-carbonated beverages. In most cases a simple N₂ cylinder does the job — but given that air is 78% nitrogen, why not just extract it from the air? Recently products like NitroBev 360 have introduced this possibility on a small scale, at a price. Given the huge margins these niche products have to have, my thought was to build a nitrogen generator from scratch for less.
Use cases this build is sized for:
This project uses membrane separation. A membrane-based nitrogen generator works by passing compressed air through a semi-permeable membrane made of bundles of hollow polymer fibers. Oxygen and water vapor molecules, being smaller and having a higher permeation rate, pass through the membrane walls and are vented out as permeate. Nitrogen molecules, being larger and slower to permeate, remain inside the fibers and exit at the outlet as a high-purity nitrogen stream. Purity is adjustable down to about 0.5% residual oxygen — well within spec for beverage service.
A membrane generator needs continuous compressed-air flow to work. The separation relies on a sustained pressure differential across the fiber walls; if the air supply is intermittent or undersized, the differential collapses and oxygen leaks straight through. The membrane is also engineered for a specific air-flow band — undershoot it and the gas dynamics break down well before you're starving on volume.
A small needle valve on the membrane output controls purity. Open it too far and the residence time inside the fiber drops, producing high-O₂ output. Close it too far and most of your compressed air is dumped overboard as permeate, killing efficiency. This adjustment is per-membrane and is the single most important calibration step in the build.
The membrane needs clean air. Compressed air carries dust, oil aerosols, water vapor, and hydrocarbons; any of those will foul the polymer fibers. Without proper filtration, a membrane that should last years will die in hours. We filter down to 0.01 µm before the air sees the membrane.
PSA (Pressure Swing Adsorption) generators reach higher purity (down to a few ppm O₂) but use molecular-sieve beds, twin-tower switching valves, and large compressors — overkill for home use, expensive, and noisy. Membrane is the right scale here: no moving parts, low power, scales down to 50 L/h cleanly, and 99.5% purity is more than enough for beverage service.
Most commercial large-scale nitrogen equipment is built for continuous N₂ blanketing. We don't need that — a home brewer fills a keg now and then. The design priorities:
Resulting numbers:
These are the actual parts I bought, with what I paid. Substitutes are fine where noted; the membrane and the air filter are the two parts you should not cheap out on.
| # | Component | Model / part | Source | Paid | Notes |
|---|---|---|---|---|---|
| 1 | Nitrogen membrane | MNH-1512A | KL-AIR (Alibaba) | $400 | 50 L/h @ 100 PSI, 99.5%; 120 PSI max input |
| 2 | 3-stage air filter | PneumaticPlus SAFU460-N04-MEP | Amazon | $200 | 0.01 µm coalescing final stage — don't skimp |
| 3 | Air compressor | Makita MAC100Q | Hardware store | $250 | Quiet, ~1 CFM, oil-free |
| 4 | O₂ analyzer | FORENSICS O₂ Analyzer | Amazon | $200 | 0–30%, must support flow-through (tube fitting) |
| 5 | Holding tank | 5 gal Cornelius keg | Homebrew supplier | $130 | |
| 6 | Controller | Custom STM32G030 PCB | DigiKey + PCBWay | $130 | $80 BOM + $50 for 5 prototype boards. Click PLC works too (~$300) |
| 7 | Solenoid valves (×2) | AirTAC 2WA030-08 | Amazon | $80 | 24 V DC, normally closed, 1/4″ NPT, Viton seals |
| 8 | Needle valves (×2) | SURUIKE INDUSTRY 3 mm orifice | Amazon | $40 | Stainless, 1/4″ NPT |
| 9 | Pressure transducers (×2) | AUTEX 0–200 PSI | Amazon | $52 | 1/8″-27 NPT, with connector harness |
| 10 | Check valve | Low-cracking-pressure (<2 PSI) | Hardware store | $15 | |
| 11 | Fittings, tubing, cable | Mixed NPT + 8 mm push-in | Hardware store | ~$200 | |
| 12 | Enclosure | Stainless steel, laser-cut + bent | OshCut | $380 | 17-gauge (1.9 mm) — overkill, powder-coated steel halves the price |
| Total | $2,222 |
The KiCad source for the P&ID lives at PnID.kicad_sch.
The two solenoids (input air, output nitrogen) gate when air enters the membrane and when nitrogen leaves it. The controller runs this loop:
Short hysteresis timers (5–10 s) stagger the solenoid transitions to avoid oscillation around the setpoint.
The controller continuously enforces:
The state machine in CubeMX/mcp.cpp (function Slice()) reduces to:
read AirPressure1, NitrogenPressure1
if any sensor out of range: goto FAULT
if AirPressure1 > 120: goto FAULT
if AirPressure1 < 75: close both solenoids, hold
if NitrogenPressure1 >= 100: close both solenoids
if NitrogenPressure1 < 75: open AirSolenoid1 (after 10 s soft-start delay)
if AirPressure1 >= 75: open NitrogenSolenoid1
update LCD with pressures + stateThe status LCD is a 192×64 monochrome panel driven via SPI (ST7525) using the constixel graphics library. UI rendering lives in CubeMX/screen.cpp.
Two needle valves to set, in this order: input first (membrane protection), then output (purity).
The input needle valve dampens the pressure step that hits the membrane when the input solenoid suddenly opens. Without it, the membrane sees the full upstream pressure as a step function and the polymer fibers can shatter. Set this before assembling the rest of the system.
This sets your final O₂ content. You need an O₂ analyzer for this step; eyeballing it is not possible.
Mark the final valve position with a paint pen so you can return to it after maintenance.
.
├── CubeMX/ STM32G030 firmware (CMake + arm-none-eabi-gcc)
│ ├── mcp.cpp Control state machine (Slice())
│ ├── screen.cpp LCD UI rendering (constixel-based)
│ ├── build.sh One-shot build
│ └── CMakeLists.txt
├── NitrogenGenerator.kicad_* KiCad PCB project (controller board)
├── PnID.kicad_sch P&ID schematic of the pneumatic system
├── solidworks/ Mechanical CAD for the stainless enclosure
├── docs/ Datasheets (membrane, components)
├── images/ Photos and renders used in this README
├── kicad-makefile/ Production-file generation (gerbers, BOM)
└── pnid-lib/ KiCad symbols for P&ID drawinggit clone https://github.com/tinic/nitrogengenerator.git
cd nitrogengenerator/CubeMX
./build.shRequirements:
arm-none-eabi-gcc)Flash with your favourite STM32 programmer (ST-Link, Black Magic Probe, etc.) — the build emits a .elf, .bin, and .hex in CubeMX/build/.
Open NitrogenGenerator.kicad_pro in KiCad 7+. Production files (gerbers, drill, BOM) are generated by:
make -C kicad-makefileSend the resulting zip to PCBWay or any fab. 5 prototype boards came out to ~$50 including shipping at the time of writing.
solidworks/ contains the mechanical CAD. The DXF flat patterns in that folder are what I sent to OshCut. Powder-coated steel will halve the cost vs. the 17-gauge stainless I used.
If you want to build this exact one:
solidworks/ DXFs (or build your own from any rigid material).cd CubeMX && ./build.sh.PnID.kicad_sch.| Problem | Symptoms | Likely cause | Fix |
|---|---|---|---|
| No N₂ flow | Tank pressure stays flat | Output valve too closed; membrane fouled; control fault | Open output 1/4 turn; check filter element; check sensor readings on LCD |
| O₂ reading > 2% | Analyzer never drops below 2% | Output valve too open; membrane degraded; air gap in sample line | Close output 1/8 turn; verify no leaks in analyzer hose; if problem persists with new tubing, suspect membrane end-of-life |
| Flow rate < 40 L/h | Slow keg fill | Filter element clogged; output valve too closed; input pressure low | Replace filter element; open output slightly; check compressor duty |
| Compressor short-cycles | Compressor kicks on every few seconds | Check valve cracking pressure too high or leaking | Replace check valve with one that opens below 2 PSI |
| Initial high O₂ on startup | Analyzer reads room air for the first few minutes | Normal — gas needs to flush analyzer chamber | Wait 2–5 minutes after first start before adjusting |
| LCD blank but solenoids click | Display SPI fault | Loose ribbon cable; constixel bug | Reseat the LCD connector; reflash firmware |
| Interval | Task |
|---|---|
| Weekly (in active use) | Drain water from filter bowls; verify O₂ reading on a test pull |
| Monthly | Visual leak check; tighten compression fittings if any have shifted |
| Quarterly | Replace 0.01 µm coalescing filter element; inspect tubing for kinks |
| Annually | Calibrate pressure transducers against a known gauge; full system pressure test |
CO₂ is the wrong gas for nitro. The cascading creamy mouthfeel comes from N₂'s low solubility in water — CO₂ over-carbonates and changes the taste. For stout faucets and nitro cold brew you need nitrogen (or a 75/25 N₂/CO₂ blend for some stouts).
Years with proper 0.01 µm pre-filtration and clean dry air. Hours if the filter element fails or you let oil aerosols through. The filter is the single biggest determinant of membrane lifetime.
Nitro cold brew uses ~100% N₂. Traditional Guinness-style stout faucets use a 75/25 N₂/CO₂ blend ("Beer Gas") because the small CO₂ fraction keeps a bit of carbonation in the beer. This generator produces 99.5%+ N₂; for stout-blend service you'd add a CO₂ cylinder and a blender.
Yes — a stout faucet has a restrictor plate that breaks dissolved nitrogen out of solution as the beverage passes, which is what creates the cascading head. A standard tap won't produce the effect.
The output flow (50 L/h) is small enough that a normally ventilated room is fine. Don't run it in a sealed closet, walk-in cooler, or fermentation chamber without a vent — N₂ is an asphyxiant at high concentrations and you won't notice it before you're hypoxic.
The PLC works fine — my first prototype used one — but it's bulky, uses ladder logic, and the BOM is ~$300. The custom STM32G030 board is $130 in parts and parts-on-board, fits in the same enclosure as the pneumatics, and drives the LCD directly. An Arduino would also work at similar BOM cost.
Yes — the MNH-2024A membrane outputs ~120 L/h with a proportionally larger compressor (~170 L/h input). Same control logic, bigger plumbing, bigger compressor (which kills the "quiet portable" goal — at that scale you're better off with PSA).
This project is released under The Unlicense — public-domain dedication. Use any part of it for any purpose, commercial or private. No warranty, no liability. If you blow yourself up with a misconfigured nitrogen system, that is on you, not me.
If you build one, tag your photos with #DIYNitrogenGenerator so others can find it. Pull requests with improvements, alternative BOMs, or photos of working builds welcome.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 4.7uF | Capacitor_SMD:C_0603_1608Metric | C4, C5, C6, C7 |
| 3 | 0.1uF | Capacitor_SMD:C_0603_1608Metric | C1, C2, C3 |
| 2 | 1.6K | Resistor_SMD:R_0603_1608Metric | R1, R2 |
| 2 | 10K | Resistor_SMD:R_0603_1608Metric | R3, R4 |
| 2 | 1N4007 | Diode_SMD:D_SOD-123F | D1, D2 |
| 2 | 20K | Resistor_SMD:R_0603_1608Metric | R5, R6 |
| 2 | 22nF | Capacitor_SMD:C_0603_1608Metric | C8, C9 |
| 2 | 726386-2 | NitrogenGenerator:CONN_726386-2_TEC | J4, J5 |
| 2 | AA28F-R1 | NitrogenGenerator:SMD6_AA28F-R1_BTI | K1, K2 |
| 1 | 100 | Resistor_SMD:R_0603_1608Metric | R7 |
| 1 | Conn_01x06_Pin | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J6 |
| 1 | Conn_ARM_SWD_TagConnect_TC2030-NL | Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical | J1 |
| 1 | ERM19264-4 | NitrogenGenerator:ERM19264DNS-4 | J3 |
| 1 | IRM-45-24 | NitrogenGenerator:IRM-45_MWU | U2 |
| 1 | R-78E5.0-0.5 | NitrogenGenerator:R-78E-0.5_RCP | U3 |
| 1 | STM32G030F6Px | Package_SO:TSSOP-20_4.4x6.5mm_P0.65mm | U1 |
| 1 | Screw_Terminal_01x10 | TerminalBlock_RND:TerminalBlock_RND_205-00284_1x10_P5.00mm_Vertical | J2 |
| 1 | TLV70433DBVR | NitrogenGenerator:TLV70433DBVR | U4 |
It measures 160 × 55 mm and has 2 copper layers, 1.6 mm thick.
30 parts, built around the IRM-45-24, R-78E5.0-0.5, TLV70433DBVR and AA28F-R1. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the tinic/NitrogenGenerator repository on GitHub, at the commit this page was made from: the board is NitrogenGenerator.kicad_pcb and its schematic NitrogenGenerator.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask tinic before reusing the design.

weiiwang01/picard
PiCard is a miniaturized Raspberry Pi Compute Module carrier board optimized for Linux server use cases.

oskarengdahl/Powerbank-MPD-XP
A powerbank to primarily use with MDP-XP Modular Power Supply





ZeshuLiu/SX-70-Mk2
把板子上的U+ U- GND VCC焊到usb线上,连接电脑后可以当作树莓派Pico开发板进行操作,上传代码的参见这里(树莓派官网)。 \ 在将机身主控安装至机器内部之前需要将micropython固件及代码烧录至控制器中。后续可以通过机身控制器上的USB接口连接开发板并更新python代码。 将code根目录中的所有python文件上传至控制器(文件夹不需要),并且将gmain.py命名为…
