Upload files to "IoT_Carrier_Arduino/IoT_Carrier_C3"
This commit is contained in:
parent
0b778c78c0
commit
ccfebeb21b
34
IoT_Carrier_Arduino/IoT_Carrier_C3/IoT_Carrier_C3.ino
Normal file
34
IoT_Carrier_Arduino/IoT_Carrier_C3/IoT_Carrier_C3.ino
Normal file
@ -0,0 +1,34 @@
|
||||
/*THE FOLLOWING IS A PROJECT SKELETON FOR IoT Carrier AND
|
||||
ESP32 C3-DevKitM-1 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
|
||||
*/
|
||||
}
|
||||
15
IoT_Carrier_Arduino/IoT_Carrier_C3/battery_interfacing.h
Normal file
15
IoT_Carrier_Arduino/IoT_Carrier_C3/battery_interfacing.h
Normal file
@ -0,0 +1,15 @@
|
||||
/* Battery interfacing (ADC sense + FET drive) - C3-DevKitM-1
|
||||
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 */
|
||||
#ifndef BATTERY_INTERFACING_H
|
||||
#define BATTERY_INTERFACING_H
|
||||
|
||||
#define BATTERY_ADC_PIN 1 /* ADC input pin,whose function is to gauge battery level via the voltage divider on the PCB */
|
||||
#define FET_DRIVE_PIN 5 /*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
|
||||
11
IoT_Carrier_Arduino/IoT_Carrier_C3/dust_sensor_pinout.h
Normal file
11
IoT_Carrier_Arduino/IoT_Carrier_C3/dust_sensor_pinout.h
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
/* Dust sensor (GP2Y1010AU0F) pinout - C3-DevKitM-1 */
|
||||
|
||||
#ifndef DUST_SENSOR_PINOUT_H
|
||||
#define DUST_SENSOR_PINOUT_H
|
||||
/*PINOUT DEFINITIONS FOR ESP32 C3-DevKitM-1 BOARD ON
|
||||
IoT Carrier Board FOR USING GP2Y1010AU0F DUST SENSOR.
|
||||
DO NOT CHANGE PIN DEFINITIONS*/
|
||||
#define DUST_SENSOR_PIN 2 /* the ESP32 pin to be used as ADC input for the dust sensor data */
|
||||
#define DUST_LED_PIN 6 /* the ESP32 pin to be used as digital output to drive the sensor led */
|
||||
#endif
|
||||
18
IoT_Carrier_Arduino/IoT_Carrier_C3/i2c_pinout.h
Normal file
18
IoT_Carrier_Arduino/IoT_Carrier_C3/i2c_pinout.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* I2C pinout (SCD30 & Qwiic) - C3-DevKitM-1 */
|
||||
|
||||
#ifndef I2C_PINOUT_H
|
||||
#define I2C_PINOUT_H
|
||||
/*
|
||||
I2C COMMUNICATION PINOUT DEFINITIONS FOR ESP32 C3-DevKitM-1
|
||||
BOARD ON IoT Carrier Board WHICH USE GPIO21 AND GPIO20
|
||||
|
||||
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 20 /* GPIO20 - I2C data line */
|
||||
#define I2C_SCL_PIN 21 /* GPIO21 - I2C clock line */
|
||||
|
||||
#endif
|
||||
12
IoT_Carrier_Arduino/IoT_Carrier_C3/noise_sensor_pinout.h
Normal file
12
IoT_Carrier_Arduino/IoT_Carrier_C3/noise_sensor_pinout.h
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
/* Noise Detector (LMV324) pinout - C3-DevKitM-1 */
|
||||
#ifndef NOISE_SENSOR_PINOUT_H
|
||||
#define NOISE_SENSOR_PINOUT_H
|
||||
|
||||
/*PINOUT DEFINITIONS FOR ESP32 C3-DevKitM-1 BOARD ON
|
||||
IoT Carrier Board FOR USING LMV324 NOISE SENSOR.
|
||||
DO NOT CHANGE PIN DEFINITIONS*/
|
||||
|
||||
#define NOISE_SENSOR_PIN 0 /*the ESP32 pin (GPIO0) to be used as ADC input for the noise sensor data*/
|
||||
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user