OSER

Open Source Educational Robot

This page is dedicated to my own open source and educational robot aimed to promote science and technology over students between 15 to 17 years old.

This robot is controlled by an Android Application through Bluetooth. The robot has 4 servo motor for movement and an additional servo motor to control a mechanism that would help the robot get into our competition.

I provide this information so students, teachers, and all people interested on build their own robot can get started with an easy to use robot. All information is provided as Open Source with MIT License 2016, more details here.

Mechanical parts

The robot frame was designed in AutoCAD 2016. Using a Laser Cutter you can make your cut your own robot chassis using MDF or Acrylic 3mm thickness.

To get the original file in DXF format click here.

Assembly instructions will be provided later in this section.

Electronics

The list of parts that you need to make this robot complete functional are:

Qty Description Link
4 Servo – Generic High Torque Full Rotation (Standard Size) http://www.sparkfun.com/products/9347
1 Servo – Generic (Sub-Micro Size) http://www.sparkfun.com/products/9065
1 Pan/Tilt Bracket http://www.sparkfun.com/products/10335
1 4-AA Battery Holder, Back-to-Back http://www.pololu.com/product/1154
1 SparkFun Bluetooth Modem – BlueSMiRF Silver http://www.sparkfun.com/products/12577
1 Freescale FRDM-KL25Z Basic Kit from Newark http://goo.gl/J4B0RL

The following picture shows the schematic. PCB layout will be available soon.OSER-schematic

Software

The KL25z microcontroller was programed using mbed.org  classic compiler. Code can be found here or click on the next link to display it here.

/*
    OSER - Open Source Educational Robot
 
    Author: 
        Gerardo Carmona
    Webpage: 
        www.makerobots.tk
 
    About:
        Open source and educational robot aimed to promote science 
        and technology over students between 15 to 17 years old.
 
    Licence:
        I provide this information so students, teachers, and all 
        people interested on build their own robot can get started 
        with an easy to use robot. All information is provided as 
        Open Source with MIT License 2016, more details visit 
        https://opensource.org/licenses/MIT.
 
*/
 
 
// --- Libraries -----------------------------------------------------
#include "mbed.h"
#include "Servo.h"
 
// --- Definitions ---------------------------------------------------
#define MAXVEL      100   // 100 is max
#define SERINC      100   // Move micro seconds up/down (1000 to 2000)
 
// --- I/O pins ------------------------------------------------------
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
Serial bt(PTE0, PTE1);
Servo SLF(D2);           // Servo - Left Front
Servo SLB(D3);           // Servo - Left Back
Servo SRF(D4);           // Servo - Right Front
Servo SRB(D5);           // Servo - Right Back
Servo S01(D8);           // Servo Arm

// --- Prototypes ----------------------------------------------------
void decodeInstruction(char instruction);
void setSpeed(int left, int right);
void moveServo(int increment);
 
// --- Variables -----------------------------------------------------
char c;
 
// --- Main program --------------------------------------------------
int main() {
    // Bluetooth baud rate
    bt.baud(115200);
    while(1) {
        // Search for data and decode instruction
        if (bt.readable()){
            c = bt.getc();
            decodeInstruction(c);
        }
            
    }
}
 
// --- Functions -----------------------------------------------------
void decodeInstruction(char instruction){
    switch (instruction){
        case 'W':
        case 'w':
            setSpeed(MAXVEL, -MAXVEL);
            break;
        case 'A':
        case 'a':
            setSpeed(-MAXVEL, -MAXVEL);
            break;
        case 'S':
        case 's':
            setSpeed(-MAXVEL, MAXVEL);
            break;
        case 'D':
        case 'd':
            setSpeed(+MAXVEL, +MAXVEL);
            break;
        case 'Q':
        case 'q':
            setSpeed(0,0);
            break;
        case 'P':
        case 'p':
            moveServo(SERINC);
            break;
        case 'L':
        case 'l':
            moveServo(-SERINC);
            break;
    }        
}
 
void setSpeed(int left, int right){
    float sLeft=0, sRight=0;
    sLeft = (float)(left + 100)/200;
    sRight = (float)(right + 100)/200;
    SLF = sLeft;
    SLB = sLeft;
    SRF = sRight;
    SRB = sRight;
}
 
void moveServo(int increment){
    float temp = 0.0;
    float pos;
    temp = (float)increment / 100.0;
    pos = S01;
    if (temp < 0 && pos >= abs(temp)){
        S01 = pos + temp;
    }else if (temp > 0 && pos <= 1 - abs(temp)){
        S01 = pos + temp;
    }
}

In order to control your robot via Bluetooth, an App was developed using MIT App Inventor 2. You can download the compiled App here.

Screenshot Android App:

AndroidApp

Prototype

Photos of fully functional final prototype.

23029801973_d7fde2c38d_z

MDF first prototype

23028673434_a09e9aee88_z

Second prototype made of black acrylic

Find more pictures and videos in my Flickr account.

Advertisements