1. Introduction
The JY31N AHRS (Attitude and Heading Reference System) module is a high-precision 3-axis digital accelerometer and tilt angle attitude sensor. It integrates the LIS3DH sensor to read measurement data and outputs it conveniently via a serial port. Designed for versatility, the module features an internal voltage stabilization circuit, making it compatible with both 3.3V and 5V embedded systems. Its advanced digital filtering technology effectively reduces measurement noise, significantly improving accuracy. The module utilizes stamp hole gold-plating technology, ensuring quality and allowing for seamless integration into a user's PCB board.

2. Specifications
| Parameter | Value |
|---|---|
| Voltage | 3.3V ~ 5V |
| Current | <10mA |
| Measurement Dimensions | Acceleration: 3 dimensions, Angle: Dual axis |
| Acceleration Range | ±2g |
| Angle Range | ±90° |
| Acceleration Stability | 0.01g |
| Attitude Measurement Stability | 0.05° |
| Error | 0.1° |
| Data Output Content | Time, Acceleration, Angle |
| Data Output Frequency | 10HZ |
| Baud Rate | 115200, 9600 (default) |
| Dimensions (L x W x H) | 15.24mm x 15.24mm x 2mm (approx.) |



3. Pin Description and Wiring
The JY31N module features 12 pins for power, communication, and alarm outputs. Understanding each pin's function is crucial for proper integration and operation.
| Pin Number | Pin Name | Pin Direction | Pin Usage |
|---|---|---|---|
| 1 | D0 | Meaningless | |
| 2 | VCC | Input / Output | Power must be connected to 3.3V-5V |
| 3 | RX | Input / Output | Serial data input, TTL |
| 4 | TX | Input / Output | Serial data output, TTL |
| 5 | GND | Ground wire | |
| 6 | D1 | Meaningless | |
| 7 | D2 | Input / Output | Output X+ alarm status |
| 8 | VCC | Input / Output | Power must be connected to 3.3V-5V |
| 9 | S1 | Input / Output | Output Y+ alarm status |
| 10 | S2 | Input / Output | Output Y- alarm status |
| 11 | GND | Ground wire | |
| 12 | D3 | Input / Output | Output X-state alarm status |

3.1. PC-Side Test Connection
To connect the JY31N module to a computer for verification and configuration, you will need a USB-TTL serial port module. Follow the wiring diagram below and select the corresponding serial port number on your computer to directly configure and measure data.
- VCC on JY31N connects to VCC on USB-TTL module.
- TX on JY31N connects to RX on USB-TTL module.
- RX on JY31N connects to TX on USB-TTL module.
- GND on JY31N connects to GND on USB-TTL module.

4. Setup and Installation
The JY31N module is designed for easy integration into various embedded systems. Its stamp hole gold-plating technology allows it to be directly embedded into a user's PCB board for a compact and robust solution.
4.1. Power Supply
Ensure the module is powered with a stable voltage between 3.3V and 5V. Connecting VCC to the appropriate power source and GND to ground is essential for correct operation.
4.2. Communication Interface
The module communicates via a serial TTL interface. Connect the RX and TX pins to your microcontroller or serial communication device. The default baud rate is 9600, but it can also operate at 115200 baud.
4.3. PCB Integration
For permanent installations, the module can be soldered directly onto a PCB using its stamp hole pads. Ensure proper alignment and secure soldering for reliable performance.
5. Operation
Once powered and connected, the JY31N module will begin outputting data via its serial interface. The data output content includes time, acceleration (3 dimensions), and angle (dual axis).
5.1. Data Output
The module outputs data at a frequency of 10HZ. This data stream can be read by a microcontroller or computer via the serial port. You will need to parse the incoming serial data to extract the time, acceleration, and angle values.
5.2. Alarm Status Outputs
The D2 (X+), S1 (Y+), S2 (Y-), and D3 (X-) pins provide alarm status outputs related to the X and Y axes. Refer to the pin description table for specific usage details. These can be used to trigger events or indicate specific tilt conditions.
6. Maintenance
The JY31N module is a robust electronic component, but proper care ensures its longevity and accurate performance.
- Keep Dry: Avoid exposure to moisture or liquids, which can damage internal components.
- Cleanliness: Keep the module free from dust and debris. Use a soft, dry brush or compressed air for cleaning if necessary.
- Handle with Care: Avoid dropping or subjecting the module to strong physical shocks, as this can affect sensor calibration and integrity.
- Static Discharge: Always handle the module in an ESD-safe environment to prevent damage from electrostatic discharge.
7. Troubleshooting
- No Data Output:
- Verify power connections (VCC and GND) are correct and within the 3.3V-5V range.
- Check serial wiring (TX to RX, RX to TX).
- Ensure the correct baud rate (9600 or 115200) is selected in your serial monitor or code.
- Confirm the serial port on your computer or microcontroller is correctly configured and open.
- Inaccurate Readings:
- Ensure the module is mounted securely and not subject to vibrations or external forces during measurement.
- Check for electromagnetic interference from nearby components.
- Recalibrate the sensor if a calibration routine is available in your software.
- Module Not Powering On:
- Double-check power supply voltage and polarity.
- Inspect for any visible damage to the module or solder joints.
8. User Tips
- Stable Power Supply: A clean and stable power supply is crucial for accurate sensor readings. Consider adding decoupling capacitors if experiencing noisy data.
- Mounting: Mount the module firmly to the surface you intend to measure. Loose mounting can introduce vibrations and affect accuracy.
- Software Libraries: Look for existing Arduino or microcontroller libraries for LIS3DH or similar IMUs to simplify data acquisition and processing.
- Data Visualization: Use serial plotters or custom software to visualize the sensor data in real-time, which can help in debugging and understanding its behavior.
9. Warranty and Support
For any technical assistance, warranty claims, or support inquiries regarding your JY31N module, please contact the seller or manufacturer directly. Keep your purchase records handy when reaching out for support.





