The Microcontroller Brick is based on the ESP32 dev board (DevKitC V4).
ESP32 is chosen because it packs a lot of computing power (compared to Arduino Uno or its predecessor ESP8266). It also has integrated WIFI, Bluetooth and even capacitive touch sensors, which means it can be used in interesting ways without additional components.
The controller is powered by either the micro-USB port, or the Battery Brick. When it is powered by the latter, the incoming voltage is reduced to 3.3V for the ESP32 via a HT7833 LDO (Low Dropout Regulator)..
3 different types of connectors are used for interconnects:
- JST XH connector. These are used for connecting to low-power sensors/actuators. They come in 2-pin, 3-pin, and 4-pin variety. For the 2-pin connector, one wire connects to an I/O pin, while the other wire connect sto GND. For the 3 and 4 wire connectors, one wire connects to 3.3V, one wire connects to GND, leaving the remaining wires connected to I/O pins.
- JST SM connector. This is used by the Battery Brick to supply power to either the Microcontroller Brick or the Motor Power Brick.
- JST RCY connector. This is used by the Motor Power Brick to supply power to the Motor Brick or the Servo Brick.
Ports
Ports are female JST XH connectors on the PCB that are wired to various pins on the ESP32.
These are the available ports and the pins they are connected to:
2-Pin Ports
- Port 2A - Pin 26, GND
- Port 2B - Pin 27, GND
- Port 2C - Pin 32, GND
3-Pin Ports
- Port 3A - Pin 33, VCC, GND
- Port 3B - Pin 34, VCC, GND
- Port 3C - Pin 36, VCC, GND
- Port 3D - Pin 39, VCC, GND
Note: 3-pin ports are input only ports for connecting with photosensor, pushbutton etc
4-Pin Ports
- Port 4A - Pin 13, 14, VCC, GND
- Port 4B - Pin 16, 17, VCC, GND
- Port 4C - Pin 18, 19, VCC, GND
- Port 4D - Pin 23, 25, VCC, GND
- Port 4E - Pin 21, 22, VCC, GND
Note: Port 4E uses the i2c pins (21, 22) on the ESP32, and is reserved for connecting with the OLED Display Brick.
Parts list
Type | Quantity |
---|---|
ESP32 dev board (DevKitC V4) | 1 |
HT7833 LDO | 1 |
1uF ceramic capacitor | 1 |
2.2uF ceramic capacitor | 1 |
4.7kΩ resistor | 2 |
1000uF electrolytic capacitor | 1 |
2-pin JST XH connector (female) | 3 |
3-pin JST XH connector (female) | 4 |
4-pin JST XH connector (female) | 5 |
2-pin JST SM connector (female) | 1 |
Single row female pin header (PH8.5) | 4 x 19-pin strip |
Long leg stackable female pin header | 2 x 19-pin strip |
DIP male pin header | 2 x 19-pin strip |
M2 self-tapping screw | 8 |
Circuit
The Microcontroller Brick is made of 2 small PCBs to reduce horizontal footprint.One PCB holds the ESP32 dev board, while the other PCB houses all the ports. The 2 PCBs are interconnected vertically with standard 2.54mm headers.
The circuit itself is not very complicated.There are basically a lot of wiring from the pins of the ESP32 dev board to the various ports, making it impractical to implement this using a prototype board. The other components are the voltage regulator module (HT7833 + capacitors), pullup resistors for the I2C pins, and a 1000uF filtering capacitor for the input power.
First prepare the lower PCB by soldering the HT7833 LDO, capacitors, resistors and JST RCY connector. Optionally strenghten the wire joint with a bit of hot glue.
Solder two strips of single row female pin header (PH8.5) to the inner columns. These strips typically comes in 40 or 50-pin form, and need to be cut to the 19-pin required.
Next prepare two strips of long leg stackable female pin header plugged into two strips of single row female pin header (PH8.5) , and solder them to the outer columns. Since the widest long leg stackable female pin header I could find was 15-pin, I had to cut an extra two 4-pin strips to make the 19-pin required on each side.
Insert the ESP32 dev board into the inner female headers.
Solder 2 strips of DIP male pin header at the sides of the upper PCB.
Solder the JST ports onto the upper PCB.
Insert the upper PCB into the lower PCB.
Enclosure
Print the enclosure on a 3D printer.
Mount the PCB assembly that we have prepared into the lower part of the enclosure.
Insert the upper part of the enclosure, and secure with 4 x M2 screws.
Line up four 3x1 brickbases on a faceplate. Surround the brickbases with a few other bricks to assist in alignment.
Add two drops of super glue on each brickbase and mount the module. Press and hold for 60s.
The finished module: