0% found this document useful (0 votes)
12 views12 pages

MC Project 1

The document outlines a mini project on a smart switch control system using Arduino Nano and a servo motor, detailing components, circuit connections, Arduino code, and mobile app development. It discusses the working mechanism of the system, future enhancements, and provides an approximation of costs involved in the project. The project aims to integrate smart home technology with potential for IoT connectivity and automation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

MC Project 1

The document outlines a mini project on a smart switch control system using Arduino Nano and a servo motor, detailing components, circuit connections, Arduino code, and mobile app development. It discusses the working mechanism of the system, future enhancements, and provides an approximation of costs involved in the project. The project aims to integrate smart home technology with potential for IoT connectivity and automation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

22EE450 Microcontrollers

EVENT - Mini Project


Submitted by
Chandana S 02JST22UEE015
Dhanyatha C 02JST22UEE019
Shashank K G 02JST22UEE044
Vismaya V Gopal 02JST22UEE059

Concept / Module Report+ Viva Total


working
Marks awarded

Max Marks 15 5 20

Course Instructor
Dr.Sharmila N
Assistant Professor
Department of Electrical and Electronics Engineering
SJCE, JSS STU, Mysuru 06

Department of Electrical and Electronics Engineering


2023-2024
INDEX

SL TOPICS PAGE NO.


NO
1 INTRODUCTION TO THE ARDUINO
NANO
2 WHAT IS A SERVO MOTOR?
3 SWITCH BOT (Smart-Switch Control)
3.1 COMPONENTS USED
3.2 CIRCUIT CONNECTIONS
3.3 ARDUINO CODE
3.4 MOBILE APP
3.5 WORKING
4 FUTURE SCOPE
5 APPROXIMATION COST
6 REFERENCE

1.INTRODUCTION TO ARDUINO NANO BOARD


 Arduino Nano is a small, complete, flexible and breadboard-friendly
Microcontroller board, based on ATmega328p, developed by
Arduino.cc in Italy in 2008 and contains 30 male I/O headers,
configured in a DIP30 style.
 Arduino Nano contains 14 digital pins, 8 analog pins, 2 reset pins &
6 power pins.
 It is programmed using Arduino IDE, which can be downloaded from
the Arduino Official site.
 Arduino Nano is simply a smaller version of Arduino UNO, thus both
have almost the same functionalities. It comes with an operating
voltage of 5V, however, the input voltage can vary from 7 to 12V.
 Arduino Nano's maximum current rating is 40mA, so the load
attached to its pins shouldn't draw a current more than that.
 Each of these Digital & Analog Pins is assigned with multiple
functions but their main function is to be configured as Input/Output.
 Arduino Pins are acted as Input Pins when they are interfaced with
sensors, but if you are driving some load then we need to use them as
an Output Pin.
 Functions like pinMode() and digitalWrite() are used to control the
operations of digital pins while analogRead() is used to control analog
pins.
 Arduino Nano comes with a crystal oscillator of frequency 16 MHz.
 There is one limitation of using Arduino Nano i.e. it doesn't come with
a DC power jack, which means you cannot supply an external power
source through a battery.
 This board doesn't use standard USB for connection with a computer,
instead, it comes with Type-B Micro USB.
 The tiny size and breadboard-friendly nature make this device an ideal
choice for most applications where the size of the electronic
components is of great concern.
 Flash memory is 16KB or 32KB that all depends on the Atmega board
i.e. Atmega168 comes with 16KB of flash memory while Atmega328
comes with a flash memory of 32KB. Flash memory is used for
storing code. The 2KB of memory out of total flash memory is used
for a bootloader.
 The SRAM memory of 2KB is present in Arduino Nano.
 Arduino Nano has an EEPROM memory of 1KB.
2.WHAT IS A SERVO MOTOR?
A servo motor usually includes a simple DC motor but it has a gear wheel
system. Also, the servo motor includes a sensor system for measuring gear
wheel rotation. So, we can rotate it to the desired degrees. Usually, the servo
motor can rotate from 0 to 180 degrees. These servo motors are mainly used to
make robotic arms. These servo motors can be rotated by the PWM signal on
the Arduino board. You can use PWM pins on the Arduino board for that. The
servo motor consists of three wires. The wire colours are orange, red, and
brown. The red and brown wires are used to power the servo motor. The orange
wire is used to rotate the servo motor to the required number of degrees. We can
use a PWM signal for this purpose. These points are common to all servo
motors.

3.SWITCH BOT (Smart-Switch Control)


3.1 COMPONENTS USED:
 Arduino nano: The microcontroller that processes Bluetooth commands
and controls the servo motor.
 Servo motor: Mechanically toggles the switch by rotating to specific
angles.
 HC-05 Bluetooth module: For wireless communication between the
Arduino and the mobile application.
 4 AA battery holder: To power up the servo motor.
 Breadboard
 Jumper wires (Male-Male and Male-Female)
 9V Battery (external source): To power up the system.

3.2 CIRCUIT CONNECTIONS:

Fig. Block Diagram

