Week 7 - Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

Push-Ups Counter

This week is just a modification to the previous week, making a cardboard model for my circuit and adding some modifications.



Tool Chain

Which software/machines/materials did you use in the assignment? Why?

Tinker cad to simulate the circuit before connecting the hardware

arduino ide for uploading the code on the board.



Arduino Uno board based on the ATmega328P

Breadboard to connect all components on it.

measure distance by using ultrasonic

buzzer for the toe

2*16 LCD Display "I2C" to display the state of the circuit



2 pin push button

Jumbers to wire all components



Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

schematic

I used tinkercad to draw the project schematic and implement the circuit to check its functionality.

So, I started to connect components like the ultrasonic sensor, LCD, and push button.

ultrasonic: connected its VCC, and GND to the breadboard and trigger, echo Pin to the Arduino, and make a simple code that checks the functionality of the sensor as I need or not.


The buzzer positive pin is connected to the Arduino and the negative pin to the breadboard.

I used blocks at first to understand how the LCD and ultrasonic are working.

So, I started to simulate the circuit and check code functionality before connecting it in real.

simulation.mp4

I used the push button to reset the counter to zero to be more realistic.

So if you want to start the counter from zero again just click on the push button.

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

I started to connect the components as the schematic. I connected the ultrasonic, push button, and LCD to the breadboard and Arduino.

Initially, the LCD I2C library was included so that I can handle it easily.


Then the ultrasonic sensor pins were defined and some variables that I will use later.

Here it's my setup section just to define my pins as input or output and run my LCD.

coming to the loop section, start with the reset functionو When the user wants to reset the counter to zero he just has to press the push button.

In order to generate the ultrasound we need to set the Trigger Pin on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo Pin. The Echo Pin will output the time in microseconds the sound wave traveled.

the speed of the sound is 340 m/s or 0.034 cm/µs the sound wave will need to travel about 588 microseconds. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward and bounce backward. So in order to get the distance in cm we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2.

When I want to know if there is a certain body close to the sensor this statement can trigger this if the body is between 15 and 30 cm the flag will be up and if the body becomes less than 10 cm the other flag will be up too, This indicates that the body has moved a complete push-up and write high to the buzzer pin.

The counter will be printed on the screen after each count.

Push-Ups Project.m4v

And here it's my final project working as I planned.

When the ultrasonic detects an object at a certain distance it will add one to the counter.

I started sketching the dimension on the cardboard to cut it.

After the assembly, I started to make some holes for the components and attach them to the cardboard box.

When the counter increase by one the buzzer will make a tone for a 250 milliseconds

Overcoming Challenges

What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)

We all know that the speed of the Arduino is so fast so I was facing a critical problem when the ultrasonic sense something the counter starts to count very fast,

so I started to search for solutions to this problem and I found a great solution here, it was a trick in the code by making 2 flags, flag for down position and one for up position.

I started trying to understand the code and then copied it to my code.

Vid20220831154515-1.m4v

Final Project

How can you use the skills and knowledge that you've acquired this week in your final project?

I got familiar with coding and Arduino and its libraries, and I think that will help me a lot in my final project because the two skill is essential in my final project.

WOW!

What is the coolest thing that you've learned this week? What is something that you will never forget from this week?

This Week, We Learned how to control motors by H-bridge module and how to control a 12 v Lamb using a relay module we make a simple smart home in which we can control a fan and a lamb in manual or automatic mode.

Great Activity, I enjoyed it with my team, Abdo.


Assignment Design Files