Project Development
For my very last blog for the CP5070 module, I will be showing how my group and I planned, designed, executed and assembled our prototype. We were tasked to make a soft half-boiled egg maker for this project. So follow along if you want to cook some eggs. :)
Contents of this post:
2. Team Planning, Allocation & Execution
- Team members and our roles
- Finalized Bill of Material (BOM)
- Finalized Gantt Chart
- Task Allocation
3. Design and Build Process
4. Problems & Solutions
5. Project Development Files as downlaodable files
About our Chemical Device
What is it:
Our chemical device is a soft-boiled egg maker. Its objective is to cook a quail egg till half-boiled and lift the egg up when done. The quail egg will be placed into a basket that is equipped with a temperature sensor to measure the temperature of the water in a container filled with hot water. The motor will lower down the basket filled with the quail egg according to the time delay set. This timer will run until a set time is up and the motor will be activated to reel in the basket.
Problems it will solve:
It can solve the inconvenience and inefficiency for users to cook soft-boiled eggs. First, it will solve the problem of making it automatic, so the user does not have to manually be in the kitchen to cook the egg and is able to focus on other kitchen duties. It will eliminate the problem of the user being unable to determine the temperature of the water to cook the egg with the help of a temperature sensor. Next, the user may overcook or undercook the egg so this maker is able to address that problem as it can cook a perfect soft half boiled egg every time and can cook 2-3 eggs at a time. Lastly, it eliminates the problem of the tedious task of cleaning the stove and pot after cooking the egg.
Hand sketch:
Team Planning, Allocation & Execution
Team Wasabi
Group 3 Members:
1. Katrina
(Chief Executive Officer/ Team Leader)
2. Ashwati
(Chief Operating Officer)
3. Xin Ni (Chief
Safety Officer)
4. Jun Lin (Chief Financial Officer)
Finalized Bill of Material (BOM):
Finalized Gantt Chart:
Link to Gantt Chart
Design and Build Process
// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
Explanation:
These lines of codes imports libraries that allows us to programme the LCD screen, continuous servo motor and temperature sensor
LiquidCrystal_I2C lcd(0x27, 16, 2); -the LCD address and size of the LCD screen
#define ONE_WIRE_BUS 4 -Define the sensor pin
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
Explanation:
These lines of codes set up the LCD screen by defining its size and setting up the temperature sensor by designing the pin it is connected to.
Servo myservo; -Create new servo object
#define servoPin 9 -Define the servo pin:
int angle = 0; - Create a variable to store the servo position:
Explanation:
These lines of codes input pin 9 as the output for the servo motor and also creates a variable that allows us to store the servo’s position, so we can move it later in the loop.
void setup(void)
{
Serial.begin(9600); -Establish serial communication between the Arduino board and another device
pinMode(2, INPUT_PULLUP); -Establish the built-in button (PIN 2) on the Arduino board as input
Explanation:
These lines of codes start the serial communication between the Arduino board and the computer and it also inputs pin 2 as the button. Pin 2 is the built-in button in the Arduino board so the button to operate the Arduino will be using that button.
Serial.println("Dallas Temperature IC Control Library Demo"); -Start serial port
sensors.begin(); -Start up the library
lcd.init(); -Initialize the lcd
lcd.backlight(); -Turn on the back light
}
Explanation:
These lines of codes starts the serial port for the temperature sensing, library and the LCD screen as well.
void loop(){
lcd_sensor();
servo();
}
Explanation:
These lines of codes are very important as it sets two variables for the LCD and sensor loop and the servo motor loop. This allows us to run both loops simultaneously.
void lcd_sensor(void)
{
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
float tempC = sensors.getTempCByIndex(0);
// Check if reading was successful
Explanation:
These lines of codes reads the temperature sensor and print them into the variable ‘ float tempC’.
if (tempC != DEVICE_DISCONNECTED_C)
{
Serial.print("DS18B20 Temperature");
Serial.println(tempC); - Temperature in degree celsius is being measured and recorded
lcd.setCursor(0, 0); -Set location on LCD screen to display the text
lcd.print("Temperature:"); -Prints “Temperature” on the LCD screen
lcd.setCursor(0, 1); -Set location on LCD screen to display the text
lcd.print(tempC); -Print temperature in degree celsius onto LCD screen
lcd.print((char)223); -Print the degree sign
lcd.print("C"); -Print the celsius sign
lcd.print("|"); -Print a line to separate the temperatures displayed with different units
lcd.print(DallasTemperature::toFahrenheit(tempC)); -Print converted temperature in Fahrenheit from degree celsius
lcd.print("F");} -Print Fahrenheit unit
Explanation:
These lines of codes creates an if/else loop that checks if the temperature sensor is detected and prints the variable ‘ tempC’ from the previous lines on the LCD screen.
else
{
Serial.println("Error: Could not read temperature data");
lcd.setCursor(0, 0); -Set location on LCD screen to display the text
lcd.println(" Sorry!! "); -Prints “ Sorry!!” on the LCD screen
lcd.setCursor(0, 1); -Set location on LCD screen to display the text
lcd.println(" Data Error "); -Prints “ Data Error” on the LCD screen
}
}
Explanation:
These lines of codes will print an error message on the LCD screen if the arduino cannot detect the temperature sensor.
void servo()
{
if(digitalRead(2)==LOW){ -When built-in button is pressed
myservo.attach(9); -Motor is attached to Pin 9
for (angle = 180; angle >= 0; angle -= 1) { -If the value of angle is more than 0, the program will continue subtracting 1 to the value until it reaches 0. angle = 180 states that the angle is at 180.
myservo.write(angle);
delay(3);
delay(3000);
myservo.detach(); -Motor is detached from Pin 9
delay(5000);
myservo.attach(9); -Motor is attached to Pin 9
for (angle = 0; angle <= 180; angle += 1) { -If the value of angle is less than 180, the program will continue adding 1 to the value until it reaches 1800. angle = 0 states that the angle is at 0.
myservo.write(angle);
delay(3);
delay(3000);
myservo.detach(); -Motor is detached from Pin 9
}}
}
Explanation:
These lines of codes are the loop for the servo motor. We create an if/else loop so that if the button is pressed, the servo will be attached to pin 9 and run for 3 seconds. Next, as it is a continuous motor, we stop the motor by detaching it from pin 9 for 5 seconds then reattaching it so it will run the opposite direction for 3 seconds.
else{
myservo.detach();
} }
Explanation:
These lines of codes are for when the button is released or is not being pressed, the servo motor will detach from pin 9 and not run.
Hero shots:
Part 5. Wiring for the Arduino components (done by me)
Wiring for all the components.
Close up of the wiring for the motor.
Close up for the wiring of the temperature sensor, LCD screen and breadboard.
For the wiring, most were from the resources found online as it was very complicated due to having a lot of different components to fit into one Arduino Uno. Additionally, the wiring for the temperature sensor, LCD screen and continuous motor were difeerent. When combining, I realised that the motor and temperature sensor uses the same 3.3V pin. So for this, I used the breadboard to accomodate both the motor and temperature sensor as seen from the images above.
Links to the resources I followed:
https://www.youtube.com/watch?v=Y1__vmkr8-g&list=LL&index=5
https://www.youtube.com/watch?v=k5uPYfZ6u7E&list=LL&index=2
https://www.youtube.com/watch?v=q9YC_GVHy5A&list=LL&index=6
Part 6. Integration of all parts and electronics (done by Everyone)
Problems & Solutions
Programming the motor to turn clockwise, stop and turn anti-clockwise
Solution: We did a lot of research from various resources followed by trying out the codes and editing it to fit our needs. So, from the research we found that the “Attach” and “Detach” commands work very well so we used them.
Programming motor to connect to the entire Arduino code with LCD and temperature sensor
Solution: Since there was a problem in combining these different codes, we had to do more trial and error by changing the wiring of all the components and the Arduino Uno. From there we realized that the wire was wrongly connected to PIN 13 and not the ground pin which caused all the problems
Did not increase speed for 3d printing, takes a longer time to print
Solution: We had a chance to redo the 3d printing by increasing the speed of the printer to 100mm/s.
Putting support in our cylinder covers the hole for ball bearing, hole for motor is not fully printed and the bed adhesion is only printed half the cylinder
Solution: After several checks on our design and settings in CURA, it came to our knowledge that the particular Creality Ender 3D Printer was not able to print out our design. So, to solve that issue, we changed the 3D printer to Ultimaker. By using this it gave us perfect coverage of the bed adhesion. The holes on the cylinder were not covered too.
Our measurements were off by a few centimeters. We predicted that it's because the sensitivity of the measuring equipment we used (ruler) is not sensitive enough. we should have used a vernier caliper
Solution: We predicted that it's because the sensitivity of the measuring equipment we used (ruler) is not sensitive enough. We should have used vernier calipers to produce an accurate measurement.
Project Development Files as downlaodable files
Embed file of our Final Prototype:
Comments
Post a Comment