This week, we were asked to design and program a smart device that solves a problem with multiple inputs and outputs. The smart device includes two input components (at least) and two action components (at least)
This time, I conducted research for inspiration for my project and came across a security system on Project Hub that uses Arduino. While I won’t be incorporating any security features or the ultrasonic sensor in my final project, I found projects related to security and user interaction in outdoor environments contexts. So, Ifound it intresting to implement a similiar concept.
Software: Tinker CAD, ARDUINO IDE
Tools:
> Components:
- Inputs: Ultrasonic sensor, switch
- Outputs: Buzzer, LED (Green)
- Breadboard
- Jumper wires
- Crocodile wires
- Resistors 220 Ohm
- Rosetta
Tinker CAD: to build and simulate the circuit
Arduino IDE: to install the codeblocks on the breadboard
Arduino UNO
(Brain+Power management)
Breadboard
Resistors (220 ohm)
jumpers
Crocodiles
Adaptor (Power source)
Rosetta
Ultrasonic sensor (input)
On/Off switch (Input)
Buzzer (output)
LED (output)
I started by building the circuit on Tinkercad, adding the input components, the ultrasonic sensor and the switch, the output components, the LEDs, and the buzzer.
wiring:
INPUT COMPONENTS
> Ultrasonic: (4 pins)
The VCC is connected to the +ve rail of the breadboard
The trigger pin to the Arduino pin 7
The echo pin to the Arduino pin 6
The GND pin to the -ve rail of the breadboard
>switch: (3 pins)
The middle terminal is connected to the Arduino pin 4
The left terminal is connected to the breadboard -ve rail
The right terminal is connected to the breadboard +ve rail
OUTPUT COMPONENTS
> Buzzer: connected directly to the breadboard
the +ve side is connected to a jumper from the breadboard to pin 3 on the Arduino
the -ve side is connected to the -ve rail of the breadboard
> LEDs: connected directly to the breadboard (Series connection)
added a resistor to each +ve side
the other side of the resistor is connected through jumpers to the Arduino on separate pins (8,9)
the -ve side on the LEDs is connected to a -ve jumper to the -ve rail of the breadboard
The tinkercad circuit acted a reference for the actual circuit implementation (overall connection)
ON/OFF SWITCH WIRING
> The middle terminal is connected to the Arduino pin 4
> The left terminal is connected to the breadboard -ve rail
> The right terminal is connected to the breadcoard +ve rail
(using crocodile jumpers)
ULTRA SONIC SENSOR WIRING
The VCC is connected to the +ve rail of the breadboard
The trigger pin to the Arduino pin 7
The echo pin to the Arduino pin 6
The GND pin to the -ve rail of the breadboard
LED WIRING
> added a resistor to each +ve terminal of the LED
> the other side of the resistor is connected through jumpers to the Arduino on separate pins (8,9)
> the -ve side on the LEDs is connected to a -ve jumper to the -ve rail of the breadboard
BUZZER WIRING
> The +ve terminal of the buzzer is connected to a jumper from the breadboard to pin 3 on the Arduino
> The -ve terminal of the buzzer is connected to the -ve rail of the breadboard
The wiring mistake during my trials caused an issue where the Arduino cable can no longer transfer the updated code. I used a new ARDUINO cable afterwards.
When coping the wiring from Tinkercad to the actual components, I rarely get it right on the first try. I go through multiple trial-and-error attempts, making adjustments until everything works properly.
text here