TINKER PiEDESIGN IN INDIA

5V Sensor Brick

Smart Bricks · SKU TP-B04

For the 5 V parts: gas sensors, 5 V PIR, relays and fans – powered from a servo port.

₹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 5V Sensor Brick connects the 5 V modules that cannot plug straight into a 3.3 V board: MQ-2 and MQ-135 gas sensors, LM35, HC-SR501 PIR and A3144 Hall sensors, relays, buzzers and fans. It has three 0-5 V inputs read in millivolts and two real 5 V outputs (with PWM for fan speed), takes its 5 V from a TinkerPie SERVO port through a 1.1 A fuse, and keeps the outputs off at power-up.

Features

Specifications

Size64 x 40 mm
Connectors5V IN + 5 x JST-PH 3-pin + 2 x TP-BUS
Inputs0-5 V, 47k/100k divider
InterfaceI2C 0x38-0x39
BrainCH32V003 + 74AHCT1G125

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. Connect 5V IN to a TinkerPie SERVO port: the 5 V parts get their power from there.
  3. More bricks? Plug the next one into BUS OUT (or use the I2C Hub).
  4. 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++)
// 5V Sensor Brick (TP-B04): 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::Sensor5V b5;

void setup() {
  Serial.begin(115200);
  tinkerpie::begin();            // also starts the SENSOR ports (I2C bus Wire1)
  if (!b5.begin()) Serial.println("5V Sensor Brick not found at 0x38: check the cable to SENSOR 1-4");
}

void loop() {
  Serial.printf("5V rail %u mV   S1 %u mV   S2 %u mV   S3 %u mV\n", b5.supply(), b5.millivolts(1), b5.millivolts(2), b5.millivolts(3));
  led::plotBarGraph(b5.millivolts(1), 5000, Colors::Orange);
  basic::pause(500);
}

Project: Gas leak alarm

An MQ-2 gas sensor on S1 and a 5 V relay or buzzer module on O1. Power the brick from a TinkerPie SERVO port.

Gas leak alarm (Arduino C++)
// Gas leak alarm: 5V Sensor Brick (TP-B04)
// An MQ-2 gas sensor on S1 and a 5 V relay or buzzer module on O1. Power the brick from a TinkerPie SERVO port.
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
using namespace tinkerpie;

tpb::Sensor5V b5;
const uint16_t ALARM_MV = 1800;    // adjust after the MQ-2 has warmed up for a few minutes

void setup() {
  Serial.begin(115200);
  tinkerpie::begin();            // also starts the SENSOR ports (I2C bus Wire1)
  if (!b5.begin()) Serial.println("5V Sensor Brick not found at 0x38: check the cable to SENSOR 1-4");
}

void loop() {
  if (b5.supply() < 4000) { Serial.println("No 5 V: connect 5V IN to a SERVO port"); basic::pause(1000); return; }
  uint16_t mv = b5.millivolts(1);
  bool alarm = mv > ALARM_MV;
  b5.output(1, alarm);
  led::plotBarGraph(mv, 5000, alarm ? Colors::Red : Colors::Green);
  if (alarm) music::playTone(2000, 150);
  Serial.printf("MQ-2 %u mV\n", mv);
  basic::pause(300);
}

More TinkerPie Bricks

IO-4 Smart Brick (TP-B01)IO-4 Smart BrickTP-B01Connect any analog or digital sensor to TinkerPie – 4 ports, each analog, digital or PWM.₹499Pre-orderLine 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-orderServo-16 Brick (TP-B05)Servo-16 BrickTP-B05Drive 16 servos for robot arms, legs and animatronics.₹499Pre-order

See all 53 TinkerPie Bricks