Simple Android App to control Devices On Arduino -Webserver using MIT App Inventor

by Jun 20, 2020arduino uno projects

This is a follow up project which will make use of the Arduino Webserver we build in my last post . (Refer Here).

Introduction:

In this Project we will build a simple Android Applicaton using MIT App Inventor which will be used to turn our device on and off .

CODE:

The entire project code (.aia file) and the .apk file we will make in this post is available at this repository: https://github.com/htgdokania/Arduino_Webserver

So Let’s Begin:

First : Visit MIT app inventor website at : https://appinventor.mit.edu/

  • click on Create Apps!
  • Next, Sign in using your Google Account:
  • Start a new Project:
  • Give a project name and click on OK.
  • First We Add
    • Four Buttons to turn On and OFF our two Devices
    • 1 Text box to enter the Local IP address of the device
    • 1 Label to write the info
  • We also Change the color and Text of these buttons, Text box, and Label from the properties tab.
    • Simply select a component and change its properties as per your desire.
    • Set the Default Text of text box to your Local IP. (We can change this whenever we want in the app.)[Under Properties].In my case it was (“192.168.31.88”).
    • Also, set the Text for the label as shown below. (Your choice)

This is How Our App Looks like when We have completed editing the properties.

  • Now, we add a web component to create HTTP requests when we click our buttons:
    • You will Get this Under Connectivity Tab. (Simply drag and drop it on the phone screen.)

Now We Will See The Logic Part .And join the wires to make the buttons working.

  • So First CLick on Blocks (Located just above properties tab).

Now we create our Block as shown below :

  • What we did was make the logic for 1 button and then simply duplicate it 4 times(For Four different buttons) and modify the URL and button name accordingly.
This is how to duplicate
Change button name and Url text
this is how we can have blocks for button1 and 2 …simply do for button 3,4

This is how our Logic Blocks looks like Once we are done with all the four buttons.

So With this our app is ready, Now Let’s test it first before developing the final Apk.

Fir this We first need to download an This Android application:

Goto Play Store and download MIT AI2 Companion.

Open the MIT AI2 Companion app and click on Connect Tab on Your Project Page and select AI Companion.

Next Scan the QR Code From your mobile camera to Connect.

  • Now You will See Your Project Screen on your Mobile Screen in real-time, and
  • Now you Can test the buttons whether they are working or not.
Test the four buttons and check if they are working.

We can modify anything we want in our project and see the changes in real-time. This Makes working on the app real easy, responsive, and fun at the same time.

Finally once you are happy with the app, Go Ahead and Build the apk file to install in your Android Device.

Simply Go to Build Tab and select either of the two options.

This will compile and soon the QR code will be provided or the Apk file will download as per your selection.

Now simply transfer this file on your android device and install it.

That’s All we need to build Our Very Own Android App in a simple way using MIT -App Inventor.

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

DIY project: Using RGB LED with Blynk

DIY project: Using RGB LED with Blynk

We already have talked about using Blynk with Arduino. In this tutorial, we will make a DIY project using RGB LED with Blynk. We will also control the intensity of it using some special widgets in Blynk. Contents: RGB LED with Blynk IntroductionMaterials...

Using a Seven Segment Display with Arduino

Using a Seven Segment Display with Arduino

Let's learn how to configure a SSD (Seven segment display) with Arduino. You will also learn to make the counter using a single SSD. Contents: IntroductionMaterials RequiredCircuitArduino CodeCode Explanation 1. Introduction The Seven Segment Display has basically 10...

Using Stepper motors with Arduino

In this tutorial, you will learn to configure the stepper motors with the Arduino Uno. https://iot4beginners.com/arduino-uno-a-basic-introduction/ Contents: IntroductionMaterials requiredHardware ExplanationThe circuitArduino CodeA DIY Project's idea 1. Introduction...

DIY Project: Arduino controlled Bluetooth Car

DIY Project: Arduino controlled Bluetooth Car

Let's make a wireless Arduino Controlled Bluetooth car. Contents: IntroductionMaterials RequiredIntegrating the Chassis kitArduino CodeThe Circuit and it's ExplanationConfiguring the Mobile ApplicationThe Final Run 1. Introduction Hey everyone, today we are going to...

How to use Ultrasonic Sensor with Arduino?

How to use Ultrasonic Sensor with Arduino?

Introduction Ultrasonic sensors work by emitting sound waves at a frequency too high for humans to hear. They then wait for the sound to be reflected back, calculating distance based on the time required.  Since ultrasonic waves can reflect off a glass or liquid...

How to use a Servo motor with Arduino?

How to use a Servo motor with Arduino?

Introduction A Servo Motor is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of...

Using IR sensor with Arduino Uno

Using IR sensor with Arduino Uno

Introduction An  IR (Infrared sensor)is an electronic device, that emits in order to sense some aspects of the surroundings. An IR sensor can measure the heat of an object as well as detects the motion. The emitter is simply an IR LED( Light Emitting Diode) and...

Blinking a LED using Arduino Uno

Blinking a LED using Arduino Uno

Blinking a LED is the most basic project in the Arduino. You basically make some easy connections, write the code and upload it in the Arduino. With that, you can control the blinking rate, the duration for which it was glowing and lot more. To know how to install the...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....