Getting started with TinkerPie Bricks: plug-and-play sensors for the TinkerPie board
TinkerPie Bricks are small boards that plug into the TinkerPie V1 with one cable. Smart Bricks add ports, line sensors, distance, servos, displays and a camera. Kit Bricks hold the 37 modules of the popular 37-in-1 sensor kits, so every module works without loose jumper wires.
1. Install the libraries
- Install the Arduino IDE and the esp32 boards package (Boards Manager, version 3.0.7 or newer).
- Download the TinkerPie library and the TinkerPieBricks library. In the Arduino IDE: Sketch → Include Library → Add .ZIP Library, once for each.
- Also install Adafruit NeoPixel, SparkFun BMI270 Arduino Library and VL53L1X (Pololu) from the Library Manager.
- Board: ESP32S3 Dev Module, USB CDC On Boot: Enabled, Flash Size: 16MB, Partition Scheme: 16M Flash (3MB APP/9.9MB FATFS), PSRAM: OPI PSRAM.
2. Connect
- Connect a brick’s BUS IN to any TinkerPie SENSOR 1-4 port with a 4-pin JST-PH cable. All four SENSOR ports are the same I2C bus.
- Chain the next brick from BUS OUT, or use the I2C Hub for a star layout.
- Kit Bricks: plug the kit module into the socket on the top edge so the pin names match.
3. Addresses
Every brick has an address. Two bricks of the same type need different addresses: bridge ADDR +1, +2 or +4 on the back of the second brick and pass the new address to begin().
| Brick | Class and address |
|---|---|
| IO-4 Smart Brick | tpb::IO4 0x30-0x33 |
| Line Follower 5 | tpb::Line5 0x34-0x35 |
| Ultrasonic Brick | tpb::Ultrasonic 0x36-0x37 |
| 5V Sensor Brick | tpb::Sensor5V 0x38-0x39 |
| Display + Keys Brick | tpb::Keys 0x3A, OLED 0x3C |
| Servo-16 Brick | tpb::Servo16 0x40-0x47 |
| I2C Mux 8 | tpb::Mux8 0x70-0x77 |
| AI Camera Module | tpb::AICamera on the AI / CAMERA port |
| Kit Bricks: KIT SENSOR | tpb::KitSensor 0x08-0x0F (first 0x08), socket S + - |
| Kit Bricks: KIT DRIVE | tpb::KitDrive 0x10-0x13 (first 0x10), socket S + - |
| Kit Bricks: KIT ANALOG | tpb::KitAnalog 0x14-0x17 (first 0x14), socket AO G + DO |
| Kit Bricks: KIT DUAL | tpb::KitDual 0x18-0x1B (first 0x18), socket G + S L |
| Kit Bricks: KIT LED | tpb::KitLed 0x1C-0x1F (first 0x1C), socket R G B - (RGB) or - R G (two-colour) |
| Kit Bricks: KIT JOYSTICK | tpb::KitJoystick 0x2C-0x2D (first 0x2C), socket G + X Y SW |
| Kit Bricks: KIT ENCODER | tpb::KitEncoder 0x2E-0x2F (first 0x2E), socket CLK DT SW + G |
4. First sketch: find your bricks
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
void setup() {
Serial.begin(115200);
tinkerpie::begin(); // also starts the SENSOR ports (I2C)
}
void loop() {
tpb::scan(); // lists every brick with its address and name
delay(3000);
}Open the Serial Monitor at 115200 baud: every brick on the bus is listed with its name.
5. Pick a brick
Every brick page has the wiring, a quick-start sketch and a project:
- IO-4 Smart Brick TP-B01
- Line Follower 5 TP-B02
- Ultrasonic Brick TP-B03
- 5V Sensor Brick TP-B04
- Servo-16 Brick TP-B05
- AI Camera Module TP-C01
- Display + Keys Brick TP-D02
- I2C Mux 8 TP-A03
- Qwiic Adapter TP-A01
- I2C Hub TP-A02
- OLED Display Brick TP-D01
- 18650 Battery Holder TP-P01
- Mounting Plate TP-M01
- DS18B20 Temperature Brick TP-K01
- Shock Switch Brick TP-K02
- Hall Magnetic Sensor Brick TP-K03
- Button Switch Brick TP-K04
- IR Receiver Brick TP-K05
- IR Transmitter Brick TP-K06
- Passive Buzzer Brick TP-K07
- Laser Emitter Brick TP-K08
- SMD RGB LED Brick TP-K09
- RGB LED Brick TP-K10
- DHT11 Temp & Humidity Brick TP-K11
- Photo-interrupter Brick TP-K12
- Mercury Tilt Switch Brick TP-K13
- Tilt Switch Brick TP-K14
- Reed Switch Brick TP-K15
- Mini Reed Switch Brick TP-K16
- Mini Two-colour LED Brick TP-K17
- Two-colour LED Brick TP-K18
- Knock Sensor Brick TP-K19
- Digital Temperature Brick TP-K20
- Flame Sensor Brick TP-K21
- Metal Touch Sensor Brick TP-K22
- Analog Temperature Brick TP-K23
- Photoresistor (LDR) Brick TP-K24
- 7-colour Flash LED Brick TP-K25
- High-sensitivity Sound Brick TP-K26
- Magic Light Cup Brick TP-K27
- Joystick Brick TP-K28
- Linear Hall Sensor Brick TP-K29
- Analog Hall Sensor Brick TP-K30
- Obstacle Avoidance Brick TP-K31
- Line Tracking Brick TP-K32
- Rotary Encoder Brick TP-K33
- Active Buzzer Brick TP-K34
- Heartbeat Sensor Brick TP-K35
- Relay Brick TP-K36
- Small Sound Sensor Brick TP-K37
Bricks are programmed in Arduino C++. The block and JavaScript programs in TinkerPie Studio use the board’s own sensors and the 47 accessories on the pins.