------------------------------------------------------------------------------------------------------------------------------------------
Mounting ESPresso Lite V2 on Mobile Robots
Part 1: Introducing ESPresso to DWAD Robotics Team
I was given two days to collaborate and let my team mates help me and learn together using
ESPresso Lite V2.
Our problem was to connect a motor driver on espresso while having sensors on it;
We have :
1.2A dual H bridge Motor Driver from DFrobot
2.INEX 3.5 v IR line tracing sensor
The pictures shows the process upon learning the board.
Familiarizing ourselves with the diagram and pinouts of ESPresso Lite v2.
1st Phase :The first 3 pictures shows the exposure of our coach Mr. Yuri Rancudo MIT. And my team
mate Lance Taron. With lance taron working with the breadboard I showed them the diagram and pinouts
of the ESPresso which is relatively similar to Arduino. I shared my knowledge about the the board
specifically on how does ESPresso works with a IR sensor. The first tas was to connect them to the pins
A0,GND,VCC and they are as follows
RED – VCC
BLACK – GND
WHITE – A0/Signal *Color coding may vary depending on the sensor model, for this particular sensor we’ve used a 3.5v ir line tracing sensor from
INEX.
------------------------------------------------------------------------------------------------------------------------------------------
2nd
Phase: After the basic connections, we are now ready to take a look at some more specific
information about ESPresso such as its capability, its internal specs and the like. So the pictures above are
the actual shots while my teammates are looking for examples and references on the internet.
-------------------------------------------------------------------------------------------------------------------------------
Part 2: Troubleshooting
The activities were:
1.Identify the ports and parts of espresso
2.looking for PWM pins for motor use
3. Integrate Motor Driver on ESPresso Lite V2
Problem Encountered:
My team mates were not able to locate the ports and pins. So we
consulted sir yuri for additional help. So we were having a trial and error
stage in order for us to figure out the solution.
------------------------------------------------------------------------------------------------------------------------------------------
Part 3: Setting Up wirings
The picture above is the set wirings for the ESPresso and the 2A Motor driver. We connected
E1,M1,E2,M2 to pins 04 01 03 05 Respectively. The power source came from a usb cable connected to a
laptop. We still did not connect any power supply to power the motor driver for safety purposes due to
high peak of Voltage and Electric current rate.
------------------------------------------------------------------------------------------------------------------------------------------
Meanwhile this is what we call the tracker bot in which we mounted the ESPresso Lite V2. Why did we
chose to mount the board on the tracker? Well, because of the primary concern about power consumption.
We all know that espresso is not built for mobile use but for IOT uses rather.We have 2pc 3V DC motors
that are suitable for the power supply of the board.
Mobile Platform comparison:
Specs ATX2 ESPresso Lite V2
Motor Shield Built in 1.2 A L298N Chip N/A
Operating Voltage 6 – 9 V 3 – 6 V
Motor Ports: 6 N/A
------------------------------------------------------------------------------------------------------------------------------------------
The ATX2 Has the advantage on the mobile platform because of it’s integrated peripherals. But with the
help of extensions such as motor drivers we look forward to make the ESPresso work on mobile robots.
So we connected a motor driver on the ESPresso for the dc motors connected.
Materials Used were all the same for us to see the difference with their board difference
Motor Used: DC motor 3v 800 RPM
Constant speed coded in Arduino: 20% of Full power
Delay before start: 5 seconds
Movement Duration 2 Seconds
Power Supply: 6V Double AA (fully charged)
Basic Movement Comparison Activity 1
Movement ATX2 ESPresso Lite V2
Forward 37cm 15cm
Backward 37 cm 15 cm
Left Turn (pivot) 3 Rotations 1 rotation
Righ Turn (pivot) 3 Rotations 1 rotation
Robot Reaction When IR sensor Detects black colored surface Activity 2
The robot is programmed to move backward for 2 seconds and Turn Left for 2 seconds.Both boards are to
compared based on how many seconds did it take to complete the set of movements coded.
Movement ATX2 ESPresso Lite V2
Initial Position from the black
surface :
10 cm 10cm
Time consumed after the start of
the robot
4.45 seconds 10.3 seconds
Codes in ATX2
Sample code for ATX2 Basic Movements.
------------------------------------------------------------------------------------------------------------------------------------------
Code in ESPresso Lite V2 for basic movements
#include <ATX2.h> // ATX2 Board library
void setup() {
XIO(); // ATX2 initialize
OK(); //wait for ok button
delay(5000); //5 seconds delay before start
}
void loop() {
motor(12,20) //robot moves forward
delay(200); // 2 seconds duration
motor(12-200); // robot moves backward
delay(200); //delay for two seconds
motor(1,20); // pivot turn left
motor(2,-20); // pivot turn left
delay(200); // 2 seconds duration
motor(1,-20); // pivot turn right
motor(2,20);// pivot turn right
delay(200); // 2 seconds duration
}
}
------------------------------------------------------------------------------------------------------------------------------------------
int E1 = 5;
int M1 = 4;
int E2 = 6;
int M2 = 7;
void setup(){
}
void advance(char a,char b) //Move forward
{
analogWrite (E1,a); //PWM Speed Control
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void back_off (char a,char b) //Move backward
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void turn_L (char a,char b) //Turn Left
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void turn_R (char a,char b) //Turn Right
{
analogWrite (E1,a);
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void loop() {
advance(50,50);
delay(2000);
back_off(50,50);
delay(2000);
trn_L(50,50);
delay(2000);
turn_R(50,50
delay(2000);
}}
------------------------------------------------------------------------------------------------------------------------------------------
#include <ATX2.h> // ATX2 Board library
void setup() {
XIO(); // ATX2 initialize
OK(); //wait for ok button
delay(5000); //5 seconds delay before start
}
motor(12,20);
void loop() {
if(analogRead(0)>300){ // if sensor detects black surface
motor(12,-20);
delay(2000);
motor(1,20);
motor(2,-20);
delay(2000);
}
}
//edited by Joseph Dulay
// OJT Bitstop Networking Services
//2/23/2018
------------------------------------------------------------------------------------------------------------------------------------------
int E1 = 5;
int M1 = 4;
int E2 = 6;
int M2 = 7;
void setup(){
}
void advance(char a,char b) //Move forward
{
analogWrite (E1,a); //PWM Speed Control
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void back_off (char a,char b) //Move backward
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void turn_L (char a,char b) //Turn Left
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void turn_R (char a,char b) //Turn Right
{
analogWrite (E1,a);
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
advance(50,50);
void loop() {
if(analogRead(0)>300){
back_0ff(50,50);
delay(2000);
turn_L(50,50);
delay(2000);
}
}
------------------------------------------------------------------------------------------------------------------------------------------
More Pictures: