Hardware Connection
Wiring
Use a USB-to-TTL converter to connect the radar module to the computer as follows:
Rd-03_V2 Pin No. (Name) | USB-to-TTL Pin | Description |
1 (3V3) | 3V3 | Power Supply |
2 (GND) | GND | Ground |
3 (TXD) | RXD | Data Transmission |
4 (RXD) | TXD | Data Reception |
5 (OT2) | None | Detection Output (High/Low Level) |
Code
Create a new HTML file and insert the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Radar Module Distance Monitoring Web Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
:root {
--bg: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
--glass: rgba(255, 255, 255, 0.1);
--accent: #4ade80;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: var(--bg);
color: #fff;
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: auto;
background: var(--glass);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 30px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
border: 1px solid rgba(255, 255, 255, 0.18);
}
h1 {
text-align: center;
margin-bottom: 20px;
font-size: 2.2em;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.controls {
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
...
Read more »
Ai-Thinker