Introduction: Android Things Smart Home Automation Using Raspberry Pi and Android

The idea is to design a SMART HOME wherein one can control household devices using Android Things and Raspberry Pi. The project consists of controlling house appliances like lights, fans, motors, etc.

Materials Required:

Raspberry Pi 3

HDMI Cable

Relay

Household devices like Fan, Light bulb Etc.

Supplies

Step 1:

Download and Install Android Studio. Create an account on Android Things Console. Create a product using suitable product setting.

Android Studio: https://developer.android.com/studio/index.html

link for Android Console: https://partner.android.com/things/console/

In the factory image select the latest Android version and click build configuration. In the Build configuration list download the latest build you create. This is the Raspberry Pi image of Andriod Things. Extract the downloaded .zip file to get the image of Android Things.


Step 2:

Download and install two software:

·SD card formatter –used to format SD card·

Win32DiskImager – used to flash image onto SD card

In SD card formatter select the correct SD card location and click on format After formatting open Win32DiskImager select the correct device (sd card location) and correct image and click on write. After the write is successful you have completed flashing the memory card.

Step 3:

Insert the SD card into the card slot in RPi3 and connect to any display using HDMI. Connect the Ethernet Cable from Router to the RPi3. Connect mouse and keyboard to the RPi3 for operations. After the OS boots up you will see the local IP address of the RPi3 being displayed.

Connect the PC to same router and open cmd. Connect to the local IP address of RPi3 using commands :

$ adb connect<ip-Address> connected to <ip-address>:5555

To connect the device to Wifi run the following command :

$ adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid ‘network ssid’ -e passphrase ‘password’

Replace ‘network ssid’ and ‘password’ with your Wifi credentials.

Note: if you have some difficulties running adb command you may have to set the adb path in Environment Variables.

Step 4: Final Step

Open this project using android studio make necessary changes to the code if required.

Click on run and select the RPI3 in connected devices.

If you are unable to see your device then you may need to reconnect it using the command:

$ adb connect <ip-address> connected to <ip-address>:5555

If the run is successful then the application will be displayed on the monitor .