Final Project¶
While in a very spacious restaurant, I realized that the ambient lights were off and the control was located at one end of the room, so I thought about how easy it could be to control the on or off from your own cell phone. That’s where the first idea of this project was born, then we could apply it at home, business, or others.
My project is about a control on and off of led lamps in a room by remote control. Also in room fan speed control according to the ambient temperature. This will also be controlled by a cell phone application. I will use 3d modeling for remote control, arduino for Bluetooth control of lights and fan speed.
Project map in mind, subject to minor changes.
The BlueConnect Home¶
This project is easy to use and allows the user in the house to control from a cell phone the turning on and off of two lamps in different rooms of a house up to thirty meters via Bluetooth connection.
With a future projection of implementing housing that integrates different technologies to control security systems, energy systems or communications, among others, to provide greater comfort and efficiency.
BlueConnect Home Q&A¶
- What will it do?
- Project Benefits
- Who has done what beforehand?
- What will you design?
- What materials and components will be used?
- Where will they come from?
- How much will they cost?
- What parts and systems will be made?
- What questions need to be answered?
- How will it be evaluated?
- Have you answered these questions?
- What tasks are pending?
- What has worked? What hasn’t?
- What questions need to be answered?
- What have you learned?
- What processes were used?
What will it do?¶
In today’s digital age, home automation has become a necessity to improve comfort, energy efficiency and security. This project proposes the development of an automation system that allows users to control two lamps and a fan in a home using a mobile application. The implementation of this system not only offers comfort, but also contributes to energy savings and efficient resource management. Developing a mobile application allows remote control of the on and off of two lamps and a fan in a home. The system is easy to use, reliable and secure, providing users with the ability to manage their home environment efficiently.
Project Benefits:¶
Convenience and Ease of Use: Allows users to control the lamps and fan without needing to be physically present.
Energy Saving: Users can turn off the lamps and fan when not needed, reducing electricity consumption.
Security: It allows you to simulate the presence in the home by turning the lights on and off, deterring possible intruders.
Flexibility: The ability to program on and off times adds an additional level of customization and convenience.
Who has done what beforehand?¶
Searching for similar projects in the fab academy I found the following: In previous years, several Fab Academy students worked on what inspired my final project.
Año 2020 | Autor Luis | Web site
In this project I expand my knowledge in the use of the app inventor application
Año 2018 | Autor Kerala | Web site
In this project I got more ideas on how to connect a sensor and control it from an application
Año 2017 | Autor WIM LANZ | Web site
Here I got more ideas about the connectivity between the Arduino program and the mobile application
Año 2017 | Autor Mohammad Al-Matori | Web site
Here more information about block logic in app inventor
What will you design?¶
- Structure: The structure of a house was designed that would serve to simulate the turning on and off of the lamps and the fan, a design made in 2D.
- Fan: Designed in 3D with additive and subtractive processes.
- Motor box: Design made in 2d to rotate the fan.
- Exterior decorations: 2D design done in a previous task
- Electronics: The Fab&Plant PCB for the system to work.
- Programming: Programming the XIAO SP32 C3
What materials and components will be used?¶
- House prototype, designed in the online software onshape and then laser cut in MDF material
- Use as decoration at the entrance of the house prototype material cut in MDF in a previous task where I used parametric measurements.
- Use connection cables
- Use blue and green LEDs in the prototype of the rooms inside and outside.
- Use PLA material for printing the fan that was placed inside the prototype.
- Use XIAO ESP32 C3 microcontroller
- Use copper-coated bakelite PCB material for the design of the printed circuit and subsequent milling where the components will go
- Use a smart phone to install the app that would control the turning on of the lights and the rotation of the fan.
- A 3-volt motor to activate or deactivate the fan
Where will they come from?¶
MDF or as its acronym indicates, stands for medium density fibreboard. I had to buy this material in the city of Huancayo, Peru.
PLA filament, polylactic acid, is a thermoplastic made from renewable resources such as corn starch, tapioca roots or sugar cane. I used this material from the digital manufacturing laboratory
Electronic components
- 3 volt DC motor. I had to buy this electronic component on the market
- XIAO ESP32 C3 microcontroller. We had to order this microcontroller to be sent from the United States.
- Blue and green smd LED. This electronic component is used in the Digital Manufacturing Laboratory
How much will they cost?¶
What parts and systems will be made?¶
- Design and laser cutting of the house prototype
- Details of a house at the entrance of the house
- Box where the DC motor will be
- Design of the PCB board
- It will be programmed in Arduino code
- Programming of the application in App Inventor
What processes were used?¶
- Computer-aided design of prototype parts
- Computer-controlled laser cutting
- 3D printing of the fan
- Electronic design of the PCB board
- Electronic production in codes for milling
- Embedded programming in Arduino and AppInventor
- Computer controlled machining
- Output devices in the LEDs and fan
- Input devices via Bluetooth signal from a cell phone
- Programming of interfaces and applications
What questions need to be answered?¶
- From what distance can I control the on and off of a lamp and a fan?
- Will there be any electronic signal that interferes with the Bluetooth signal?
- From which mobile devices can I install the application made in App Inventor?
How will it be evaluated?¶
- From what distance is the Bluetooth signal effective for controlling output devices?
- How much power does the application open from the cell phone and the microcontroller on with the Bluetooth signal consume?
Have you answered these questions?¶
What tasks have been completed?
I have completed all the necessary tasks to ensure the prototype of my final project works.
What tasks are pending?¶
I need to finish the slide and video for my final presentation, as well as the documentation on my final project page.
What has worked? What hasn’t?¶
The electronic circuit didn’t work for me because of a crossed LED I had to print the fan design three times What worked was the programming in arduino after researching wireless communication protocols The communication code in appinventor also worked.
What questions need to be answered?¶
Does The BlueConnect Home effectively communicate the need well?
How long does it take until The BlueConnect Home is ready to work from connecting power to the microcontroller?
What have you learned?¶
During the completion of my final project I have learned many things, from design, laser cutting, electronics and programming, I am pleased with everything I have learned.
Web Site¶
Summary Web site
Design¶
In today’s digital age, home automation has become a necessity to improve comfort, energy efficiency and security. This project proposes the development of an automation system that allows users to control two lamps and a fan in a home using a mobile application. The implementation of this system not only offers comfort, but also contributes to energy savings and efficient resource management. Developing a mobile application allows remote control of the on and off of two lamps and a fan in a home. The system is easy to use, reliable and secure, providing users with the ability to manage their home environment efficiently.
Final Design¶
The design of a prototype of a house where the connectivity of two lamps and a fan is simulated, controlled by an application from a cell phone to turn the light and the fan on or off.
The prototype design¶
Complete view of the design developed in Corel Draw of the pieces to be assembled for the final project
View of the fan container design
View of the design of the sides of the prototype
View of the prototype entrance door design
View of the prototype base design
Design of the back of a house simulation
Location of the pieces to begin the laser cutting with the measurements established in the cutting and engraving image
Location of the parts that will contain the fan
Organization of engraving and cutting in the CNC Laser program
Engraving setup on top of prototype
Cut Laser (step to step)¶
We observe the laser cutting of face one of the house prototype with speed 80 and power 100
We observe the laser cutting of the second side of the house prototype with speed 80 and power 100
Assembling the cut pieces on the base
Observing how the assembly of the prototype parts is going to be used in the simulation of my final project
Completing the assembly of the prototype parts to be used in the simulation of my final project with snap joints
Completing the assembly of 90% of the prototype parts to be used in the simulation of my final project with pressure joints
Placing the housing cover with the laser engraving FAB LAB PERU
Completing the placement of the decorations at the entrance of the house and finishing the assembly
Cut Laser box¶
Box that will contain the board with the microcontroller circuit
Checking the fit of the parts of what will become the main controller of the project
Parts of the box that will contain the DC motor
Assembled box joining the motor to the fan
Fan construction¶
Starting sketch 1 of the fan design with a circle
Applying extrusion to the circle as observed
Verifying that the work is being developed based on the metric unit of millimeters
Choosing sketch 2 for the beginning of the propeller development
Applying the diameter of the circle
Applying isometry to the object
Choosing the middle part of the extruded object to start the helix
Choosing the helix option using cylinder surface
Applying extrusion with the parameters indicated in the figure
Applying new extrusion values of 7 millimeters and revolution 0.5
Applying the value of 20 millimeters to what was defined
Previewing the first simulation of the Propeller One
Applying the 1 millimeter edge to the propeller one or in other words the thickness
Removing the terminal edges of the propeller using the radius option
Applying the option of completing 3 similar figures along a 360 degree turn
Applying a diameter of 2 millimeters to the hole in the design to place the motor shaft with a depth of 12 millimeters
Fan Printer¶
Once the 3D printing of the fan with a 65 degree bed and a 240 degree extruder has begun.
Finishing the 3d printing of the fan after 45 minutes
Once the printing is finished on the equipment bed, the finished product can be observed.
Prototype, finished circuit¶
We can see on the prototype of the house the circuit with the microcontroller to turn on and off two lamps and a fan.
Code for microcontroller¶
#include <ArduinoBLE.h>
BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service
// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1215", BLERead | BLEWrite);
const int LED1 = 2;
const int LED2 = 3;
const int Relay3 = 4;
const int Relay4 = 5;
int Rvalue; // received value from Bluetooth Application
void setup() {
Serial.begin(9600); //Baudrate
// Set all the Relays as output
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
// begin initialization
if (!BLE.begin()) {
Serial.println("starting Bluetooth® Low Energy module failed!");
while (1);
}
// set advertised local name and service UUID:
BLE.setLocalName("Bluetooth ESP"); // this will appear in the App search result.
BLE.setAdvertisedService(ledService);
// add the characteristic to the service
ledService.addCharacteristic(switchCharacteristic);
// add service
BLE.addService(ledService);
// set the initial value for the characeristic:
switchCharacteristic.writeValue(0);
// start advertising
BLE.advertise();
Serial.println("BLE LED Peripheral");
}
void loop() {
// listen for Bluetooth® Low Energy peripherals to connect:
BLEDevice central = BLE.central();
// if a central is connected to peripheral:
if (central) {
Serial.print("Connected to central: ");
// print the central's MAC address:
Serial.println(central.address());
while (central.connected()) {
if (switchCharacteristic.written()) {
Rvalue=switchCharacteristic.value(); // received value is stored in variable Rvalue.
// we check the received commands and then accordingly control
// all the relays.
if (Rvalue==0) {
Serial.println(switchCharacteristic.value() );
Serial.println("LED1 OFF");
digitalWrite(LED1, LOW); // changed from HIGH to LOW
}
else if(Rvalue==1){
Serial.println(F("LED1 ON"));
digitalWrite(LED1, HIGH); // changed from LOW to HIGH
}
else if (Rvalue==2) {
Serial.println(switchCharacteristic.value() );
Serial.println("LED2 OFF");
digitalWrite(LED2, LOW); // changed from HIGH to LOW
}
else if(Rvalue==3){
Serial.println(F("LED2 ON"));
digitalWrite(LED2, HIGH); // changed from LOW to HIGH
}
else if (Rvalue==4) {
Serial.println(switchCharacteristic.value() );
Serial.println("Relay3 OFF");
digitalWrite(Relay3, LOW); // changed from HIGH to LOW
}
else if(Rvalue==5){
Serial.println(F("Relay3 ON"));
digitalWrite(Relay3, HIGH); // changed from LOW to HIGH
}
if (Rvalue==6) {
Serial.println(switchCharacteristic.value() );
Serial.println("Relay4 OFF");
digitalWrite(Relay4, LOW); // changed from HIGH to LOW
} else if(Rvalue==7){
Serial.println(F("Relay4 ON"));
digitalWrite(Relay4, HIGH); // changed from LOW to HIGH
}
}
}
// when the central disconnects, print it out:
Serial.print(F("Disconnected from central: "));
Serial.println(central.address());
}
}
Integration of the final product¶
Useful links Files¶
File Corel Draw
File Arduino
File Ultimaker Cura
Files Fan