push up counter
Build and Program a smart circuit using an Arduino UNO using Code Blocks.
I've got my inspiration from this photo while i was searching.
push up counter is that smart device which can count just your correct push up so it's kind of funny and encourage you do more an exercises.
By searching in the Arduino project hub, I've found someone who has already done this project before, which makes it easier for me because I can get experience from his perspective.
use to design the circuit and build block codes
cardboard from any old device container
bread board
jumpers wire
7 segment
ultrasonic sensor
adapter 5v
simple circuit
first I've connected ultrasonic sensor in this simple circuit with just led to make sure wiring and block codes run well.
second simple circuit with just 7 segment and i set variable "counter" and i set it manually the gigital number from 0 to 9 by this block code.
and i add slider switch to read on pin 4 to open and close circuit.
then build full circuit which can easily marge the two simple circuits pervious together.
in th last of 7 segment code i put A0 to high to turn on dot led tolet my counter have 10 number not just 9.
now it is time to build the code block which will link all pervious circuit
i set the the whole code of 7 segment to run when ultrasonic if condition have turned.
in green rectangle : else for ultrasonic if condition doesn't run it will print "away" on serial monitor
in red rectangle : after if condition run Successfully it will print "detected" on screen and counter will increase +1
testing
i 've test the whole code and if condition doesn't run while the state doesn't success.
it reads when if condition have run.
cardcoard cutting
build real circuit
then build box to assemble project inside it
assemble together
wait block It is very important to let personal eyes realize that change has happened.
but it's necessary to be reasonable to avoid delaying the system.
So this mistake that I have made here,
Waiting for 2 seconds was too much time for 7 segment which causing a delay in numbers showing and sometimes causing skip numbers, as shown in the video below.
i build it by using code blocks , ultrasonic sensor and 7 segment.
note that i put yellow blinking led which run when motion has detected to figure out that it has read.
final shape for push up counter
it will be block codes knowing how it works and their function, it is very easy for those people who doesn't have programming background and kids so it doesn't matter to get deep learn in programming to run code cause you can actually build them by blocks easily and quickly i feel like i'm playing puzzle game.
mathematics equations