Professional Documents
Culture Documents
P R O T E U S
WITH
M I T A P P
I N V E N T O R
CONTROL RELAY CIRCUIT
WHAT IS A RELAY CIRCUIT CREATING THE SIMULATING
CONTROL RELAY? IN PROTEUS APP THE RELAY
INTRODUCTION
After discussing MIT App Inventor, its editor interface, and its application
to the Proteus circuit, we will discuss Relay Control in Proteus using MIT App
Inventor.
STEP 1
STEP 3
STEP 3
Build the Relay Circuit of the light bulb or lamp. Place the
lamp on the Editing Window. Then place the Relay and the
Alternator. The Alternator would power the lamp once the Relay
function.
Build the Relay circuit of the electric motor.
Place the electric motor and the relay switch on
the Editing Window. Since the electric motor is
STEP 4 DC-powered, we need to connect the two pins of
the electric motor to the coil and the switch part
of the switch relay. Once we power the magnetic
coil, the electric motor will run.
STEP 5
Place the Bipolar Transistor STEP 5
below the switch relay. Connect
the lower pin of the switch relay
to the collector pin of the
transistor. Then connect the 10k-
ohm resistor to the base of the
Bipolar Transistor. After that,
link the emitter pin to the
ground terminal, and place a
diode parallel to the relay pins.
Place the Arduino and the Bluetooth HC-05 module on the Editing
Window. Connect the TXD and the RXD pins of the Bluetooth module to the
RXD and TXD module of the Arduino, respectively. Then connect the Pin 5
of Arduino to the resistor of the Lamp circuit while connecting the Pin 6 to
the resistor of the motor circuit.
STEP 1
Go to the MIT
App Inventor website
( http://ai2.appinvent
or.mit.edu/ ). Click
New Project, write
your desired project
name, and click OK.
STEP 2
STEP 3
Add a List Picker on the Viewer. Select List Picker on the User
Interface tab, then drag it on the Viewer. Write “Select Bluetooth
Connection” and edit its properties on the Properties section. This list
picker would allow us to select Bluetooth devices.
STEP 4
STEP 5
Add a label box in the Viewer. The label this box as “LAMP”. Then we
will add two buttons that would serve as the ON and OFF of the lamp
circuit. We can select Horizontal Arrangement box in the Layout tab if we
want these two buttons be aligned horizontally. After adding the
Horizontal Arrangement box, drag the two buttons on it, and then label
them as ON and OFF. Edit their alignments and color in the Properties
section.
Add another label box in the
STEP 6 Viewer. Then label this box as “MOTOR”.
Then we will add another two buttons
that would serve as the ON and OFF of
the motor circuit. We can select
Horizontal Arrangement box in the
Layout tab if we want these two buttons
be aligned horizontally. After adding the
Horizontal Arrangement box, drag the
two buttons on it, and then label them
as ON and OFF. Edit their alignments and
color in the Properties section. After
placing the buttons, add Bluetooth
Client in the viewer.
PROGRAMMING THE APP
STEP 1
STEP 4
Click ListPicker1, then this time, click When ListPicker1.After Picking block.
Drag it in the Viewer. Then click the ListPicker1, click set ListPicker1.Selection
to block, connect it to the When ListPicker1.After Picking block. After that, click
the Bluetooth client, then select call BluetoothClient.Connect/Address and
connect it to the set ListPicker1.Selection to clock. Click ListPicker1, then select
ListPicker1.Selection" and connect it to call BluetoothClient. Connect/Address
block. These blocks would allow the app to pick and call the Bluetooth module
of the Proteus circuit.
STEP 5
Once the app connects to a device, we must make the Disconnect button
or Button 1 visible. This mechanism would allow the app user to disconnect the
device once they finished simulating the Proteus circuit. Click the Logic button
in the Blocks section, and then select the if/then block. Place it before the call
BluetoothClient. Connect/Address block. This block must be connected beside
the "if" part. Then, click Button 1, then select "set Button1.Visible to", then
attach it beside the "then" part of the "if/then" block. Click the Logic in Blocks
section, select True, then connect it beside the set Button1.Visible to block.
STEP 6
Once finished programming the app, click Build then Android App (apk.).
Download the app using the MIT App Companion by scanning the generated
QR code.
PROGRAMMING THE ARDUINO
STEP 1
STEP 2
STEP 4
Verify then compile the Arduino code. Then click Sketch, then
select Export Compiled Library. After that, open the Sketch Folder to
know the file location of the code, which should be in .ino or .hex
format.
STEP 5
After coding, we will now upload our code. First, open your Proteus
circuit, then double-click the Arduino module. Click the folder icon
beside the Program File box. Find the location of the .hex or .ino file of
your Arduino code. Click the file and then click Open, and then OK.
SIMULATING THE CIRCUIT
USING MIT APP INVENTOR
STEP 1
Open the Proteus Relay circuit. Click the Play button on the
lower -left part of the screen.
STEP 2
Turn on the Bluetooth
Connection of the Laptop/PC of
the Proteus circuit. Then, open
the smartphone/device on which
you have downloaded the app.
Open your device's Bluetooth,
then open the app.
Click Select Bluetooth Connection, then click the
discoverable Bluetooth name of the PC/Laptop of the
STEP 3 Proteus circuit. The disconnect button would show up
you have successfully connected.
3. In MIT App Inventor, what is involved in showing the list of available Bluetooth
devices?
a. Button c. List Picker
b. Layout d. Label
Answer:
1. A
2. D
3. C
4. A
5. C
UNIT D 2467 URDANETA RD, MAKATI, METRO
MANILA, PHILIPPINES
erovoutika@gmail.com
+(02)8370 1811
www.facebook.com/erovoutika