SERVO MOTOR:
 Signal pin to digital pin D9 of the Arduino Nano.
 Power (VCC) to 6V of supply (4 AA battery).
 Ground (GND) to GND of the Arduino Nano.
HC-05 BLUETOOTH MODULE:
 VCC to 5V of the Arduino Nano.
 GND to GND of the Arduino Nano.
 TX to RX Pin of the Arduino Nano.
 RX to TX Pin of the Arduino Nano.
EXTERNAL POWER SUPPLY (9V BATTERY):
 Positive terminal to VIN of the Arduino Nano.
 Negative terminal to GND of the Arduino Nano.

3.3 ARDUINO CODE:

#include <Servo.h> //Including the Servo library


Servo s1; // create servo object to control a servo
int lastpos = 0;//Variable to keep track of the last position of the servo
int onpos = 78;//Position to turn the servo ON(78 degree rotation)
int offpos = 12;//Position to turn the servo OFF(22 degree rotation)
char bluetoothInput = 0;//Variable to store the incoming Bluetooth data
void setup()
{
s1.attach(9); // Attache the servo on pin 9 to the servo object
Serial.begin(9600); // Initialize serial communication at 9600 bits per second
}
void loop()
{
if (Serial.available() > 0) //Check if there is any data available from the
Bluetooth module
{
bluetoothInput = Serial.read(); // Read the incoming data from Bluetooth

// Using logical AND operation to determine the servo position


if (bluetoothInput == '1' && lastpos != onpos)
{
turnSwitchOn();//Calling the function to turn ON the switch
lastpos = onpos;//Update last position to ON position
}
else if (bluetoothInput == '0' && lastpos != offpos)
{
turnSwitchOff();//Calling the function to turn OFF the switch
lastpos = offpos;//Update last position to OFF position
}
}
}
void turnSwitchOn()
{
s1.write(onpos); // set servo to ON position
delay(15); // wait for servo to reach position
}
void turnSwitchOff()
{
s1.write(offpos); // set servo to OFF position
delay(15); // wait for servo to reach position
}

3.4 MOBILE APP:


1.Set Up MIT App Inventor:
Step 1: Open a web browser and go to the MIT App Inventor website.
Step 2: Click on "Create Apps!" and log in with your Google account.
2.Create a New Project:
Step 3: Click on "Start New Project" and give your project a name.
3.Design the User Interface:
Step 4: Drag and drop the following components onto the screen
4.Configure components:
Step 5: Rename the components and set text for buttons and labels
5.Programming the App:
Step 6: Implement the Bluetooth connections and send commands to the
Arduino
6.Install App:
Step 7: Build the APK and install the app on your smartphone using MIT AI2
Companion app

Fig. Logic Behind the App


Fig. Installing the App

Fig. Installing the App


Fig. App Interface

3.5 WORKING:
The smart switch control system operates by initializing the Arduino Nano,
which sets up the servo motor and establishes serial communication with the
HC-05 Bluetooth module. The user opens the mobile application developed in
MIT App Inventor, scans for available Bluetooth devices, and connects to the
HC-05 module. Upon successful connection, the user can press the "ON" or
"OFF" button on the app, which sends the corresponding command ('1' for ON,
'0' for OFF) to the Arduino via Bluetooth. The Arduino processes the command
and rotates the servo motor to the specified position (78 degrees for ON, 12
degrees for OFF), mechanically toggling the switch, turning the connected
device on or off.
4.FUTURE SCOPE

 Smart Home Platforms: Integrate the smart switch with popular home
automation platforms such as Google Home, Amazon Alexa, or Apple
HomeKit to allow voice control and automation routines.
 Expand to Multiple Switches: Scale the project to control multiple
switches from a single controller.
 IoT Ecosystem: Connect the smart switch to an IoT ecosystem using
platforms like MQTT or Blynk for remote control and monitoring
through cloud services.
 Implement features that turn off devices when not in use, contributing to
energy savings and cost reduction.
 Mobile App Enhancements: Improve the mobile app's user interface by
adding features like real-time status updates, scheduling options, and
customizable control panels.
5.APPROXIMATION COST:

SERIAL PARTICULARS QUANTITY AMOUNT


NO.
1 Arduino Nano 1 300rs
2 Nano Cable 1 50rs
3 Bread Board 1 60rs
4 Servo Motor 1 130rs
5 Jump Wires 7 10rs
6 HC05 Bluetooth 1 300rs
7 9V Battery 1 20rs
8 Connector 1 8rs
9 AA Holder 4 Cell 1 30rs
10 Power Battery 4 84rs

TOTAL: 1002rs

6.REFERENCE
 https://www.theengineeringprojects.com/2018/06/introduction-to-
arduino-nano.html
 https://appinventor.mit.edu/
 https://www.arduino.cc/en/software
 https://www.google.com/url?
sa=t&source=web&rct=j&opi=89978449&url=https://openai.com/blog/
chatgpt/
&ved=2ahUKEwiAiOGulqKHAxVYTWwGHVGpDUMQFnoECAYQA
Q&usg=AOvVaw07ciM_LkSe6efpFVXLmYhu

You might also like