TINKER PiEDESIGN IN INDIA

IO-4 Smart Brick

Smart Bricks · SKU TP-B01

Connect any analog or digital sensor to TinkerPie – 4 ports, each analog, digital or PWM.

₹499

Pre-order

Works with TinkerPie V1 · same JST-PH cables as the board · Delivery across India: ₹100, 3–7 days · 7-day replacement for damaged or defective kits

About this kit

The IO-4 Smart Brick adds four extra ports to TinkerPie. Each port (P1-P4) can be an analog input, a digital input or output, or a PWM output, chosen in your code, so the same brick reads soil-moisture, LDR or PIR sensors and drives LEDs, buzzers and relays. It connects to a TinkerPie SENSOR port with one cable, TinkerPie finds it automatically, and up to four IO-4 bricks can be chained.

Features

Specifications

Size56 x 32 mm
Connectors2 x JST-PH 4-pin (TP-BUS), 4 x JST-PH 3-pin (TP-IO)
Voltage3.3 V
InterfaceI2C 0x30-0x33
BrainCH32V003

How to use it with TinkerPie

  1. Connect the brick’s BUS IN to any TinkerPie SENSOR 1-4 port with a 4-pin JST-PH cable.
  2. More bricks? Plug the next one into BUS OUT (or use the I2C Hub).
  3. Install the TinkerPie and TinkerPieBricks Arduino libraries, open the sketch below, choose the board ESP32S3 Dev Module and upload.

Libraries: TinkerPie and TinkerPieBricks (Arduino IDE: Sketch → Include Library → Add .ZIP Library). Full guide: getting started with TinkerPie Bricks.

Quick start

Upload this, open the Serial Monitor at 115200 baud and watch the TinkerPie matrix.

Quick-start sketch (Arduino C++)
// IO-4 Smart Brick (TP-B01): quick start
// Reads the brick and shows the value on the TinkerPie matrix and in the Serial Monitor (115200 baud).
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
using namespace tinkerpie;

tpb::IO4 io;

void setup() {
  Serial.begin(115200);
  tinkerpie::begin();            // also starts the SENSOR ports (I2C bus Wire1)
  if (!io.begin()) Serial.println("IO-4 Brick not found at 0x30: check the cable to SENSOR 1-4");
  io.mode(1, tpb::ANALOG_IN);      // P1: analog input (0-1023)
}

void loop() {
  uint16_t v = io.analogRead(1);
  Serial.printf("P1 = %u  (%.2f V)\n", v, io.volts(1));
  led::plotBarGraph(v, 1023, Colors::Yellow);
  basic::pause(100);
}

Project: Plant watering helper

Soil-moisture probe on P1, LED module on P2, push button on P3 and a relay module (with a small pump) on P4. The matrix shows how wet the soil is.

Plant watering helper (Arduino C++)
// Plant watering helper: IO-4 Smart Brick (TP-B01)
// Soil-moisture probe on P1, LED module on P2, push button on P3 and a relay module (with a small pump) on P4. The matrix shows how wet the soil is.
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
using namespace tinkerpie;

tpb::IO4 io;

void setup() {
  Serial.begin(115200);
  tinkerpie::begin();            // also starts the SENSOR ports (I2C bus Wire1)
  if (!io.begin()) Serial.println("IO-4 Brick not found at 0x30: check the cable to SENSOR 1-4");
  io.mode(1, tpb::ANALOG_IN);     // soil probe AO
  io.mode(2, tpb::PWM_OUT);       // LED module
  io.mode(3, tpb::INPUT_PULLUP_); // push button module
  io.mode(4, tpb::OUTPUT_);       // relay module
}

void loop() {
  uint16_t soil = io.analogRead(1);            // most probes: 1023 = dry, 300 = wet
  int wet = constrain(map(soil, 1023, 300, 0, 100), 0, 100);
  led::plotBarGraph(wet, 100, Colors::Blue);
  bool button = !io.digitalRead(3);
  io.digitalWrite(4, button || wet < 25);     // pump: dry soil or button held
  io.pwm(2, wet < 25 ? 255 : 20);              // LED bright when the plant is thirsty
  Serial.printf("soil %u  wet %d %%\n", soil, wet);
  basic::pause(200);
}

More TinkerPie Bricks

Line Follower 5 (TP-B02)Line Follower 5TP-B02Five IR sensors in one bar – build a fast line-following robot in minutes.₹499Pre-orderUltrasonic Brick (TP-B03)Ultrasonic BrickTP-B03HC-SR04 distance sensor made safe and simple – distance in mm over one cable.₹499Pre-order5V Sensor Brick (TP-B04)5V Sensor BrickTP-B04For the 5 V parts: gas sensors, 5 V PIR, relays and fans – powered from a servo port.₹499Pre-orderServo-16 Brick (TP-B05)Servo-16 BrickTP-B05Drive 16 servos for robot arms, legs and animatronics.₹499Pre-order

See all 53 TinkerPie Bricks