Skip to content

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.

Model Construction

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


Fan construction

Fan Printer

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());
  }
}

Materials

Qty Description Price Link Notes
1 Onshape 00.00 $ https://fab.onshape.com/c/signin/test Order many
2 Material eleven 22.00 $ http://amazon.com/test

File Corel Draw

File Arduino

File Ultimaker Cura

Video


Last update: June 18, 2024