3
0

Upload files to "IoT_Carrier_Arduino/IoT_Carrier_NODE"

This commit is contained in:
aurora 2026-07-29 14:22:09 +02:00
parent 59c8b7383a
commit aa33496cb5
5 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,35 @@
/*THE FOLLOWING IS A PROJECT SKELETON FOR IoT Carrier AND
DOIT ESP32 DEVKIT V1 BOARD. IT CONTAINS THE BARE NECESSITIES FOR
STARTING ANY PROJECT THAT USES THE CARRIER BOARD's FUNCTIONALITIES
PRESENT ARE HEADER FILES THAT LIST THE RESPECTIVE PRECONFIGURED PINOUTS:
dust_sensor_pinout.h -- GP2Y1010AU0F DUST SENSOR
noise_sensor_pinout.h -- LMV324 NOISE SENSOR
battery_interfacing.h -- PINOUT FOR BATTERY MONITORING MECHANISM
i2c_pinout.h -- I2C COMMUNICATION PINOUT
ADDITIONALLY, FOR SCD30 SENSOR WHICH REQUIRES A LIBRARY, IT IS ALREADY CONFIGURED
TO USE JUST REMOVE THE COMMENT FROM : #include <SensirionI2cScd30.h>
TO USE ANY OF THE HEADERS OR LIBRARY, SIMPLY REMOVE THE COMMENTS */
//#include "dust_sensor_pinout.h"
//#include "noise_sensor_pinout.h"
//#include "i2c_pinout.h"
//#include "battery_interfacing.h"
/* SCD30 - libraria Arduino (uncomment if you use SCD30) */
// #include <Wire.h>
// #include <SensirionI2cScd30.h>
void setup() {
/*ENTER ALL THE ONE TIME DEFINITIONS AND INITIALIZATIONS
WITHIN THIS FUNCTION SCOPE,SUCH AS COMMUNICATION AND SENSOR
SETUPS AND PIN ROLE INITIALIZATIONS*/
}
void loop() {
/*ENTER THE MAIN CODE HERE TO RUN REPEATEDLY FOR ALL THE
PLANNED TASKS*/
}

View File

@ -0,0 +1,16 @@
/* Battery interfacing (ADC sense + FET drive) - NodeMCU-32S */
#ifndef BATTERY_INTERFACING_H
#define BATTERY_INTERFACING_H
/*PINOUT DEFINITIONS FOR USING THE BOARD's MECHANISMS
FOR MONITORING BATTERY LEVEL VIA ADC (USING VOLTAGE DIVIDER SUBCIRCUIT)
BY TOGGLING THE FET SWITCHES PRESENT ON THE IoT Carrier
ADDITIONALLY PROVIDED A CONSTANT,BASED ON BOARD's COMPONENT VALUES
THIS CONSTANT IS TO BE USED WHEN CALCULATING BATTERY LEVEL
DO NOT CHANGE PIN AND CONSTANT DEFINITIONS*/
#define BATTERY_ADC_PIN 33 /* ADC input pin,whose function is to gauge battery level via the voltage divider on the PCB */
#define FET_DRIVE_PIN 18 /*FET enable pin, to drive the NMOS switch to close,in order to close the PMOS switch as well,which allows reading the battery voltage */
#define ADC_DIVIDER_GAIN 1.5f//V_ADC = VBAT * (R15 / R14 + R15), therefore VBAT = V_ADC * ((R14 + R15)/ R15). The latter is the formula to be used to get the battery level by using the ADC input. The resistor ratio is 1.5
#endif

View File

@ -0,0 +1,13 @@
/* Dust sensor (GP2Y1010AU0F) pinout - NodeMCU-32S */
#ifndef DUST_SENSOR_PINOUT_H
#define DUST_SENSOR_PINOUT_H
/*PINOUT DEFINITIONS FOR ESP32 NodeMCU-32S BOARD ON
IoT Carrier Board FOR USING GP2Y1010AU0F DUST SENSOR.
DO NOT CHANGE PIN DEFINITIONS*/
#define DUST_SENSOR_PIN 36 /* the ESP32 pin to be used as ADC input for the dust sensor data */
#define DUST_LED_PIN 19 /*the ESP32 pin to be used as digital output to drive the sensor led*/
#endif

View File

@ -0,0 +1,16 @@
/* I2C pinout (SCD30 & Qwiic) - NodeMCU-32S */
#ifndef I2C_PINOUT_H
#define I2C_PINOUT_H
/*I2C COMMUNICATION PINOUT DEFINITIONS FOR ESP32 NodeMCU-32S
BOARD ON IoT Carrier Board WHICH USE GPIO22 AND GPIO 21
I2C IS NECESSARY FOR USING THE SCD30 SENSOR OR ANY OTHER
(3V3) SENSOR INTERFACED VIA QWICC CONNECTORS
DO NOT CHANGE PIN DEFINITIONS*/
#define I2C_SDA_PIN 21 /* GPIO21 - I2C data line */
#define I2C_SCL_PIN 22 /* GPIO22 - I2C clock line */
#endif

View File

@ -0,0 +1,11 @@
/* Sound/Noise Detector (LMV324) pinout - NodeMCU-32S */
#ifndef NOISE_SENSOR_PINOUT_H
#define NOISE_SENSOR_PINOUT_H
/*PINOUT DEFINITIONS FOR ESP32 NodeMCU-32S BOARD ON
IoT Carrier Board FOR USING LMV324 NOISE SENSOR.
DO NOT CHANGE PIN DEFINITIONS*/
#define NOISE_SENSOR_PIN 32 /*the ESP32 pin (GPIO32) to be used as ADC input for the noise sensor data */
#endif