In this illustration we will going to wire the Digispark ATTiny Development Board with HC-SR04 Ultrasonic range detector, as our output we will going to use an RGB LED when the objects is near or closer to the sensor the RGB LED will going to switch on and if it is out of range the blue will light on. In the example below we can used a dedicated 5v power to supply 5v to our Digispark ATTiny Board.
Required Components
1x Digispark ATTiny Board
1x HCSR04 Ultrasonic Range Detector
1x RGB LED
1x Jumper Wire
1x Solder less Bread Board
Wiring Diagram
Arduino Sketch
[crayon-6741cb41c053a950115887/]
Didispark ATTiny85 with Ultrasonic HC SR04 Sensor