For this week's assignment, I had an idea about building a multi-functional Super radar system! The ultimate Radar that uses 3 sensing sensors to detect who is approaching and eliminate it!
I was sorting the sensors in the kit I have and decided I will combine all of these sensors, as they do similar work, detecting.
Microwave Sensor for motion detection
Ultrasonic Sensor for distance measurement
Infrared Sensor for close-range object detection
Then I will drive the date I get from the sensors with different actions, maybe buzzer, lamp..etc.
I googled a lot to find some inspiration and I got my hand on some nice pictures, but I didn't find any one that use the 3 sensors together.
9v adaptor
Buzzer
Ultrasonic Sensor
Arduino Uno
Lots of wires
AVOFor testing and troubleshooting
IR sensor
Microwave Sensor
250 MOhms Resistor
Red LED
Breadboard
small lamb
Crocodile Clips
CardBoard
gear motor
Relay Module
Thinker cad for designing the circuit
Arduino IDE
I started by brainstorming and listing all the components I needed and how the device would function.
Since the goal was to create a multi-functional radar system, I knew I would need multiple sensors to detect movement and measure distance:
The device will include input components
IR Sensor – To detect objects at close range with a simple high/low output.
Microwave Sensor – To detect movement even through objects.
Ultrasonic Sensor – To measure the exact distance of detected objects.
The device will include action components:
Small lamp – Turns on when movement is detected (controlled via a relay module).
Buzzer – Provides an audible alert when an object is detected.
Red LED – Lights up to indicate sensor activation.
The circuit components will be:
Arduino UNO – The brain controlling all operations.
Breadboard – For easy wiring and connections.
9V power adapter – To provide power to the circuit.
Relay - to power the lamp and give signal from Arduino.
gear motor - to rotate the top part.
250 MOhms resistor – To regulate current flow.
Lots of wires and crocodile clips – For connections.
After gathering all the components and writing them down, I used Tinkercad to create a wiring diagram and plan the connections. Once I was confident in the setup, I started assembling the circuit on a breadboard and wrote the Arduino code to process sensor data and activate the outputs accordingly.
I wasn't able to find relay module on thinkercad,, it looks so wired I didn't find out the connections. so I made the relay part on breadboard only.
Before wiring everything, I checked the datasheets for my component to confirm the correct connections. I also tested each sensor individually to make sure it was giving the expected readings before assembling the full circuit. ( divide and conquer) ;p
Find thinker cad link here : link
I started by assembling the circuit on a breadboard, following the plan I created earlier. Since I had already tested the individual components, I proceeded with wiring everything together. I ensured that each sensor and output device was properly connected to the Arduino and powered correctly.
I started by establishing the power rails on the breadboard, connecting the 5V pin of the Arduino to the positive rail and the GND pin to the negative rail. This allowed me to distribute power across all components.
I connected the 9v power on the other rail.
Here is a video for the first test:
Connecting the Input Sensors:
IR Sensor: Connected its VCC to the 5V rail, GND to the ground rail, and OUT to digital pin 4 as an input on the Arduino. The sensor detects nearby objects and provides a HIGH or LOW signal.
Microwave Sensor: Similar to the IR sensor, I connected VCC to 5V, GND to the ground rail, and OUT to digital pin 7 as an input. The sensor detects motion through radar signals.
Ultrasonic Sensor: Connected VCC to 5V, GND to ground, Trig to Analog pin A1, and Echo to Analog pin A0. The sensor measures distance and detects obstacles.
Connecting the Output Components:
Relay Module (to control the small lamp): Connected VCC to 5V, GND to ground, and IN to digital pin 4. The relay acts as a switch to turn the lamp on and off, I give signal to it and it turns on the lamp, the lamp is wired to the relay through the normal closed (NC) Channel.
The DC motor is connected with the lamp in parallel too.
Buzzer: Connected positive terminal to digital pin 7 and negative to ground. The buzzer will sound when movement is detected.
Red LED: Connected anode (+) to a 250 MOhm resistor, then to digital pin 8, and cathode (-) to ground. This LED serves as a status indicator.
Programming the Arduino:
Once the wiring was complete, I moved on to the coding part. I wrote an arduino C script: The logic:
I Setted up the pins for inputs and outputs, for the ultrasonic sensor (trigpin & echopin), IR ,Microwave, and other components.
I Declared some variables for the ultrasonic sensor.
If any sensor reads High, it activates the relay module to turn on the small lamp, triggers the buzzer, and lights up the red LED.
If no HIGH reading is detected, all outputs remain off.
For the ultrasonic, it triggers if the distance is below 20.
The Code includes a small delay to prevent unnecessary triggering.
All the logic is if and else mainly.
I used Serial to get ultrasonic sensor readings at the serial monitor.
For the final setup, I built a simple cardboard enclosure, and made a place for the wires.
Annnnd here is the final Device:
I encountered A lot of issues:
The relay module wasn’t switching correctly at first. I realized I was connecting it in a wrong way, by try and error, then I looked at the diagram. I needed to connect the common (COM) and normally open (NO) terminals properly to control the lamp.
Also I had a logical Error xDDD
The lamp we placed close to the sensors, so the sensor triggered itself and enters to a loop. I fixed this by repositing the lamp.
IT will help me making The brain of my project, now I can comfortably work with sensors, wire them, get data from them. look for libraries online and use them.
I loved seeing the CNC working in the Green session, It was the first time seeing it. I loved The idea and how useful it can be!
I got interested in the idea that there is a 5 axis CNC machine, this is so cool, Also the instructor Omar, Did an awesome job explaining them in a very easy and simple way.
It was very cool Seeing keypad working for the first time and understanding the logic behind it!
We made a smart Home During the EOW Session, it was awesome reading humidity and temperature, controlling stuff with them
Green session was cool too, The carbon foot print was something I didn't know about before and how to calculate it.