Temp Project 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Component list

1. Temperature Sensors:
 DS18B20 Digital Temperature Sensor:
 Measurement Range: -55°C to +125°C
 Accuracy: ±0.5°C (from -10°C to +85°C)
 Interface: 1-Wire
 DHT22 Digital Temperature and Humidity Sensor:
 Temperature Range: -40°C to +80°C
 Humidity Range: 0% to 100%
 Accuracy: ±0.5°C (Temperature), ±2% (Humidity)
 Interface: One-wire digital interface
2. Microcontroller:
 Arduino Uno R3:
 Microcontroller: ATmega328P
 Operating Voltage: 5V
 Digital I/O Pins: 14 (including 6 PWM outputs)
 Analog Input Pins: 6
 Flash Memory: 32KB (0.5KB used by bootloader)
 SRAM: 2KB
 EEPROM: 1KB
 ESP8266 NodeMCU:
 Microcontroller: ESP8266
 Operating Voltage: 3.3V
 Digital I/O Pins: 11 (including 1 PWM output)
 Analog Input Pins: 1
 Flash Memory: 4MB
 WiFi Connectivity: 802.11 b/g/n
3. Wireless Transceiver Module:
 NRF24L01 Wireless Transceiver Module:
 Operating Frequency: 2.4GHz
 Communication Range: Up to 100 meters
 Data Rate: Up to 2Mbps
 Interface: SPI
 ESP8266 WiFi Module:
 Operating Frequency: 2.4GHz
 WiFi Standards: 802.11 b/g/n
 Communication Range: Depends on WiFi network coverage
4. Power Supply:
 Lithium-ion Rechargeable Battery:
 Voltage: 3.7V
 Capacity: 2000mAh
 Charge Method: Micro USB
 Solar Panel with Battery Charger:
 Solar Panel Output: 5V, 500mA
 Battery Charger: Integrated MPPT charger for 3.7V Li-ion battery
5. Enclosure:
 Weatherproof Plastic Enclosure:
 Material: ABS Plastic
 Dimensions: Customizable based on components
6. Cloud Platform:
 AWS IoT Core:
 Scalable IoT platform with device management, data ingestion, and rules engine.
 Google Cloud IoT Core:
 Managed service for securely connecting and managing IoT devices.
 Microsoft Azure IoT Hub:
 Cloud-to-device and device-to-cloud messaging platform with bi-directional
communication.
7. Development Board (optional):
 NodeMCU Development Board:
 Integrated USB-TTL converter for easy programming
 GPIO Headers for sensor and module connections
 Onboard voltage regulator for stable 3.3V supply

Wiring Details:
Sensor Node (Arduino Uno):
DS18B20:
VCC to Arduino 5V
GND to Arduino GND
Data pin to Arduino digital pin (e.g., D2)
Base Station (Arduino Uno):
NRF24L01:
VCC to Arduino 3.3V
GND to Arduino GND
CE to Arduino digital pin (e.g., D9)
CSN to Arduino digital pin (e.g., D10)
SCK to Arduino digital pin (e.g., D13)
MOSI to Arduino digital pin (e.g., D11)
MISO to Arduino digital pin (e.g., D12)

Arduino program
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>
#include <RF24.h>

// Define pin connections


#define ONE_WIRE_BUS 2 // DS18B20 data pin
#define CE_PIN 9 // NRF24L01 CE pin
#define CSN_PIN 10 // NRF24L01 CSN pin

// Create instances
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
RF24 radio(CE_PIN, CSN_PIN);

// Address of the node (change as needed)


const uint64_t nodeAddress = 0xE8E8F0F0E1LL;

void setup() {
Serial.begin(9600);
// Initialize the DS18B20 sensor
sensors.begin();
// Initialize the NRF24L01 module
radio.begin();
radio.openWritingPipe(nodeAddress);
radio.setPALevel(RF24_PA_LOW); // Set power level to low
radio.stopListening(); // Put radio in transmit mode
}

void loop() {
// Request temperature conversion from all sensors
sensors.requestTemperatures();

// Read temperature from the sensor


float temperatureC = sensors.getTempCByIndex(0);

// Check if temperature reading is valid


if (temperatureC != DEVICE_DISCONNECTED_C) {
// Print temperature to serial monitor
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");

// Transmit temperature data wirelessly


bool success = radio.write(&temperatureC, sizeof(temperatureC));
if (success) {
Serial.println("Temperature data sent successfully.");
} else {
Serial.println("Failed to send temperature data.");
}
} else {
Serial.println("Error reading temperature. Check sensor connections.");
}

// Delay before next reading


delay(5000); // Adjust delay as needed
}

You might also like