Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
vimal erick
Published © GPL3+

Hero uv

A simple room layout recordable uvc robot controlled with mobile application

IntermediateWork in progress2 days628
Hero uv

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
node MCU used to control the robot
×1
Arduino Nano R3
Arduino Nano R3
×1
Jumper wires (generic)
Jumper wires (generic)
×1
servo mg
×3
4 channel relay module
×2
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Step-Up Voltage Regulator - 5V
SparkFun Step-Up Voltage Regulator - 5V
×1
dc motor 12 v high torque above 8kg/cm
×1
battrey lithium iron phospha
×1
battrey charger 12 v
×1
Rotary Encoder with Push-Button
Rotary Encoder with Push-Button
we need without push button or magnetic encoder to save motor positions
×1
m10 threaded rod and boults and m10 flange nuts
×1
bearing inter dia 10mm
to make the freee wheel
×1
5 inch pvc pipe 1 ft
×1
12v to 220v invetor
×1
5mm thick aluminium plate 8*8ft
×1
plastic sheet transperent
×1
rubber sheet for track wheel
×1
highly refelective sheet
×1
Plastic Enclosure, Project Box
Plastic Enclosure, Project Box
This box is used to mount the two uvc lamp
×1
uv-c led
×1
UV-C T4
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor
MIT App Inventor

Hand tools and fabrication machines

