Skip to content

PIR Motion Sensor Radar using OLED SSD1306 with Arduino Nano 33 IoT

PIR Motion Sensor Radar with OLED SSD1306 using Arduino Nano 33 IoT

Introduction

A PIR Motion Sensor Radar brings together compact hardware and clever signal interpretation to visualize movement in a simple radar-style layout.Building an embedded motion alert system is a fantastic way to dive into Arduino Nano 33 IoT projects and understand infrared-based motion sensing. This guide walks you through creating a simple DIY smart security system using a passive infrared (PIR) sensor to detect movement.

The core of this project is transforming simple motion data into a captivating radar-style animation displayed on an OLED SSD1306 graphical display. This combination of low-power motion tracking and effective visualization makes for a practical and engaging experiment in microcontroller-based security projects.


Overview PIR Motion Sensor Radar

The PIR Motion Sensor Radar offers a practical way to display human movement on a compact OLED display using straightforward microcontroller logic. When infrared energy changes within the sensing zone, the Arduino interprets the data and maps it visually on the screen.

The OLED SSD1306’s high contrast makes the radar sweep clean and easy to analyze. This setup is ideal for beginners experimenting with motion-based visualization while still providing enough depth for advanced prototyping. It blends simplicity with capability, allowing hobbyists to explore radar-like feedback without complex RF circuits or expensive modules.


Components Required 

 

QuantityComponentDescriptionBuy Link
1Arduino Nano 33 IoTMicrocontroller with built-in WiFi & I2C supportBuy Link
1AM312 PIR Motion SensorDetects motion using infrared radiationBuy Link
1SSD1306 128×64 OLED Display (I2C)Displays radar animation and alertsBuy Link
1BreadboardFor easy wiring and prototypingBuy Link
1Micro-USB CableTo power and program the ArduinoBuy Link
FewJumper WiresFor connectionsBuy Link

Arduino Nano 33 IoT 

The Arduino Nano 33 IoT is a compact yet powerful board with ARM Cortex-M0+, WiFi, Bluetooth, and built-in IMU support, making it ideal for modern connected projects. Its low power consumption and excellent I2C compatibility make it well-suited for sensor-driven prototypes. Learn more

Arduino Nano 33 IoT Pinout
Arduino Nano 33 IoT Pinout

AM312 PIR Motion Sensor 

The AM312 PIR Motion Sensor is an ultra-small, highly efficient infrared detector that identifies human movement by sensing changes in IR radiation. It offers a stable output, low power usage, and a plug-and-play interface for microcontrollers. Ideal for compact automation and security systems. Learn more

AM312 PIR Motion Sensor pinout
AM312 PIR Motion Sensor pinout

SSD1306 128×64 (I2C) 

The SSD1306 128×64 OLED Display provides crisp monochrome graphics with minimal power draw, making it perfect for embedded visual feedback. Using I2C communication, it integrates smoothly with most microcontrollers and supports dynamic animations like radar sweeps.  Learn more

oled display pinout
SSD1306 128×64 (I2C)

Circuit Diagram

[Insert circuit diagram image here]


Build Guide Step-by-Step

Step 1. Prepare the Arduino Nano 33 IoT

Place the Arduino Nano 33 IoT onto the breadboard and ensure it is firmly seated so all pins are accessible for wiring.

Step 2. Power the PIR Sensor

Connect the PIR sensor’s VCC pin to the Arduino’s 3.3V pin.
Now connect the PIR sensor’s GND pin to the Arduino’s GND pin.

Step 3. Connect the PIR Output

Attach the PIR sensor’s OUT pin to the Arduino D2 pin so the board can read motion signals.

Step 4. Wire the OLED Display Power

Connect the OLED VCC pin to the Arduino 3.3V pin.
Then connect the OLED GND pin to the Arduino GND pin.

Step 5. Connect OLED I2C Lines

Wire the OLED’s SDA pin to the Arduino’s A4 pin.
Wire the OLED’s SCL pin to the Arduino’s A5 pin to complete I2C communication.

Step 6. Verify Common Ground

Ensure all modules—PIR sensor, OLED display, and Arduino—share the same ground for stable operation.

Step 7. Secure All Connections

