Final project done!
Aalam Azouz is a hide and seek family game, based on Azouz -a smart device- along with a mobile application called Aalam Azouz.
This was my bachelor project I. worked on in 2021, which unfortunately, due to restricted time and knowledge of the field, I wasn't able to realize back then.
So, it's time to get Azouz to see the light!
One of the ideas suggested by Esraa, my instructor, was to design an RC car for Azouz, and tailor its features to it. This is to make the implementation feasible, time wise and complexity wise for the diploma.
This also fits the narrative of Azouz quite well! Being a smart device/creature that transcends between two words, it suits Azouz to transport via a cool RC car!
Following the hand drawn sketch and the low fidelity prototype illustrated in the proposal, I opted for a quick and rough 3D model to refine the silhouette of the car, decide on its height, and draft the placement of components. For this, I used Rhino.
Below is a video of the rough modelling I did on Rhino.
Then, to sketch and build the final design with measurements and exact projections, and extract the CAM files I used Fusion 360.
Given the nature of the enclosure, I decided to do a mixed design; with the top and base in 3mm plywood fabricated using laser cutting, and the sides in PLA printed using FDM 3D printing.
To sketch and build the RC car enclosure on Fusion 360, I did the following steps:
I opened Fusion 360 and saved the file.
From the components sheet, I downloaded the step files of the needed components, uploaded them on Fusion, and inserted them into the RC car file using the Derive tool, from the Create dropdown menu.
Then, I created a new component for each.
I inserted a screenshot of the base and the top using the canvas tool, then I used the scale tool to reach the intended dimensions.
Then I started sketch, and chose the top plane to work on.
I created a component for the Top and another for the base.
I used the line tool from the create drop down menu to trace the silhouettes of the base and the top, each in the respective sketch layer of the respective component.
Using the Extrude tool from the Solid category of tools, I extruded both sketches 3mm, also each while activating the respective component.
Then, using Move/Copy tool from the Modify dropdown menu, I moved the top layer to the needed height.
In a new component called sides, I offset the top sketch by 3mm to the inside (which would be the thickness), then I extruded the 3mm border of the top sketch down to the base. This creates the body of the sides component.
Now we have shell of the design.
Using the Move/Copy tool from the Modify dropdown menu, I moved the components as per the model I did in Rhino.
To create the openings for attaching each of the components, I either used Project/Include tool from the Create dropdown menu, or drew the openings directly on the needed surface plane, tracing the component in place.
I exported the top and base files as dxf for laser cutting from the embedded extension in Fusion 360, found at the Create menu. And I exported the sides body as .stl for the laser cutting.
The pictures below give glimpses of the process in pictures.
LASER CUTTING:
To laser cut the top and base, I inserted the .dxf files on LaserWorks software to be able to program it for the laser cutter.
I set the power to 65 and the speed to 20, then I was able to upload the .rld file to the Malky Laser Cutter to cut it on 3mm plywood.
3mm plywood
LaserWorks interface
Malky Laser Cutter
3D PRINTING:
First I prepared the .stl file by slicing it on the Prusa slicer, which is needed for the machine I used (Prusa MK2), and I exported the file as a .gcode.
To start 3D printing the sides I inserted the .gcode file to the printer via the given SD card.
PLA plus filament
Prusa MK2 and MK3 FDM 3D printing machines
All the fabricated pieces!
The electronic circuit I used is a smart one, controlled by Arduino UNO. Below is the breakdown of the components and their functions in the circuit.
Arduino UNO, the brain of the smart circuit
IR sesnor (input)
Ultrasonic sensor (input)
Buzzer (action)
Rechargeable battery
Mini breadboard to wire the circuit on
Motor driver to provide the DC motor with sufficient voltage
DC motor
Screwdriver
Jumper wires
Terminal
9V power supply
FOR PROTOTYPING the wiring of the components, I used Tinkercad.
First, I prepared all the components.
Then I wired the Arduino to the breadboard, by wiring the 5V pin in the Arduino to the positive row in the breadboard and the GND pin in the Arduino to the negative row in the breadboard.
Then I started with wiring the PIR sensor, which I used only on Tinkercad because there's no IR sensor there. The left node of the PIR (signal) is wired to the pin 12 in Arduino, then the middle node (power) to the positive row in the breadboard and the right node (ground) to the negative row in the breadboard. Now, the PIR is operating with 5V from the Arduino, and sending signal to the digital pin 12 on Arduino.
On the other hand, the DC motors need 9V, which the Arduino is not able to give. This is why I used L293D motor driver and wired it as illustrated in the pictures.
Following this, I connected the buzzer; by connecting the positive node to the positive row on the breadboard, and the negative node to the negative row on the breadboard using jumper wires.
Then I connected the ultrasonic sensor as illustrated in the picture below, making sure that it is connected to analogue and digital Arduino pins as needed.
Now TO REALIZE THE CIRCUIT:
First, I prepared all the physical components.
Then I wired the Arduino to the breadboard, by wiring the 5V pin in the Arduino to the positive row in the breadboard and the GND pin in the Arduino to the negative row in the breadboard.
Then I started with wiring the IR sensor, the left node of the 5R (OUT) is wired to the pin 12 in Arduino, then the left node (VCC) to the positive row in the breadboard and the middle node (GND) to the negative row in the breadboard. Now, the IR is operating with 5V from the Arduino, and sending signal to the digital pin 12 on Arduino.
On the other hand, the DC motors need 9V, which the Arduino is not able to give. This is why I used L298N motor driver and wired it exactly as illustrated in the pictures.
Following this, I connected the buzzer; by connecting the positive node to the positive row on the breadboard, and the negative node to the negative row on the breadboard using jumper wires.
Then I connected the ultrasonic sensor as illustrated in the picture, making sure that Trig is connected to analogue pin 5 and Echo is connected to digital pin 4.
To power the circuit, I opted for a rechargeable battery for the convienince of an RC car.
The power distribution among the components that need different voltages is as follows:
The battery is charged via a 9v adaptor.
The battery supplies the breadboard's positive column, with an ON/OFF switch connected in series
The negative from the ON/OFF switch is connected to the breadboard's negative column.
The Arduino is connected to the breadboard's positive column via the VNN (This is power supply TO the Arduino)
The Arduino is connected to another column on the breeadboard via the 5v pin; which makes it a positive row of 5v.
The Arduino is connected to the breadboard's negative column via the GND pin.
Based on that, the breadboard includes two positive rows:
One powered by the battery and gives out 8v.
One powered by the Arduino and gives out 5v.
Battery connected to adapter socket, and connected to the rosetta which connects to the ON/OFF switch.
Since I'm using the IR sensor, the logic of the Azouz RC car is as follows:
If a user is closely detects (IR reads), the car moves.
If the car meets an obstacle, motors change direction.
If a user holds Azouz (IR reads again), the car stops.
The components are wired to Arduino via the following pins:
Motor 1: Digital pins 7,8 (control moving to stopping), and analogue pin 9 (controls speed) - all output.
Motor 2: Digital pins 11,13 (control moving to stopping), and analogue pin 10 (controls speed) - all output.
IR: Digital pin 12 - input
Ultrasonic: Trig is connected to analogue pin 5 and Echo is connected to digital pin 4.
This is identified in the beginning of the code.
I used Arduino IDE software write the code, troubleshoot it, then upload it to the Arduino UNO.
In this code, Functions and Millies are used.
The concept of using functions in the code is to create a function and recalling it in the voild loop whenever needed.
In this code we have the following functions:
startMoving
stopMoving
changeDirection
readUltrasonicDistance
Now how does the void loop in this code works?
Arduino reads the voide loop line by line. For the logic of the Azouz RC car to work as we need it, Arduino needs to perform actions in parallel. This is where the Millies come to action.
In Arduino there is a timer that starts counting with powering on the Arduino. The Millies uses this timer to read the IR sensor every second, while the rest of the code runs normally. This is what the first line of the void loop unsigned long currentMillis = millis(); dictates.
The rest of the lines dictates the following:
If IR reads, check motors
If motors are not moving, recall startMoving function, and set motorMoving variable true. Now the motor works.
Next time the IR sensor reads, set motorMoving variable false.
If motors are moving, check the ultrasonic. If it reads less than 5, recall changeDirection function.
First, I prepared the all the enclosure parts, tested the accuracy of the assembly and fetching any errors in the screws holes placements.
Now to start assembling the components to the enclosure parts, I started with assembling the motors and wheels to the sides.
I also attached the push button and the adaptor socket to the sides.
Then I attached motor driver to the top.
Arduino attached to the base, ultrasonic attached to the sides.
In this stage I did the wiring.
Then brackets fixed in place, and the enclosure is complete!
I always asked for feedback! This project only got realized due to the contributions of my instructor, the fab lab experts, and my colleagues, all who helped me troubleshoot any problems I faced.
Beside is an example of a suggestion from Abbdelrahman, which probably spared the misfortune of a short circuit!
These are the terminals connection to the ON/OFF switch and the external adaptor socket. I have already sealed the connections of each wire in place with this red rubber heated on it. However, Abdelrahman suggested to extend this rubber piece to at least one of the terminals on each component, to be safe and secure from them nudging each other and creating a short circuit.
The following section also shows some of the challenges I faced, and how sharing and collaboration helped in resolving them.
I have faced multiple challanges in the design and fabrication of the RC car enclosure. Many of them were related to the size of the components imported from the excel sheet.
I learned later from Abdelrahman that there are different sizes for each component! For next times, it is important to double check that the components step files are the same dimensions as the physical components I have.
The ON/OFF switch I had was bigger than the digital file. Abdelrahman saved the situation with a smaller one before I attempted to loosen the opening.
The same happened with the wheels. I had two different diameters for the insert, and my difital file matched the smaller one.
This time we discovered too late! We saw the difference in diameter after we had already loosened the openings!
In the first attempt to print the brackets, the print failed. Turned out the machine needed caliberation.
The sides were printed by an older version of the 3D printing machine: the Prusa MK2. It was an overnight print, and it got out with the shown traces. Turns out this also meant the machine needed claiberation. Swipe the pictures above to see the machine that blew heat onto the threads helping to easily remove them.
For some reason, the battery sparked flame and smoke while charging, and I'm still working on figuring that out with my instructor. I overcame the challenge buy skipping the battery from the power management temporarily and replaced it with a direct connection from the 9v adaptor to the breadboard and the ON/OFF switch via the rosetta.
I missed counting in the volume of the wires in the RC car enclosure. It's not affecting the function, but it's something I have in mind for future developments.
A stubborn challange I faced was with the project integration, when every thing was supposed to be good and working, but the RC car didn't function! Pro tips from I learned from Esraa my amazing instructor after troubleshooting the issues:
Eliminate possibilities. We kept tracing the issue backwards till we eliminated all possible bugs and narrowed down the issue to one possible option; which turned out to be the code.
Divide and conquer. To debug the code, we broke it down. We removed all the noise (multiple outputs / inputs) and left only the input/output circuit which had the issue. Mvoing forward from this, we were able to troubleshoot and rethink the logic of the code; and so correctly add the other components.
For future development, I intend to do the following:
Increase the height of the enclosure, to make more room for the wires.
Move the motor driver away from the border to make room for the jumper wires attachement.
Fishish and texture-spray paint the car to look like a rock and match the sketch!
Experiment with the logic of the RC car to have the following features, and so experiment with PIR or microwave sensor.
Minimum User Features
Azouz in his RC car runs when caught by user
Action: DC motor
Sensing: Passive Infrared sensor
User Input: gets closer to Azouz
RC car obstacles avoidance
Action: DC motor changes direction
Sensing: Ultrasonic sensor
User Input: None
Complete User Features
RC car emits sounds when caught
Action: buzzer
Sensing: touch sensor
User Input: holds RC car
Nice-to-have User Features
RC car vibrates when held
Action: NFP motor
Sensing: Touch sensor
User Input: Holds Azouz RC car