Arduino Proximity Sensor -activated Oled Display

About the project

A compact and efficient smart display system that uses an IR obstacle sensor to detect motion or presence.

Project info

Difficulty: Easy

Platforms: ArduinoSparkFunVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Breadboard (generic) Breadboard (generic) x 1
Jumper wires (generic) Jumper wires (generic) x 1
Arduino UNO Arduino UNO x 1
SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic) SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic) x 1
ElectroPeak 0.96" OLED 64x128 Display Module ElectroPeak 0.96" OLED 64x128 Display Module x 1

Software apps and online services

Arduino IDE Arduino IDE
visuino visuino

Story

Project Description:

A compact and efficient smart display system that uses an IR obstacle sensor to detect motion or presence. When a hand or object is extended towards the sensor, an OLED display automatically turns on, showing useful information such as status updates, sensor readings, or notifications. After 3 seconds of inactivity, the display turns off to conserve power.

Potential Applications:

Smart Home Automation – Display room temperature, security alerts, or appliance statuses only when someone is nearby.

Industrial Use – Hands-free status monitoring in factories, reducing distractions and energy consumption.

Smart Gadgets – Interactive control panels for IoT devices that activate only when needed.

Energy-Saving Display Systems – Reduces power consumption in battery-operated or low-power devices.

Watch the video!

Step 1: What You Will Need

  • Arduino UNO (Or any other Arduino)
  • Breadboard
  • OLED Display I2C
  • Obstacle avoidance sensor
  • Jumper wires
  • Visuino program: Download Visuino

Step 2: The Circuit

  • Connect Obstacle avoidance sensor pin[VCC] to Arduino pin[5V]
  • Connect Obstacle avoidance sensor pin[GND] to Arduino pin[GND]
  • Connect Obstacle avoidance sensor pin[D0] to Arduino digital pin[2]
  • Connect OLED Display pin [SCL] to Arduino pin [SCL]
  • Connect OLED Display pin [SDA] to Arduino pin [SDA]
  • Connect OLED Display pin [VCC] to Arduino pin [5v]
  • Connect OLED Display pin [GND] to Arduino pin [GND]

Step 3: Start Visuino, and Select the Arduino Board Type

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

Step 4: In Visuino Add & Set Components

  • Add "Debounce Button" component
  • Add "Digital Multi Source" component
  • Add "Delay" component
  • Add "Toggle(T) Flip-Flop" component
  • Add "OLED I2C" component
  • Select "Button1" and in the properties window set "Debounce Interval (mS)" to 10
  • Select "Delay1" and in the properties window set "Interval" to 3000000, you can adjust this by setting any other value
  • Select "DisplayOLED1" and in the properties window select "Power On" and click on the pin icon and select "Boolean SinkPin"
  • Double click on "DisplayOLED1" and in the Elements window drag "Draw Text" to the left side and in the properties window set "Size" to 3 and "Text" to ARDUINO or any other text

Step 5: In Visuino Connect Components

  • Connect Arduino digital pin[2] to "Button1" pin [In]
  • Connect "Button1" pin [Out] to "MultiSource1" pin [In]
  • Connect "MultiSource1" pin [0] to "TFlipFlop1" pin [Set]
  • Connect "MultiSource1" pin [1] to "Delay1" pin [Start]
  • Connect "Delay1" pin [Out] to "TFlipFlop1" pin [Reset]
  • Connect "TFlipFlop1" pin [Out] to "DisplayOLED1" pin [Power On]
  • Connect "DisplayOLED1" pin [I2C] to Arduino pin [I2C]

Step 6: Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 7: Play

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...