My selected idea is a circuit takes the first input from a button as ON/OFF to open a box using the servo motor horn as the first output. When box is opened the buzzer play a sound as the second output. I have a potentiometer as the second input to enter a variable time period can be a delay period to open the box.
I try to implement an idea inspired from my final project idea to build a box open with a timer and here we can set the time using the potentiometer.
Tinkercad is a free web app for 3D design, electronics, and coding.
BreadBoard.
Wires.
Slide Button
Uploading Arduino code.
Buzzer
Arduino UNO.
- The circuit has 2 action component (1 Buzzer) && (1 servo motor).
- The circuit has 1 input component (1 potentiometer) && ( 1 button).
- The breadboard will connect components with Arduino.
- The circuit scenario.
* When pressing button ON the servo will move to 45 to close the box.
* The potentiometer will feed the circuit by a variable value as the variable timer period .
* When pressing button OFF the servo will move to 130 to open the box after period identified by potentiometer and play a sound on buzzer to mention the box is opened.
- Firstly I included <servo> library to get ability of working on servo capabilities.
- I firstly also declare a constant with initial value identify the delay value with 0.
- The setup part contains my declaration for used components to use it with Arduino for both input and output.
- The logic part is simple. Firstly I read value from push-button to move servo to 45 degree and close the door at same time to mute the buzzer.
- Secondly If I want to open the closed door:
* I get the passed time since Arduino started and store in a variable.
* I built a comparison condition to compare difference between Arduino passed time and time to begin timer regard to the time I set as a timer time through potentiometer move ( 30000-60000).
* IF the condition had been met it will move servo to 130 degree and is the door will open, and same time play a sound from buzzer.
- Making wiring for servo motor with both breadboard and Arduino.
- Writing code to test motor movement and identify the suitable horn positions in open and close status.
- Adding buzzer and making wiring for it with servo motor
- Adding code to play a sound on buzzer with servo positions in both close and open.
- The buzzer sound will be while the box is opened and will be muted if the box is closed.
- Adding potentiometer and making wiring for it with servo motor and buzzer.
- Adding code to map potentiometer analog value into values can be used as a timer interval for close the box.
- Testing the whole code to ensure working well and do functions as plan.
Opened status.
Closed status.
Some of points within videos were not clear and I have to use a written tutorial as it is better for me to read more than watching videos.
I did not receive expected values from circuit specially when moving potentiometer to change the value that will be mapped into timer period. I tried tracing the code many times without solving the problem. But when tracing the wiring I noted that I am using GND bin instead of input bin as they are adjustable and the bins are very close. Next times I tried to make sure that wiring is in correct bins.
Getting familiar with designing and programming circuits will be very useful in designing successful circuits for my project.
Every time before begin making process like in assignment, I feel anxiety and I can not do it and I still need a lot of study. But after two or three minutes from beginning alone or with a team I feel better and it was not as bad as I thought at beginning.