Introduction
In this project we are going to scale the size of an image using the distance value acquired from an HC-SR04 ultrasonic sensor. The lower the distance, smaller the image size; farther the distance, bigger the image size.
Construction

As you can see in the circuit connect the trigger pin of HC-SR04 sensor to digital pin 12, echo pin to digital pin 11 and VCC of sensor to 5v of arduino and GND to GND of arduino.
- Digital 12 to Trigger
- Digital 11 to Echo
- 5V to VCC
- GND to GND
https://playground.arduino.cc/Code/NewPing#Download
EXPANDED TECHNICAL DETAILS
Interactive Spatial Graphic Interface
This project uses spatial depth to control the "Zoom" level of a digital image on a PC, creating a non-touch interactive display.
- Proximity-to-Scale Mapping: The Arduino captures distance data from an HC-SR04 sensor and sends it over serial. On the PC, a Processing script receives this value and maps it to the image scale factor (e.g., 20cm = 1.0x, 5cm = 3.0x).
- Smooth Transition Filtering: The Processing script applies a "Linear Interpolation" (LERP) algorithm to the incoming data, ensuring the image scales smoothly without the "jumping" effect caused by sensor noise.
Creative Strategy
- Presence-Triggered Interaction: (Features) If the sensor detects a user within 1 meter, the display "Wakes Up" and begins the interactive scaling show, returning to a standby animation when the user leaves.