The Smart system Reducing water consumption project should accomplish the following :
control output clear water ( bathroom / kitchen taps ) and counting water amount which was consumed
Calculate daily water consumption and give recommendations
collect grey water from wash basin, bathtub, Kitchen sink and Redirecting it as inputs into devices that can use this water like washing machine, Flush toilet, Watering plants, Floor cleaning, car washing
I used this software to build my design on it and make connections between parts and locate screw holes for brackets and electric component to export it as 2D files to cut on laser machine and 3D files to be printed on 3D printer
CAD process
save a new project name( final project )
make components
sketching
extruding
mounting electric component
projecting
making connections
making holes for component
add brackets at corners
add screw and nuts
add material for model (wood)
export 2D parts as DXF
export 3D parts as STL
I used this program to design a LIVING HINGE that makes wood easy to bend and connect the curved parts to the strait parts and determine the number of sheets I need and distribute the parts inside the sheet and divide the large parts from the sheet area
CAD process
draw living hinge pattern
extrude 1.5 mm
array pattern
Measure the length of the curve from the front, then draw a rectangle and place the pattern inside it and clean the lines using trim tool
Arrange the pieces within the available sheet size 30 *50
Dividing the larger parts of the sheet into smaller parts of the sheet
export file as DXF
laser cutting software process
import DXF file
Start to select lines and coloring it related to color function which related to design :-
blue : for cutting
Put numbers for these colors
blue : 300mm/s for speed - 10% for power
export the file to (AI) format to be prepared for laser cutting
UltiMaker-Cura-5.9.0
3D printing software process
import STL file
start to adjust model parameter values for:
layer height : using 0.2mm
infill : 0%
supports : model no need supports
adhesion : no need
orientation : model step on flat side
slice the model to get time and weight for model
save the file to desk to (g.code) format to be prepared for 3D printing
THE MACHINE FOR FABRICATION
Malky ML149
laser machine process
open software "RD works" and import the file
check layers power / speed numbers
Measure the total cutting area to choose the appropriate wood sheet 30*50
open the machine power and download the file with my name "sheet1"
Open machine and press on file button and choose the file from screen of machine
put wood sheet on machine and stick it by using supports
Adjust laser nozzle and tie it well
press origin button to make start point for laser then press frame to Determine the cutting area
check laser power by press on pulse
close the machine cover , open Air hood and press "start"
PRUSA i3 MK2
3D printer machine process
open the machine and leave it to adjust heat of nozzle
change black filament and put grey one
cut the end of filament with pliers 45 degree cutting
choose unload filament then remove orange filament and put white filament
choose load filament and leave it take out old color filament
choose "yes" after it extruding white filament
clean a nozzle by removing extra filament from a nozzle using tweezer
I choose "print from SD" and choose my file
leave the machine preparing bed and nozzle heat and bed balance
after machine get the heat it started to build the model
MATERIAL
Plywood (3mm)
3M SCREW AND NUTS
TOOLS
Cutter
Wood Rasp
Screwdriver
After machines finishing the parts need to clean
some parts not cut well by laser, I used cutter and to cut it
some 3D printing had extra plastic need to remove I used Wood Rasp to clean it
Start by assembling the parts together using brackets, screws and nuts using a screwdriver, and install the electrical components inside.
TOOLS
MULTIMETER
Screwdriver
COMPONENT
INPUTS
water level sensor : sensing the level of water and give number for this level and Monitors changing in level
ultrasonic sensor :It senses any object approaching it and gives an indication of the distance between it and this object.
Relay : open and close electric by taking signal and take volts until 12 v and give 5 v for device
on/off switch :Controls the passage or prevention of the passage of electric current
toggle switch
water level sensor
Bluetooth module
toggle switch
ultrasonic sensor
relay
on/off switch
2.OUTPUTS
LCD : Displays on screen serial print from ARDUINO As written in the code ( writing water level sensor reading )
LED : lighting red and green connecting to switches, open when switch on
water pump : moving water from pot to another throw hose
LCD
led light ( red-green)
water pump
3.BRAIN
ARDUINO : It takes the code that is written on PC according to the required action on the bean and executes the code on the component.
ARDUINO UNO
4.WIRING
breadboard : collect all circuit wires on it
crocodile wires : using to catch wires strong
jumper wires
resistors 220 : using for led
breadboard
resistors 220
crocodile wires
jumper wires
ELECTRONIC CIRCUIT
ELECTRONIC CIRCUIT divided into 3 parts separated put connected together inside the device
This circuit consists of :
water pump
relay
led green
switch
water pump motor opens and closes using a switch and is connected to a relay and When turned on, the LED lights up green. It is not connected to the Arduino.
This circuit consists of :
water pump
relay
led red
ultrasonic sensor
water pump connected to a relay that operates when it receives a signal from the Arduino.
The Arduino sends a signal when it receives an ultrasonic sensor signal when it senses an object 10 cm away or closer.
This circuit consists of :
LCD
water level sensor
Bluetooth module
The screen writes the water level reading determined by the water level sensor and any change in the water level is written down.
The Bluetooth module sends these readings to an application showing the daily water consumption.
POWER SUPPLY 5V/5A
for powering circuit components
POWER SUPPLY 9V/2A
for powering Arduino
Explaining the code logic and How to planning it
The code is divided into two actions.
1. responsible for operating the pump by reading the ultrasonic sensor.
The pump operates when an object approaches the sensor at a distance of 10 cm or less, If the object is 10 cm away, the pump stops.
2. responsible for reading the water level sensor
Displaying it on the screen, and sending it via Bluetooth to a mobile application, which displays it and indicates any changes in the level, thus indicating water consumption.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int sensorPin = A0;
float maxSensorValue = 1023.0;
float maxLiters = 10.0;
const int trigPin = 7;
const int echoPin = 6;
const int pump = 12;
long readUltrasonicDistance(int triggerPin, int echoPin) {
pinMode(triggerPin, OUTPUT);
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
return pulseIn(echoPin, HIGH);
}
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
pinMode(sensorPin, INPUT);
pinMode(pump, OUTPUT);
Serial.println("System Ready");
}
void loop() {
int sensorValue = analogRead(sensorPin);
float waterLevel = (sensorValue / maxSensorValue) * maxLiters;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Water Level:");
lcd.setCursor(0, 1);
lcd.print(waterLevel, 1);
lcd.print(" L");
Serial.print("Water Level: ");
Serial.print(waterLevel, 1);
Serial.println(" L");
float distance = 0.01723 * readUltrasonicDistance(trigPin, echoPin);
if (distance <= 10) {
digitalWrite(pump, HIGH);
} else {
digitalWrite(pump, LOW);
}
delay(1000);
}
LCD Setup
Screen definition by type and dimensions
Water Level Sensor Setup
Water level sensor connected to A0
Adjust based on calibration
Set this based on the tank capacity
Ultrasonic Sensor & pump
Setup pins ( trigger / echo )
Setup pin (pump )
Function to read ultrasonic distance
Ultrasonic sensors work by sending waves, receiving them again, and calculating the time it takes for them to return, thus determining the distance of the object in front of it.
Inside the ultrasonic there are two actions, one of which is the output, which is the trigger, and the other is the input, which is the echo.
LCD Setup
To read the information inside the Arduino, set the serial print to with value speed for reading it 9600.
Ultrasonic & pump Setup
Define the inputs or outputs in the circuit and their relationship to the Arduino.
Water Level Sensor Code with LCD
Reads water level from the analog sensor (connected to A0).
Converts the sensor reading into liters, based on the tank’s maximum capacity.
Displays the water level on the LCD screen.
Prints the data to the Serial Monitor for debugging.
Updates every second.
Ultrasonic Sensor Code
using if condition for reading ultrasonic
# if distance between sensor and any thing equal or lower than 10 cm, open pin 12 and pump on
# if distance higher than 10 cm, close pin 12 and pump off
The References That Helped Me to Finalizing My Code.
The References for Ultrasonic sensor with pump code from EOWeek Session Exercise week 6
The References for LCD code from EOweek Self-Practice videos week 7
The References for Bluetooth code from EOweek Self-Practice videos week 8
The References for water level sensor code from Arduino Forum website
DEMO VEDIO FOR FINAL RESULT
The first challenge was in the design, as I relied on a streamlined design containing circular shapes and curves.
Implementing this with wood required the use of a technique called Living Hinge. After searching, I came up with a quick and simple method, which is to draw the Living Hinge pattern on AutoCAD and sign it in the curved places in the project.
I faced another challenge, which is the difficulty of making connections between the curved part and the part intersecting with it.
I solved it by connecting the curved part to the complementary face.
I faced another challenge, which is that the length of the face became greater than the available sheet space 50*30 .
I determined a place for the pieces away from the pattern to obtain a strong relationship between the pattern and the rest of the face.
The dimensions of the design exceeded the dimensions of the available sheet, so it became difficult to cut the faces into one piece. To solve this problem, I divided the large faces in a way that would not conflict or harm the design, but it would have been better to stick to the dimensions of the sheet to avoid gaps.
Another challenge I faced when cutting the sides to reinforce the curve was the presence of joints in the sides. I cut squares of welds with two nails from the cutting area to reinforce the joints.
This pattern helped in achieving most of the curves in the project.
But there is a curve that the pattern could not achieve, which is the design of the faucet.
As its curve is very narrow.
I solved this challenge by placing the wood in boiling hot water and leaving it submerged in the water for a minute and trying to bend it to achieve the required curve and clamping it with metal clips for ten minutes in the air to dry the water.
After that, I connected the spacer by welding the wood with two nails.
If I get extra time, I will add an SD card module to the project to store the water level sensor readings and convert them to a chart and store the daily water consumption rate.
I will also display the water consumption rate on the screen and add an audible alarm when the water consumption rate exceeds the normal rate.
I will also link the project to a mobile application that shows the daily water consumption readings with the possibility of using this data to share it as information that can be used to reduce water consumption around the world.
SD card module
Water Turbidity Sensor
water filter
I will also provide the project with two additional tanks for gray water, to which the main tank transfers the water while passing through a filter to reduce the turbidity of this water to ensure that it does not contain harmful substances in the event that this water is used to irrigate plants, with the addition of a sensor that senses the turbidity of the water and gives an alarm in the event that the turbidity rate exceeds the permissible rate and gives instructions to dispose of the water or change the filter