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 appliance like Light, Fan, motor etc.
Raspberry Pi 3
household devices like Fan, Light bulb Etc.
Step 1: Setup
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 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.
For more details click here: https://developer.android.com/things/hardware/inde...
Step 2: Flashing the Image Onto Raspberry Pi
Download and install two softwares:
·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: Android Things Setup
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: Deploying the Application on RPi3
Download the simple UI from the samples link:
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 .
Step 5: Finish
Make the circuit diagram as shown in the figure.
Finally with the above steps the project is complete.