diff --git a/Sensors/PT100-MAX31865/code/code.ino b/Sensors/PT100-MAX31865/code/code.ino new file mode 100644 index 0000000..aa5d8f1 --- /dev/null +++ b/Sensors/PT100-MAX31865/code/code.ino @@ -0,0 +1,34 @@ +#include +#include +#include + +// Use software SPI: CS, DI, DO, CLK +Adafruit_MAX31865 max31865 = Adafruit_MAX31865(D8, D7, D6, D5); + +// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000 +#define RREF 430.0 +#define RNOMINAL 100.0 + +void setup() { + Serial.begin(115200); + Serial.println("Starting MAX31865 Test"); + + if (!max31865.begin(MAX31865_2WIRE)) { + Serial.println("Could not initialize MAX31865. Check wiring."); + while (1) delay(10); + } else { + Serial.println("MAX31865 initialized successfully."); + } +} + +void loop() { + uint16_t rtd = max31865.readRTD(); + float ratio = rtd; + ratio /= 32768; + Serial.print("RTD value: "); Serial.println(rtd); + Serial.print("Ratio = "); Serial.println(ratio, 8); + Serial.print("Resistance = "); Serial.println(RREF * ratio, 8); + Serial.print("Temperature = "); Serial.println(max31865.temperature(RNOMINAL, RREF)); + + delay(1000); +} diff --git a/Sensors/PT100-MAX31865/readme.md b/Sensors/PT100-MAX31865/readme.md new file mode 100644 index 0000000..5d37cdb --- /dev/null +++ b/Sensors/PT100-MAX31865/readme.md @@ -0,0 +1,42 @@ +# PT100-MAX31865_temperature_sensor + +# ESP8266 with MAX31865 and PT100 Temperature Logging + +This project demonstrates how to use an ESP8266 microcontroller with a MAX31865 amplifier to read temperature data from a PT100 sensor. The data is logged and displayed using the Serial Monitor. + +![Progress Badge](https://badgen.net/badge/progress/DONE/green?icon=github) + +## Hardware Required + +- ESP8266 +- MAX31865 (2/3/4-wire configuration) +- PT100 sensor +- Jumper wires + +## Wiring + +### MAX31865 to PT100 (Two Wires) +- Connect one wire of the PT100 to `RTD+` on the MAX31865. +- Connect the other wire of the PT100 to `RTD-` on the MAX31865. +- Connect a jumper between `RTD-` and `F-`. + +### MAX31865 to ESP8266 +- `VIN` to `3.3V/5V` on the ESP8266 +- `GND` to `GND` on the ESP8266 +- `CLK` to `D5` on the ESP8266 +- `SDO` to `D6` on the ESP8266 +- `SDI` to `D7` on the ESP8266 +- `CS` to `D8` on the ESP8266 + +## Software Setup + +1. Install the Adafruit MAX31865 library: + - Open the Arduino IDE + - Go to Sketch -> Include Library -> Manage Libraries... + - Search for "Adafruit MAX31865" and install it + + +Special thanks to Kunal Patil for their valuable contributions to this project. +(https://github.com/Gamerboisoap1) + + diff --git a/Sensors/readme.md b/Sensors/readme.md new file mode 100644 index 0000000..bcaf3bc --- /dev/null +++ b/Sensors/readme.md @@ -0,0 +1,20 @@ +## Guidelines for Adding a New Sensor + +1. **Create a Subfolder:** + - Name the folder after the sensor (e.g., `PT100`, `DHT22`, `BMP180`). + +2. **Add a README.md:** + - Provide an overview of the sensor. + - Include wiring instructions. + - Describe the code examples and how to use them. + - Link to datasheets or other relevant documentation. + +3. **Include Source Code:** + - Add example code files demonstrating how to interface with the sensor. + +4. **Add Schematics:** + - Include wiring diagrams or schematics if applicable. + +5. **Documentation:** + - Add any additional documentation, datasheets, or useful resources. +