Drill / Driver, Cordless
Drill / Driver, Cordless
Soldering iron (generic)
Soldering iron (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Hot glue gun (generic)
Hot glue gun (generic)
Tape Measure, Manual
Tape Measure, Manual
aluminum tig welder
rubber adhesive
plastic adhesive
jig saw
spanners

Story

Read more

Custom parts and enclosures

UVC hero cad model

Schematics

Android app

this app is used for direct controll

AIA file for app

to edit direct control apk

Apk for record and play

AIA file for record and play

use thes to edit android app

Sketch up design

uv hero robot design sketch up fike

Read me file

read

Bill of materials

Data sheet for led

Data sheet for T8 uvc lamp

Schematics

use this schematics to connect

Schematics1

Code

UVC robot direct controll

C/C++
upload this sketch on node mcu
#include <ESP8266WiFi.h>
#include <Servo.h>
#include <SoftwareSerial.h>

SoftwareSerial s(3,1);
Servo servo01;
Servo servo02;
Servo servo03;

WiFiClient client;
WiFiServer server(80);

int servo1Pos;
int servo1PPos;
int servo2Pos;
int servo2PPos;
int servo3Pos;
int servo3PPos;

const char* ssid = "robotarm";
const char* password = "tesla432";
String  data ="";
void setup() 
{
servo01.attach(2); //d4
servo02.attach(14);//d5
servo03.attach(12);//d6
pinMode(16,INPUT);//d0
pinMode(5, INPUT);//d1
pinMode(4, INPUT);//d2
pinMode(0, INPUT);//d3


s.begin(9600);                
Serial.begin(115200);
  connectWiFi();
  server.begin();
  
  servo1PPos = 0;
  servo01.write(servo1PPos);
   servo2PPos = 0;
  servo02.write(servo2PPos);
   servo3PPos = 0;
  servo03.write(servo3PPos);
  
}

void loop() 
{ client = server.available();
    if (!client) return; 
    data = checkClient ();
    Serial.println(data);
//servo x 
    if (data.startsWith("sx")) {
      String dataInS = data.substring(2, data.length());
      servo1Pos = dataInS.toInt();
      if (servo1PPos > servo1Pos) {
        for ( int j = servo1PPos; j >= servo1Pos; j--) {
          servo01.write(j);
          delay(1);
          
        }
      }
      if (servo1PPos < servo1Pos) {
        for ( int j = servo1PPos; j <= servo1Pos; j++) {
          servo01.write(j);
          delay(1);
        }
      }
      servo1PPos = servo1Pos;
      Serial.println("servox :");
     Serial.println(servo1PPos);
    }

//servo y
    if (data.startsWith("sy")) {
      String dataInS2 = data.substring(2, data.length());
      servo2Pos = dataInS2.toInt();
      if (servo2PPos > servo2Pos) {
        for ( int k = servo2PPos; k >= servo2Pos; k--) {
          servo02.write(k);
          delay(1);
        }
      }
      if (servo2PPos < servo2Pos) {
        for ( int k = servo2PPos; k <= servo2Pos; k++) {
          servo02.write(k);
          delay(1);
        }
      }
      servo2PPos = servo2Pos;
      Serial.println("servoy :");
     Serial.println(servo2PPos);
    }

    // base servo
if (data.startsWith("sb")) {
      String dataInS3 = data.substring(2, data.length());
      servo3Pos = dataInS3.toInt();
      if (servo3PPos > servo3Pos) {
        for ( int i = servo3PPos; i >= servo3Pos; i--) {
          servo03.write(i);
          delay(1);
        }
      }
      if (servo3PPos < servo3Pos) {
        for ( int i = servo3PPos; i <= servo3Pos; i++) {
          servo03.write(i);
          delay(1);
        }
      }
      servo3PPos = servo3Pos;
      Serial.println("servoy :");
     Serial.println(servo3PPos);
    }

 //motors
if (data.startsWith("md")) {
      String dataInS4 = data.substring(2, data.length());
      int c = dataInS4.toInt();
      switch (c){    
      case 1:// up
      s.write("up");
      break;
      case 2://down
      s.write("up");
      break;
      case 3://left
      s.write("down");
      break;
      case 4://right
      s.write("right");
      break;
      case 5://stop
      s.write("stop");
      break;
      default: 
      //nothing
      break;
      }
     
        }
// lights  
if (data.startsWith("li")) {
      String dataInS5 = data.substring(2, data.length());
      int b = dataInS5.toInt();
      switch (b){    
      case 1:// up
      s.write("t4high");
      break;
      case 2: //down
      s.write("t4low");
      break;
      case 3://left
      s.write("ledhigh");
      break;
      case 4://right
      s.write("ledlow");
      break;
      
      default :
      //nothing
      break;
      }
      
      }
// delay

if (data.startsWith("de")) {
      String dataInS4 = data.substring(2, data.length());
      int delay1 = dataInS4.toInt();
      delay(delay1);
        }

    client.flush();


}

  
void connectWiFi()
{
  Serial.println("Connecting to WIFI");
  WiFi.begin(ssid, password);
  while ((!(WiFi.status() == WL_CONNECTED)))
  {
    delay(300);
    Serial.print("..");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("NodeMCU Local IP is : ");
  Serial.print((WiFi.localIP()));
}

String checkClient (void)
{
  while(!client.available()) delay(1); 
  String request = client.readStringUntil('\r');
  request.remove(0, 5);
  request.remove(request.length()-9,9);
  return request;
}

Code for arduino nano

C/C++
upload this code to Arduino nano
No preview (download only).

Code for record and play operation

C/C++
upload this program on node mcu
this program not completed yet
read readme text file before using this app
//code by vimaleric
#include <ESP8266WiFi.h>
#include <Servo.h>

Servo servo01;
Servo servo02;
Servo servo03;

WiFiClient client;
WiFiServer server(80);

// to map encoder value
int servo1Pos;
int servo1PPos;
int servo2Pos;
int servo2PPos;
int servo3Pos;
int servo3PPos;

const char* ssid = "youre ssid";
const char* password = "your password";
String  data ="";

 
void setup() 
{
servo01.attach(2); 
servo02.attach(14);
servo03.attach(12);
           
Serial.begin(115200);
  connectWiFi();
  server.begin();
  
  servo1PPos = 0;
  servo01.write(servo1PPos);
   servo2PPos = 0;
  servo02.write(servo2PPos);
   servo3PPos = 0;
  servo03.write(servo3PPos);
  
}

void loop() 
{  
  client = server.available();
    if (!client) return; 
    data = checkClient ();

    if (data.startsWith("sx")) {
      String dataInS = data.substring(2, data.length());
      servo1Pos = dataInS.toInt();
      if (servo1PPos > servo1Pos) {
        for ( int j = servo1PPos; j >= servo1Pos; j--) {
          servo01.write(j);
          delay(1);
          
        }
      }
      if (servo1PPos < servo1Pos) {
        for ( int j = servo1PPos; j <= servo1Pos; j++) {
          servo01.write(j);
          delay(1);
        }
      }
      servo1PPos = servo1Pos;
      Serial.println("servox :");
     Serial.println(servo1PPos);
    }
// sX this data are send by mit app inventer by reading the file
    if (data.startsWith("sX")) {
      String dataInS = data.substring(2, data.length());
         dataInS.remove(0,1);
         dataInS.remove(dataInS.length()-7,7);
      servo1Pos = dataInS.toInt();
      if (servo1PPos > servo1Pos) {
        for ( int j = servo1PPos; j >= servo1Pos; j--) {
          servo01.write(j);
          delay(1);
          
        }
      }
      if (servo1PPos < servo1Pos) {
        for ( int j = servo1PPos; j <= servo1Pos; j++) {
          servo01.write(j);
          delay(1);
        } 
      }
      servo1PPos = servo1Pos;
      Serial.println("servox :");
     Serial.println(servo1PPos);
    }
    if (data.startsWith("sy")) {
      String dataInS2 = data.substring(2, data.length());
      servo2Pos = dataInS2.toInt();
      if (servo2PPos > servo2Pos) {
        for ( int k = servo2PPos; k >= servo2Pos; k--) {
          servo02.write(k);
          delay(1);
        }
      }
      if (servo2PPos < servo2Pos) {
        for ( int k = servo2PPos; k <= servo2Pos; k++) {
          servo02.write(k);
          delay(1);
        }
      }
      servo2PPos = servo2Pos;
      Serial.println("servoy :");
     Serial.println(servo2PPos);
    }

    // base servo
    
if (data.startsWith("sb")) {
      String dataInS3 = data.substring(2, data.length());
      servo3Pos = dataInS3.toInt();
      if (servo3PPos > servo3Pos) {
        for ( int i = servo3PPos; i >= servo3Pos; i--) {
          servo03.write(i);
          delay(1);
        }
      }
      if (servo3PPos < servo3Pos) {
        for ( int i = servo3PPos; i <= servo3Pos; i++) {
          servo03.write(i);
          delay(1);
        }
      }
      servo3PPos = servo3Pos;
      Serial.println("servoy :");
     Serial.println(servo3PPos);
    }
}



void connectWiFi()
{
  Serial.println("Connecting to WIFI");
  WiFi.begin(ssid, password);
  while ((!(WiFi.status() == WL_CONNECTED)))
  {
    delay(300);
    Serial.print("..");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("NodeMCU Local IP is : ");
  Serial.print((WiFi.localIP()));

    delay(1);


  
}

String checkClient (void)
{
  while(!client.available()) delay(1); 
  String request = client.readStringUntil('\r');
  request.remove(0, 5);
  request.remove(request.length()-9,9);
  return request;
}

Credits

vimal erick

vimal erick

2 projects • 6 followers

Comments