Arduino Smart Home Overview PDF

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Summary

This document provides an overview of smart homes. It explains the basic concepts and components. It also covers the building and programming process using Arduino, including a step-by-step guide with diagrams for constructing a smart home model.

Full Transcript

1. Learn About Smart Home Overview Teach Discussion 1 What is a Smart Home? A smart home is based on the residential platform. It uses the generic cabling technology, network communication technology, security technology, automatic control technology, and audio and video technology to integra...

1. Learn About Smart Home Overview Teach Discussion 1 What is a Smart Home? A smart home is based on the residential platform. It uses the generic cabling technology, network communication technology, security technology, automatic control technology, and audio and video technology to integrate the equipment related to homelife. It constructs an efficient management system for residential facilities to improve safety, convenience, comfort, and artistry in homes. Advantages of a Smart Home Intellectualization Furniture has changed from passive static structure to active intelligent tool. PRINT Informatization It provides a full range of information exchange functions to help families exchange information smoothly with the outside world. Humanization A smart home emphasizes the coordination between people and its living environment; users can control their indoor living environment at will. Energy-saving It can turn on and off the power and sleep mode of household appliances with one press of a key, thus saving power. A smart home produced in this course is realized by using Arduino open-source hardware, sensor module, and programming and laser-cutting technology. Its purpose is to make the readers understand the characteristics and principles of sensors, learn Arduino programming, and use sensors to realize the intelligent automation of home equipment, giving them a deeper understanding of the characteristics and scene applications of a smart home. Using all kinds of sensors also makes them realize the intellectualization of living home equipment, which makes people’s lives safer and more convenient. Downloadables Welcome to smart home Activity 1 Demonstration of Steps for Building a Smart Home Model 1. Assemble the front and left side of the house, as shown in Figure 1.1. PRINT 2. Attach the right side of the house, as shown in Figure 1.2. 3. Attach the back of the house, as shown in Figure 1.3. 4. Attach the floor to the assembled house, as shown in Figure 1.4. PRINT 5. Attach the beam to the assembled house, as shown in Figure 1.5. 6. Finally, attach the roof to the assembled house, as shown in Figure 1.6. PRINT Note: The assembly of sensors and other hardware is shown in later chapters of the course. Due to the limited pins of Arduino, the sensors in the kit cannot be fully connected, so the experimental example of the course is operated according to a separate experiment. However, you can choose to combine three cases. When connecting hardware and programming, take note that the sensors cannot be reused, meaning one pin cannot connect different sensors at the same time. Discussion 2 The Arduino Mainboard The Arduino control board is a revolutionary product based on Bluetooth 4.0 protocol and perfect combination of Arduino UNO R3. The functions and pins are fully compatible with the traditional Arduino UNO mainboard. The operating frequency band is 2.4GHZ, the modulation mode is GFSK, the maximum transmitting powerPRINTis 0dB, and the maximum transmitting distance is 50m. It is designed with imported original TI CC2540 chip, and supports users to modify and view the device name, service UUID, transmit power, pairing password, and other instructions at command, making it convenient, fast, and flexible. The product is small and suitable for many applications with strict volume restrictions. The mobile demo for Android and iOS are provided, which you can use to quickly develop a mobile communication hardware device. You can use Arduino to connect to Bluetooth 4.0 devices, and realize wireless transmission between two Bluetooth devices, and master and slave settings. It even has a Bluetooth HID connection to a PC, providing freedom and support preparation for developers. Users not only can configure Arduino at command, but also add Arduino compatible expansion board, sensor, motor, and steering gear driver to the Arduino controller. Technical Specifications: It is fully compatible with Arduino UNO R3 pins and usage. Chip: TI CC2540 Working Channel: 2.4G Transmission Distance: 50m Support at command configuration Supports USB virtual serial port, hardware serial port, and three-way transmission Supports master-slave switching Supports Bluetooth automatic connection to slave in host mode Supports more than 20-byte sending Interface: Micro-USB Input Voltage: USB power supply, VIN6~12V Microprocessor: ATmega328PU Bootloader: Arduino V1.8.8 Dimensions: 68.6mm x 53.4mm x 12mm Weight: 25g Parameter Description: Power indicator: When Arduino is powered on, the light will turn on. The link label in blue light is the Bluetooth and power indicator. When the Bluetooth is not connected, the blue light will light up. When the Bluetooth connection is successful, the blue light will remain lit up. The L label in orange light is the BootLoader identification indicator. With the computer connected through USB, the LED light will light up quickly when the port recognizes the board. The LED is connected to pin 13 of Arduino through a special circuit. When pin 13 is in high level or high-resistance state, the LED will light up. When it is in low level, it will be off. The LED can be turned on or off by program or external input signal. Note: When the USB cable is connected successfully, the link label in blue light will light up, and the L label in orange light will light up several times. If only the link label in blue light lights up after connecting the USB cable, and the L label in orange light does not respond, it means that the USB micro cable is broken and needs to be replaced. PRINT The LED light of the RX identification is the serial port receiving indicator. When the serial port receives data, the LED light will light up. The LED light marked with TX is the serial port sending indicator light. When the serial port sends data, the LED light will light up. Serial: 0 (Rx) and 1 (TX) are used to receive and send serial data. These two pins are connected to the ATmega16U2 chip to communicate with the computer through the serial port. External Interrupt: Serials 2 and 3 can input external interrupt signals. Interrupt has four trigger modes: low- level trigger, level-change trigger, rising-edge trigger, and falling-edge trigger. PWM Output: 3, 5, 6, 9, 10, and 11 (marked with silk screen) can be used to output an 8-bit PWM wave. Its corresponding function is analogwrite(). SPI: pin 10 (SS), pin 11 (MoSi), pin 12 (MISO), and pin 13 (SCK) can be used for communication. You can use the official SPI library (SPI.h) to make this function. L-LED: Pin 13 is connected to an LED. When the output of the pin is high, the LED will turn on. When the output of the pin is low, the LED will turn off. TWI: A4 (SDA), A5 (SCL), and TWI interface can be used for TWI communication. They are compatible with I²C communication and can be manipulated with the official wire library. Arduino UNO has 6 analog input pins, which can be used to read analog values by using the function analogread(). Each analog input has a 10-bit resolution (i.e. 1024 different values). By default, the range of an analog input voltage is 0 ~ 5V. REF can be used to introduce analog. The reference function sets other reference voltages. AREF: Analog input reference voltage input pin. Reset: Reset port. If the low-level is connected, Arduino will reset. When the reset key is pressed, the port will connect to the low-level, resetting the Arduino. Vin: Power input pin can output power supply voltage when using external power supply to supply power through a DC power socket. 5V: 5V power supply pin. When using a USB power supply, the 5V voltage provided by the USB is directly outputted. When using an external power supply, the 5V voltage after voltage stabilization is outputted. 3V3: 3.3V power supply pin. The maximum output capacity is 50mA. GND: Ground pin IOREF: I/O Reference voltage. Other devices can identify the development board I/O reference voltage through this pin. Activity 2 Arduino IDE Arduino IDE is the software-editing environment of Arduino products that is used to write and download codes. Any Arduino product needs to download the code for it to work. Download and Installation of Arduino IDE Open the link to Arduino’s official website: https://www.arduino.cc/en/software. The website’s download interface, as shown in Figure 1.7, shows the different versions and running environments of IDE, which you can download based on your computer’s operating system (OS). PRINT After downloading, we will get the compressed package as shown in Figure 1.8. Figure 1.8 Arduino IDE Installation Package Figure 1.9 Decompressed file Decompress the package to show the files, as shown in Figure 1.9. Double-click on arduino.exe to automatically install it in your computer system. It is recommended to exit any antivirus software before installation to avoid affecting the IDE installation. After the installation, click on arduino.exe again to enter the IDE programming interface. Connect the Arduino mainboard to the computer and then right-click on My Computer ▶ Properties ▶ Device Manager to view the Ports (COM & LPT), as shown in Figure 1.10. PRINT Figure 1.10 Successful driver installation After successfully installing the driver, open the IDE and select the corresponding development board model and port from the toolbar. If it appears as shown in Figure 1.11, it means that the computer does not recognize the development board and you need to install the driver again. PRINT Figure 1.11 Failed driver installation Driver Installation Steps for Windows System Driver Installation: 1. Right-click on My Computer and open the Device Manager to view the Ports (COM & LPT). Then, right-click on Arduino UNO (COM) and select Update driver. PRINT 2. In the dialog box that will appear, select Browse my computer for drivers. PRINT Finally, locate and select the “drivers” folder. Go to Documents then select drivers, click OK. PRINT PRINT Figure 1.15 3. A message will appear, informing you that the driver was successfully installed. Figure 1.16 PRINT Return to the Device Manager. See that Arduino has been successfully recognized by the computer, as shown in Figure 1.17. Next, open the Arduino compilation environment to start using Arduino. Note: In Windows 10 system, after some Arduino are connected to the computer (not genuine chips are difficult to identify), the system will automatically download the corresponding driver without installing the driver itself. However, in Windows 7 system, the driver needs to be installed manually following the process discussed. As shown in Figure 1.17, the USB serial port is identified as COM5. The rest may have COM4, COM6, etc., but Arduino UNO must be the same. If the USB serial port is not found, you may have installed it incorrectly or the system drivers are not updated. PRINT Discussion 3 Manual Installation of Libraries Open the File Explorer and go to Documents ▶ Arduino ▶ libraries. Create a new folder named “Smart_Home”. Download all the library files and paste them inside the “Smart_Home” folder. PRINT Note: For the libraries to be read by the Arduino software, you need to close the software and then open it again. Discussion 4 Introduction to the Arduino IDE Interface Open Arduino IDE. The toolbar contains the following functions, as shown in Figure 1.18: A. Verify B. Upload C. New D. Open E. Save F. Serial Monitor PRINT Figure 1.18 Arduino IDE Interface Open the “examples” folder to view some sample programs that come with Arduino IDE. These programs are compiled correctly and can be helpful for beginners. Other sample programs are found under File ▶ Examples. Activity 3 Write “Welcome” on the Smart Home Program 1. Connect the Arduino to the computer through USB. 2. Open the programming software you want to use and input the corresponding sample program, as shown in Figure 1.19. Arduino IDE Program PRINT void setup() { Serial.begin(9600); } void loop(){ Serial.println("Welcome to smart home"); delay(500); } Figure 1.19 Sample program 3. After uploading the program, open the Serial Monitor. Notice the “Welcome to smart home” printed on the screen, as shown in Figure 1.20. Figure 1.20 Serial port printing Welcome_to_smart_home.zip PRINT - Jump to... 2. Intelligent Human Body Induction Lamp ► © 2023 | Technokids Philippines You are logged in as Michelle Villa (Log out) Arduino TERMS AND CONDITIONS PRIVACY POLICY PRINT

Use Quizgecko on...
Browser
Browser