Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 106 additions & 58 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,107 +1,155 @@

---
title: My Super Awesome Tutorial
date: 1970-01-01
title: Tempature/Gas sensors on ESP32
date: 2025-06-06
authors:
- name: John Doe
- name: Mary Jane
- name: Leithon Magana
group 7 members:
- name: Matteo Persiani
- name: Brigit Quezada
---

![relevant graphic or workshop logo](image/path)
![temps](https://github.com/user-attachments/assets/b44e258c-bfcb-4bb0-8968-baa13a49d127)


## Introduction

Write a short section on what the tutorial is aiming to accomplish.
What is the motivation behind the tutorial?
What do you want readers to gain from the tutorial?
This tutorial is aiming to accomplish a better grasp of the application of both tempature and gas sensors on an esp32. In this tutorial we will learn about tempature and gas sensors, how they work and how to integrate them using an ESP32 microcontroller.

### Learning Objectives

- Bullet list of skills/concepts to be covered
- Understand what the sensors read
- PCB design
- Hand soldering sensors on shield
- Connecting shield to esp32

Any additional notes from the developers can be included here.

### Background Information

Describe your topic here. What does it do? Why do you use it?
Are there other similar things to use? What are the pros and cons?
Explain important concepts that are necessary to understand.
Include (and cite if needed) any visuals that will help the audience understand.
Temperature sensors are devices that measure heat or cold. They convert a physical quantity (temperature) into an electrical signal that can be read by a microcontroller or other electronic device. Carbon Monoxide (CO) sensors are devices designed to detect the presence of carbon monoxide gas in the surrounding atmosphere. CO is a colorless, odorless, and tasteless gas that is highly toxic to humans and animals because it interferes with the blood's ability to carry oxygen. These sensors contain electrodes and an electrolyte. When CO gas comes into contact with the sensor, it causes a chemical reaction that generates a small electrical current. This current is proportional to the concentration of CO in the air. These are two important sensors and with this small amount of current it can be used to send signals into a microcontroller which can be read with one like an esp 32.

## Getting Started
Pros:

- Cost effective
= Integration capabilities
- Low power consumption
- Real time data
- No power consumption when inactive

For any software prerequisites, write a simple excerpt on each
technology the participant will be expecting to download and install.
Aim to demystify the technologies being used and explain any design
decisions that were taken. Walk through the installation processes
in detail. Be aware of any operating system differences.
For hardware prerequisites, list all the necessary components that
the participant will receive. A table showing component names and
quantities should suffice. Link any reference sheets or guides that
the participant may need.
The following are stylistic examples of possible prerequisites,
customize these for each workshop.
Cons:

- Accuracy without calibration
- Data interpretation
- Power management

Key Concepts:

Calibrating the analog sensors
Building a PCB to hold the sensors and give power to
Soldering said pcb onto a microcontroller like the esp32
Setting up the right pins to receive data

## Getting Started

### Required Downloads and Installations
This tutorial uses the ESP32 S3 mini microcontroller platform with the Arduino IDE. The ESP32 provides built-in WiFi capabilities and multiple GPIO pins, making it ideal for hese sensor projects.

List any required downloads and installations here.
Make sure to include tutorials on how to install them.
You can either make your own tutorials or include a link to them.
Required downloads and instillations:
- Arduinbi IDE 2.0: download from arduino.cc
- ESP32 Board Package: add this url, https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, to the board manager

### Required Components
Required Components:
- 1 ESP32-S3 Development board
- 1 Tempature Sensor : https://www.digikey.com/en/products/detail/stmicroelectronics/STTS22HTR/10668399?gQT=2

List your required hardware components and the quantities here.
Required Equiptment:

| Component Name | Quanitity |
| -------------- | --------- |
| | |
| | |
|ESP32 Dev Board | 1 |
| PCB customized | 1 |
| Tempature sensor | 1 |
| Gas sensor | 1 |
| USB-C (or USB-A) to USB-C Cable | 1 |

### Required Tools and Equipment

List any tools and equipment you need here.
(Ex, computer, soldering station, etc.)

## Part 01: Name
## Part 01: Building the PCB

### Introduction

Briefly introduce what you are teaching in this section.
Start by creating your PCB shield that will be able to connect to the esp32. You would want to create a simple pcb that connect the sensors correctly and are both wire to a 3.3V source (per datasheet) and connect to ground.

### Objective

- List the learning objectives of this section
- Connect both sensor footprints to 3.3V and ground
- Make sure pins are correct orientation
- Add components (resistors and capacitors) where needed

![Tempature Sensor](https://github.com/user-attachments/assets/8ab652f8-beeb-49ae-8f48-de97208e5a9a)


### Background Information

Give a brief explanation of the technical skills learned/needed
in this challenge. There is no need to go into detail as a
separation document should be prepared to explain more in depth
about the technical skills
In this tutorial, I learned to create a PCB in KiCad , Digital input/ oputput pin configuration. I understood basic placement of resistsor and capacitor concepts, microcontroller programming fundamentals and digital signal interpretation.

### Components

- List the components needed in this challenge
- ESP32-S3 development board
- KiCad
- USB-C cable for programming and power
- Computer with Arduino IDE installed

### Instructional
### Soldering parts and Connecting pins

Teach the contents of this section
For this tutorial, we start with soldering all the pieces on to the board using soldering paste first. Once all components are placed using the soldering past you want to cook your PCB until fully really. Once that is done you want to make sure that the correct pins are are connecting to the ESP32.

## Example
The reasoning for this check is because certain pins on the esp32 do not take in data like others and if you want to read tempature level the numbers meed to be calibrated and interpreted into degrees.

### Introduction
![SOldered PCB](https://github.com/user-attachments/assets/83d99b1b-919c-4193-80ad-e40a7a286862)

As per the photo making sure that no parts of the soldered components are touching and making sure that the rail on the pcb goes from the 3.3 V to all the other components.


### Testing Sensors

Once you are able to get the shield attached onto the esp32 you must decide which pin you would be testing and see if there are any readings.

Introduce the example that you are showing here.
Luckiliy for you I have test code to try and test for the Tempature sensor which would be done on arduino.

### Example
#include < Wire.h >
#include "STTS22HSensor.h"
TwoWire I2CBus = TwoWire(0);
STTS22HSensor Temp(&I2CBus);

Present the example here. Include visuals to help better understanding
void setup() {
Serial.begin(115200);
delay(100);
Serial.println("STTS22H Temperature Test");
// GPIO37=SDA, GPIO38=SCL
I2CBus.begin(37, 38, 400000);
if (Temp.begin() != 0) {
Serial.println("ERROR: STTS22H not found.");
while (1) delay(1000);
}
Temp.Enable();
Serial.println("STTS22H initialized!");
}

### Analysis
void loop() {
float temperature;
if (Temp.GetTemperature(&temperature) == 0) {
Serial.printf("Temperature: %.2f °C\n", temperature);
} else {
Serial.println("Read error");
}
delay(1000);
}

Explain how the example used your tutorial topic. Give in-depth analysis of each part and show your understanding of the tutorial topic
## Analysis
There is a lot that can go wrong when getting ready to use a tempature sensor in so many different places. When creating the PCB shield Truly make sure that all pins are set up corrently in the right orientationa dnthat there is a 3.3 V connection to the sensors. When figuring out which components to use resort to certain datasheets that the sensors should provide. The Process of getting solders on correctly is a tedious one which I think with practice should be really fun and exciting. Once you connect the correct pins to the board and have the shield receive voltage You must use the test code to see what readings you are getting. WIth this tutorial we use STTS22H sensor which will vary reults on different sensors. Following these steps you should get the sensors working just fine. Good luck !!

## Additional Resources
## Additional Resources and Useful links

### Useful links
(https://youtube.com/shorts/sJJh-J6e2As?si=Xqb7Y2Yls_3wEPgB)

List any sources you used, documentation, helpful examples, similar projects etc.
## Similar Tutorial
https://www.instructables.com/Temperature-Sensor-Tutorial/