Digital Circle Circumference Calculator. My project is inspired by this Circle Area Calculator. My modification is to make it more digitized/smart by using ultrasonic to measure the circle diameter instead of measuring it manually.
Its function is to measure the circle diameter, calculate its circumference, then make a sound and light effect if the circumference is within a given range or make a warning sound and light effect if the circumference is out of the given range.
Arduino Uno - Arduino USB cable
5V power adapter
Multimeter
Ultrasonic - Slide switch - RGB LED - Biezo Buzzer - 3 330 Ohms resistances - Mini breadboard -
male-male jumper wires
male-female jumper wires
20 CM ruler
cardboard
Clear cellotape
Cutter
1- do the wiring of our Ultrasonic separately using Tinkercad
2- write code for Ultrasonic that reads the diameter(x) of a given circle
3- copy and paste the code to Tinkercad software to test it functionality
4- build a simple circuit that connect an RGB LED with a slide switch using Tinkercad
5- write a simple code that makes our RGB LED transfer between red and green light. (JUST FOR TESTING)
6- copy the code to Tinkercad software to test its functionality
7- construct a simple code for the Piezo buzzer
Note: the tone changes by changing the variables in line 8.
The full code
8- construct the full circuit with Tinkercad and test the code
Stage 1: Testing
build the actual circuit of RGB LED with slide switch
Note: in Tinkercad, the Green pin is replaced with the Blue one. but the green light works properly with the actual circuit.
Here, I checked the buzzer code with an actual circuit.
Stage 2: Full circuit
construct the final circuit based on our Tinkercad wiring diagram
Final Circuit
(Here, we only test its functionality before adding the enclosure)
Stage 3: Enclosure
connect the LGB LED and the slide switch to male-female jumpers so we can implement them into our enclosure
cut 6 squares of the same size
In one side, cut 2 slots for the Arduino
In another side, cut a slot for the Ultrasonic, the slide switch, and the RGB LED
Ultrasonic sensor gives some errors
to reduce the errors, a piece of cardboard is added to the project while measuring.
It still makes an error with the very small dimensions as shown in the project video.