
Controller
google/mozc-devices
Circuit diagrams and firmware source code for Gboard DIY keyboards

Firmware code for Smart Filament Buffer
SFB is an open-source printed circuit board by technik-gegg, from the technik-gegg/SFB repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 60.3 × 40 mm with 11 parts on 35 nets, routed with 147 tracks and 7 vias.
Its parts include 7 ICs, 3 switches and 1 connector. It belongs with the sensors and measurement boards and the AVR (ATmega, ATtiny) boards of this library.
This is the firmware for the Smart Filament Buffer as published on Printables and Thangs.
The Smart Filament Buffer (used for multi-material 3D printing) comes with an integrated 5 fold filament run-out detector, which is based on the Arduino Nano and a bunch of linear Hall-Effect sensors. An integrated I2C OLED makes reading the current status and it's configuration a breeze.
This project utilizes PlatformIO and VS-Code. Make sure you have those tools installed on your PC/Mac, open the project in VS-Code, build it, flash it onto the Arduino Nano and you're all set to go.
The schematic for this project is pretty simple and straight forward:

All the electronics will fit onto a standard 60x40 mm prototype board.
If you don't feel like wiring all this up on a prototype board by hand, head over to my PCB repository at AISLER where you can comfortably order one or more PCB(s) right away. Usually, you will get your PCB made and delivered within 7 (work) days.
Assembled PCB, with courtesy of maker Defenc
Beside the Arduino Nano, the OLED and sensors, you have 3 push buttons, labelled PREV, MENU and NEXT, to handle the integrated menus. Connector J1 is being used to attach the SFB to your 3D printer, which will supply the power to the SFB on pins 1 and 2 (GND/+5V). Pin 3 (SIG) is used to connect the run-out signal to the E-STOP header on your 3D printer controller, which becomes HIGH (+5V) as soon as a run-out is triggered.
Configured correctly, this run-out signal will cause your 3D Printer to pause the print before it starts printing hot air.
On a Duet3D controller board for example, you'll need to add these two lines of GCode in your config.g:
M591 D0 P2 C2 S1 ; Set filament sensing sensor to switch (active high)
M581 E0 T1 S1 C1 ; Configure external trigger to pause the print only when printingKlipper in contrast requires you to configure the according pin of the "runout_sensor" in your printer.cfg file, i.e. pin GPIO16, active high:
[filament_switch_sensor runout_sensor]
switch_pin: gpio16
pause_on_runout: TrueIn Marlin you'll need to enable and set up the run-out sensor in your Configuration.h file, compile and flash the new firmware. For example: Pin PA15, active high:
#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT1_PIN PA15 // Depends on your controller board!
#define FIL_RUNOUT1_STATE HIGH // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT1_PULLDOWN // Use internal pulldown for filament runout pins.
...
#endifPin 4 (RX) and Pin 5 (TX) of J1 are routed to the Arduino Nano serial port, which can be used to command the SFB to monitor a specific tool only. If none is set (T= -1), all sensors are monitored and the run-out triggers as soon as no sensor reports detecting "filament loaded". Ideally, this communication path is wired to your controller (either your 3D printer or the SMuFF) in order to set up the tool to monitor automatically during a print.
Before the SFB is ready to use, you'll need to calibrate it. Therefore, press the MENU button to open the main menu and select the item Sensors. The SFB will print the current sensor values on the display. Take care that, as long as no filaments are loaded, all sensors are within the same value range (+-20 Gs). If one or more of the sensors show a negative value while all others show positive values, you have to flip the magnets - of those showing negatives - upside-down. Once you push against the steel ball of one of the sensors, the sensor readout will raise towards the max. value of 640 (Gs). This way you're able to check whether all sensors are working correctly. Once all sensors are in the same (lower) range, press the PREV button to start the calibration sampling. After the sampling is done, the SFB will show the min./max. Gauss values at the very bottom of the display. Now press the NEXT button in order to store these values in EEPROM and the calibration is done.
In "simple mode", the run-out detection does not need to know which filament is currently in use. It will monitor all sensors continously and as soon as all of them are below the threshold (1.75 times the calibrated min. Gauss value), it'll start the run-out countdown after which the run-out is signaled. If one of the sensors gets triggered while the countdown is running, the countdown will be interrupted and the counter reset. This behaviour is needed for retractions and/or tool changes. Via the integrated menu Trigger, you're able to change the countdown timespan (15 to 120 seconds), which gets stored in the Arduinos EEPROM.
In "control mode" (means: your SFB is connected to either the SMuFFs or the 3D printers TTL serial interface via the RX pin), the SFB will monitor the run-out for the requested tool only, which is set after a Tn command has been received (n = tool number). All other sensors will be ignored and also not drawn onto the display. This stays valid until the tool is being reset by a T-1 command, which basically instructs the SFB to return to "simple mode". Please notice: Once a tool has been set, it'll be stored in the EEPROM, so that the current tool will stay active even after the SFB has been reset
Daisy-Chaining SFB devices allows you to handle more than 5 tools/filaments (up to 20). In order to use this feature, you need to add a wire from the SIG output of the next device to pin TX of the current device, set it to Chained/Last in the settings menu Mode and assign an ID in settings menu Device (according to the picture below). Chained means there is yet another device in the chain sending a run-out signal, Last means this is the very last device in the chain.

In Daisy-Chain mode only the first (0: 1st) SFB will pass the run-out signal to the 3D Printer, which follows the same strategy as with one SFB in "normal" mode, whereas the "last" device will initiate the run-out countdown. Also, numbering of the tools will be set according to the device IDs, i.e. T0-T4 on 1st, T5-T9 on 2nd, T10-T14 on 3rd.
Please keep in mind:
A shout-out goes to Oliver Kraus for his amazing U8G2 display library and Albert van Dalen for his fast analog library.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | A1326 LUA-T | Package_TO_SOT_THT:TO-92Flat | U2, U3, U4, U5, U6 |
| 3 | SW_DPST | SFB:SW_Tactile_Straight_KSA0Axx1LFTR-4Pin | SW1, SW2, SW3 |
| 1 | Arduino_Nano_v3.x | Module:Arduino_Nano | U1 |
| 1 | JST XH 1x5 angled | Connector_JST:JST_XH_S5B-XH-A_1x05_P2.50mm_Horizontal | J1 |
| 1 | SSD1306 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | U7 |
It measures 60.3 × 40 mm and has 2 copper layers, 1.6 mm thick.
11 parts. 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 technik-gegg/SFB repository on GitHub, at the commit this page was made from: the board is Schematics/SFB/SFB.kicad_pcb and its schematic Schematics/SFB/SFB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

google/mozc-devices
Circuit diagrams and firmware source code for Gboard DIY keyboards


FrameworkComputer/ExpansionCards
Reference designs and documentation to create Expansion Cards for the Framework Laptop

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!


tardate/LittleArduinoProjects
a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

basilfx/TRADFRI-Hacking
Hacking IKEA TRÅDFRI products, such as light bulbs, window blinds and other accessories.