Tighten jumper wires, avoid loose pins, and make sure the PIR is positioned with a clear field of view.

Step 8. Upload the Arduino Code

Connect the Arduino Nano 33 IoT to your PC via USB.
Select the board and port in the IDE, then upload your radar visualization sketch.

Step 9. Test the Radar Movement

After the upload completes, power the board and wave your hand in front of the PIR sensor to confirm the radar animation responds to motion.

 

Arduino Nano 33 IoT PinPIR Sensor PinOLED PinDescription
D2OUTPIR output signal to Arduino
3.3VVCCVCCPower supply (both PIR & OLED use 3.3V)
GNDGNDGNDCommon ground
SDA (A4)I2C data line for OLED
SCL (A5)I2C clock line for OLED

 

Arduino Code.

  1. #include <Adafruit_GFX.h>
  2. #include <Adafruit_SSD1306.h>
  3. #include <math.h>
  4. #define SCREEN_WIDTH 128
  5. #define SCREEN_HEIGHT 64
  6. Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
  7. const int pirPin = 2;
  8. float angle = 0; // radar sweep angle
  9. const int radarRadius = 30;
  10. const int centerX = SCREEN_WIDTH/2;
  11. const int centerY = SCREEN_HEIGHT/2;
  12. void setup() {
  13. Serial.begin(9600);
  14. pinMode(pirPin, INPUT);
  15. if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)){
  16. Serial.println("SSD1306 allocation failed");
  17. for(;;);
  18. }
  19. display.clearDisplay();
  20. display.display();
  21. }
  22. void loop() {
  23. bool motionDetected = digitalRead(pirPin);
  24. display.clearDisplay();
  25. if(!motionDetected){
  26. // --- Radar animation ---
  27. // Draw radar circle
  28. display.drawCircle(centerX, centerY, radarRadius, SSD1306_WHITE);
  29. display.drawCircle(centerX, centerY, radarRadius-5, SSD1306_WHITE);
  30. // Draw sweeping line
  31. int x = centerX + radarRadius * cos(angle);
  32. int y = centerY + radarRadius * sin(angle);
  33. display.drawLine(centerX, centerY, x, y, SSD1306_WHITE);
  34. // Increment sweep angle
  35. angle += 0.1; // speed of sweep
  36. if(angle > 2*3.14159) angle = 0;
  37. // Draw radar center
  38. display.fillCircle(centerX, centerY, 2, SSD1306_WHITE);
  39. } else {
  40. // --- Motion detected ---
  41. display.setTextSize(2);
  42. display.setTextColor(SSD1306_WHITE);
  43. display.setCursor(5, SCREEN_HEIGHT/2 - 10);
  44. display.println("Motion!");
  45. }
  46. display.display();
  47. delay(30); // controls smoothness
  48. }

Applications

  • Compact IoT security systems

  • Smart home automation

  • Human presence monitoring

  • Educational microcontroller demonstrations

  • Portable motion visualization devices


FAQs

What is the difference between PIR motion sensor and radar?

A PIR sensor detects changes in infrared heat from humans or animals, while radar detects motion using radio waves and can sense movement through some materials.

What is a PIR motion sensor?

A PIR motion sensor identifies movement by detecting variations in infrared radiation within its field of view.

What is a PIR used for?

It’s commonly used in security systems, automatic lighting, alarms, and presence detection applications.

What is a radar motion sensor?

A radar motion sensor uses high-frequency radio waves to measure motion, speed, and distance of moving objects.

How far can a PIR sensor detect?

Most PIR sensors detect motion between 3 to 10 meters, depending on the lens design and environment.

What are the three types of radar?

The main types are Continuous Wave (CW), Pulse Ra


Conclusion

Combining the PIR sensor with an OLED display transforms simple motion detection into a visually appealing radar-style experience. The Arduino Nano 33 IoT processes incoming signals quickly, enabling real-time feedback and smooth animations. This project is both educational and practical, offering insights into PIR, Radar, Arduino, SSD1306, Nano 33, IoT, OLED, Motion, Sensor, and Display interactions. Whether you’re exploring embedded graphics or building an automation prototype, this setup provides a reliable and expandable foundation.


Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *