peter morris
Published

Internet of Things Using Tiva LaunchPad

Demonstration of Internet of Things using the Tiva LaunchPad and an ESP8266 WiFi module.

IntermediateProtip73
Internet of Things Using Tiva LaunchPad

Things used in this project

Hardware components

EK-TM4C123GXL TM4C Tiva LaunchPad
Texas Instruments EK-TM4C123GXL TM4C Tiva LaunchPad
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Driver DRV8825 for Stepper Motors for Theremino System
Driver DRV8825 for Stepper Motors for Theremino System
×1
Stepper Motor
Digilent Stepper Motor
×1

Software apps and online services

Code Composer Studio
Texas Instruments Code Composer Studio

Story

Read more

Custom parts and enclosures

IoTCCSCode

Code To be Run on Tiva Launchpad

Schematics

Stepper Motor Driver Connections

Code

MATLAB Code for Controlling motors

MATLAB
MATLAB Code for Controlling motors
%% This code sends commands to the ESP8642 module configured as WiFi Server 
% The module is interfaced with the TivaC Launchpad which is attached to 
% the two sensor modules Viz:- the stepper motor and the servo motor
% Both the motors are controlled through the commands received by the ESP
% module and serviced by the TivaC Launchpad configured as the master controller 
%%
clear all;close all;clc;
%%
%% Address of server
IPAddressOfServer = 'xxx.xxx.xxx.xxx'; %% Insert IP address of server (ESPModule)
PortNumber        = 9999; %% Default Port Number
t = tcpip(IPAddressOfServer,PortNumber,'NetworkRole','client');
fopen(t);
%% Commands to control Stepper Motor
a = 'RotateCW';
b = '';
x = sprintf('%s ',a)
fwrite(t,x)

a = 'RotateCCW';
b = '';
x = sprintf('%s ',a)
fwrite(t,x)
fclose(t);

%% Commands to control Servo Motor (You can replace it with your own commands)

Angle = 30;
a = 'SetAngle';
b = num2str(Angle);
x = sprintf('%s %s ',a,b)
fwrite(t,x)

%% Code for continous rotation of Servo Motor
% for i = 0:20:180
% Angle = i;
% a = 'SetAngle';
% b = num2str(Angle);
% x = sprintf('%s %s ',a,b)
% fwrite(t,x)
% pause(7);
% end
% 
% for i = 180:-20:0
% Angle = i;
% a = 'SetAngle';
% b = num2str(Angle);
% x = sprintf('%s %s ',a,b)
% fwrite(t,x)
% pause(7);
% end
%%

fclose(t);

Credits

peter morris

peter morris

1 project • 0 followers
Thanks to Mark Easley.

Comments

Add projectSign up / Login