Skip to content

Shield Overview

Mick Percy edited this page Feb 5, 2025 · 22 revisions

Overview

The DIYFB project is based on an ESP32 microcontroller and a custom interface PCB commonly referred to as a 'shield'. The shield is a PCB that the microcontroller plugs into and includes all of the electronic circuitry that makes the project work.

PCB 3D view

The official DIYFB Shield is designed to work with the WEMOS D1 R32 microprocessor and is tailored to its unique pin layout. Other ESP32 based microprocessors also share a similar UNO style footprint. It may be possible to get them to work with the DIYFB shield by editing the pins.json file to suit their pin layout, however some pins have dedicated functions and may not be able to be reassigned to work with the shield.

For this reason the Wemos D1 shield is the recommended MCU. If you are considering using an alternate shield, we recommend comparing the Wemos D1 pin layout against your MCU to ensure that it is compatible.

Build your own Shield

The official shield is intended to be a DIY build-it-yourself design. It uses off-the-shelf 'break-out-boards' (BOBs) for most of the sub circuits and discrete components for the rest. The sub boards were chosen as they are easy to source and they make the shield simple to assemble, even for the novice. The remainder of the components are mostly through-hole mount resistors and capacitors.

Of course, using the same principle of utilising off-the-shelf BOBs, it is also not too hard to build your own shield or even scratch build a breadboard solution by following the existing schematics.

You could even use a different ESP32 if you wanted. You can use the DIYFB PCB schematics and the pin designations below as a starting point and then tailor component and pin locations to suit the microprocessor that you wish to use. You can then use a PCB manufacturing service such as JLPCB to make the PCB for you.

Official DIYFB Shield

IMG_20210903_143919

Shields are currently undergoing beta testing and will be available soon.

Shields will be available fully assembled or in kit form which includes the PCB along with the relevant components.

The shield houses the necessary sensors and signal conditioning circuitry to allow the sensors to be read by the processor.

The following sensors are supported by I2C and provision is included on the shield:

  • BME280 Barometric pressure sensor
  • BME280 Temperature sensor
  • BME280 Relative humidity sensor
  • ADC1115 > MAF Sensor (for both voltage and frequency based sensors)
  • ADC1115 > Reference pressure sensor
  • ADC1115 > Pitot differential pressure sensor
  • ADC1115 > Orifice differential pressure sensor

In addition to this the following circuits are provided

  • PWM output for fan speed reference

  • PWM output for bleed valve control

  • DRV4988 Stepper motor driver for bleed valve control

  • DRV4988 Stepper motor driver for Auto Valve Adjuster

  • Relay drivers for fan motor control (3 stage)

  • Orifice decoder for pressure drop benches (3 bit / support for 8 orifices)

  • SPI Serial programming interface (Serial0)

  • Serial input for API control (Serial0)

  • Serial input for external gauge (Serial1)

It is also possible to use discrete analog inputs instead of the I2C BME / ADS devices. This allows for support of a variety of third party sensors. Using discrete inputs will require that you remap some of the existing GPIO. You may therefore need to forfeit some functionality to free up pins.

It is however worth considering that the ESP32 only has a 12 bit analog to digital converter and so accuracy and resolution will be reduced if using discrete inputs instead of the recommended ADS1115 ADC (16 bit).

Pin Mapping

All Sensor configurations are provided for within the standard configuration. Custom pin mappings can easily be created by reassigning pins on the pin configuration page in the GUI...

Screenshot 2025-01-16 at 3 40 36 pm

The following listing shows the pin mapping for the official DIYFB shield.

 "BOARD_TYPE" : "WEMOS_D1_R32"
 "VAC_SPEED_PIN" : 25 
 "VAC_BLEED_VALVE_PIN" : 26
 "VAC_BANK_1_PIN" : 13
 "VAC_BANK_2_PIN" :12
 "VAC_BANK_3_PIN" :14
 "AVO_STEP_PIN" :  32
 "AVO_DIR_PIN" : 33
 "FLOW_VALVE_STEP_PIN" : 27
 "FLOW_VALVE_DIR_PIN" : 4
 "VCC_3V3_PIN" : -1
 "VCC_5V_PIN" : 2
 "SPEED_SENSOR_PIN" : 15
 "SWIRL_ENCODER_PIN_A" : -1
 "SWIRL_ENCODER_PIN_B" : -1
 "ORIFICE_BCD_BIT1_PIN" : 34
 "ORIFICE_BCD_BIT2_PIN" : 36
 "ORIFICE_BCD_BIT3_PIN" : 39
 "MAF_PIN" : 99
 "REF_PRESSURE_PIN" : -1
 "DIFF_PRESSURE_PIN" : -1
 "PITOT_PIN" : -1
 "TEMPERATURE_PIN" : -1
 "REF_BARO_PIN" : -1
 "HUMIDITY_PIN" : -1
 "SERIAL2_TX_PIN" :16
 "SERIAL2_RX_PIN" :17
 "SDA_PIN" : 21
 "SCL_PIN" : 22
 "SD_CS_PIN" : 5
 "SD_MOSI_PIN" : 23
 "SD_MISO_PIN" : 19             
 "SD_SCK_PIN" : 18
 "WEMOS_SPARE_PIN_1": -1
 

Note values set to '-1' indicate that the pin is disabled.

A more in depth explanation of the purpose of each pin can be found on the Pins Page

Terminal Schedule

The following terminal designations apply to the the Official shield when used with WEMOS D1 R32 board

X1.1   - 12V
X1.2   - GND
X1.3   - 5V
X1.4   - 0V-BUS
X1.5   - NC
X1.6   - NC
X1.7   - SPEED_SENSOR_PIN
X1.8   - MAF_PIN
X1.9   - SERIAL0_RX
X1.10  - SERIAL0_TX
X1.11  - SERIAL2_RX
X1.12  - SERIAL2_TX
X1.13  - SPARE_PIN
X1.14  - ORIFICE_BCD_BIT1
X1.15  - ORIFICE_BCD_BIT2
X1.16  - ORIFICE_BCD_BIT3
X2.1   - 5V
X2.2   - 0V-BUS
X2.3   - GND
X2.4   - BLEED_VALVE_REF
X2.5   - FLOW_CONTROL_STEP_A1
X2.6   - FLOW_CONTROL_STEP_A2
X2.7   - FLOW_CONTROL_STEP_B1
X2.8   - FLOW_CONTROL_STEP_B2
X2.9   - VAC_BANK_1
X2.10  - VAC_BANK_2
X2.11  - VAC_BANK_3
X2.12  - VFD_SPEED_REF 
X2.13  - VALVE_OPENER_STEP_A1
X2.14  - VALVE_OPENER_STEP_A2
X2.15  - VALVE_OPENER_STEP_B1
X2.16  - VALVE_OPENER_STEP_B2

IMG_20210903_143926