Connecting ThingsInNet IoT Dev Kit – Sensing to Firebase Realtime Database
Overview
In this guide, you will learn how to connect your ThingsInNet IoT Dev Kit – Sensing (ESP32-based board) to the Firebase Realtime Database to send live sensor readings to the cloud.
This tutorial includes Firebase setup steps, sample code, and explanations so you can easily adapt it to any IoT application, from smart farming to environmental monitoring.
Prerequisites:
Before you begin, make sure you have the following:
- Arduino IDE (latest version installed)
- ESP32 board support configured in Arduino IDE
- ThingsInNet ESP-32 Universal IoT Dev Kit – Sensing
- A Google account to access Firebase
Step 1: Setting up Firebase
- The first step is to create a Firebase real-time database. Head to Firebase homepage and sign in with your google account. https://firebase.google.com
- Go to the Firebase console and create a new project. Add a name for the project and skip generative AI and google analytics as they aren’t necessary.
- Create a real-time database by navigating Build → Realtime Database → Create Database. When prompted select Locked mode to start. We will get back to this later.
- An authenticated user with access to this database has to be added. Go to Build → Authentication → Sign-in method then select Email/Password. In the Users tab add a new user with an email and password and save.
- The IoT device will use this user credentials to login to Firebase
Step 2: Placing Firebase credentials in code
Use the sample code provided here as a base.
Update the placeholders with your own details:
- Wi-Fi SSID and password
- Firebase API key (found under Project Settings → General → Web API key)
- Database URL (from the Realtime Database tab)
- Email and password created in Step 1
This will allow your ThingsInNet Dev Kit to securely connect to Firebase and begin uploading sensor data.
Step 3: Understanding and Expanding the Code
Once your Firebase setup and credentials are ready, the next step is to program your device to collect data from sensors and send it to the Realtime Database. In the given example, we will be sending sensor readings all measured from on-board sensor modules of the ThingsInNet ESP-32 Universal IoT Dev Kit – Sensing.
Firebase Integration: Firebase handles the communication between your IoT device and the cloud. In this example, the ESP32 authenticates with Firebase and uploads sensor readings.
- Authentication and Initialization

This initializes Firebase with your API key and user credentials. The device signs in securely before it can write data to the database. - Connecting to the Realtime Database

The database URL (from your Firebase console) is used to link the app instance with your project’s Realtime Database. - Sending Data to Firebase

These lines upload the latest sensor readings to specific database paths. You can create your own data structure (for example `/SensorData/Temperature`) to organize data neatly.
This mechanism can be reused for any type of sensor data; just replace the variable and path names as needed. Be sure to send data only if “app.ready()” returns true to verify that the connection is up and running. - Sensor Integration
No matter which sensor you use; temperature, pressure, motion, or light, the process remains the same: initialize, read, and send.
Here is an example to demonstrate how this is done:
- Initialize

- Read

- Send

Refer to your sensor library/datasheet for sensor specific instructions.
Once you have collected all the readings, they can be printed to the serial monitor for testing and then uploaded to Firebase just like in the example code.
- Adapting for Your Own Project
To build your own IoT project using this structure:- Replace or add sensor libraries according to your hardware.
- Create new Firebase paths for each type of reading you want to store.
- Adjust the upload interval (“delay(5000)” in the example) to control how often data is sent.
- Test each sensor individually before combining them into one loop.
This modular approach makes your project scalable, allowing you to integrate external sensors, timestamp data, or trigger alerts through Firebase Cloud Functions.
Real-World Applications
- Smart farming and environmental monitoring
- Indoor air quality systems
- Smart homes and lighting control
- Educational IoT experiments
- Energy and power usage tracking
Conclusion
The ThingsInNet IoT Dev Kit – Sensing combined with Firebase Realtime Database provides a fast and reliable way to move sensor data from the physical world to the cloud.
With just a few lines of code, you can monitor live data, visualize trends, and scale your project into a complete IoT ecosystem.


