Building a Modbus RTU Temperature & Humidity Sensor with Arduino Pro Micro and RS485 Transceiver Module
In this project, we'll guide you through creating an Modbus RTU temperature and humidity sensor using an Arduino Pro Micro, an RS485 transceiver, and an AM2301A sensor. This setup can be used in industrial environments, where Modbus RTU is a commonly used protocol for data acquisition and control, and where 24V power supplies are standard. We'll also use an L7805 voltage regulator to convert 24V to 5V for the Arduino and the sensor.
Components You'll Need:
- Arduino Pro Micro (Atmega32U4)
- RS485 Transceiver Board
- AM2301A Temperature & Humidity Sensor
- L7805 Voltage Regulator (for 24V to 5V conversion)
- 24V DC Power Supply
- Resistors, Capacitors, Wires, Breadboard
Step 1: Understanding the Components
1. Arduino Pro Micro
The Arduino Pro Micro is a small board powered by an Atmega32U4 microcontroller. It's great for compact applications where space is limited. It has built-in USB, making it easy to program.
2. RS485 Transceiver (MAX485)
RS485 is widely used in industrial systems for communication due to its noise resistance and long-distance capability. The MAX485 transceiver allows your Arduino to communicate over the RS485 bus using the Modbus RTU protocol.
3. AM2301A Sensor
The AM2301A sensor is a digital temperature and humidity sensor that communicates via a single-wire protocol. It’s accurate and well-suited for environmental monitoring applications.
4. L7805 Voltage Regulator
The L7805 is a linear voltage regulator that steps down 24V to 5V, which is suitable for powering both the Arduino and the sensor. It’s crucial to regulate the voltage when dealing with industrial power supplies to avoid damaging the components.
Step 2: Wiring the Components
Before coding, let’s set up the hardware. Below is the pin-out and connection guide:
Wiring the Arduino Pro Micro to the MAX485 RS485 Transceiver:
- DI (MAX485) → TX (Pin 1 on Arduino Pro Micro)
- RO (MAX485) → RX (Pin 0 on Arduino Pro Micro)
- DE & RE (MAX485) → Pin 4 (Arduino Pro Micro)
- VCC (MAX485) → 5V
- GND (MAX485) → GND
Connecting the AM2301A Sensor to Arduino:
- VCC (AM2301A) → 5V
- GND (AM2301A) → GND
- Data (AM2301A) → Pin 2 (Arduino Pro Micro)
Power Supply via L7805 Voltage Regulator:
- Input (L7805) → 24V DC Power Supply
- Output (L7805) → 5V to Arduino VCC and AM2301A VCC
- GND (L7805) → Common GND
Comments
Post a Comment