Trevor MooreJuan VargasMalik Klaus
Published © GPL3+

DSTR Robot Hack

We transformed the standard DSTR Robot so that it would have a solar-based battery charging capability that tracks the sun for max charging.

IntermediateWork in progressOver 1 day674
DSTR Robot Hack

Things used in this project

Hardware components

CC3200-LAUNCHXL SimpleLink CC3200 Wi-Fi LaunchPad
Texas Instruments CC3200-LAUNCHXL SimpleLink CC3200 Wi-Fi LaunchPad
×2
Sunnytech 1.25w 5v 250ma Mini Small Solar Panel Module DIY Polysilicon Solar Epoxy Cell Charger B019
×2
2D 2-Axis Brushless Camera Mount Gimbal
×1
Solar Lipo Charger (3.7V) With solar cells lithium batteries you can quickly build a solar power system Applicable battery: single 3.7V lithium battery
×1
iExcell 250 Pcs M3 x 6mm/8mm/10mm/12mm/16mm Internal Hex Drive Socket Cap Screws Kit,Stainless Steel 304, Silver Tone
×1
Photo resistor
Photo resistor
×4

Software apps and online services

Energia
Texas Instruments Energia

Hand tools and fabrication machines

Wire Stripper,ZOTO Self-adjusting Cable Cutter Crimper,Automatic Wire Stripping Tool/Cutting Pliers Tool for Industry

Story

Read more

Custom parts and enclosures

Solar Wall (Model S1)

This part was used in conjunction with photo-resisters to give our "hack" the ability to track the sun.

Model S2

This part was used to help us mount the solar panels to the solar wall

Model B1

The part used to help use mount the solar wall and solar panels on to our DSTR robot.

Model B2

This part was used in conjunction with Model B1 to give us more surface area to mount our solar wall and solar panels.

Schematics

Battery Charger

Schematic for how the batteries will be charged in our "hack".

Code

SolarArrayTracker

Java
This coder controlled the positioning of the solar panels
#include <Servo.h> // include Servo library 

// 180 horizontal MAX
Servo horizontal; // horizontal servo
int servoh = 180;   // 90;     // stand horizontal servo

int servohLimitHigh = 180;
int servohLimitLow = 65;

// 65 degrees MAX
Servo vertical;   // vertical servo 
int servov = 45;    //   90;     // stand vertical servo

int servovLimitHigh = 80;
int servovLimitLow = 15;


// LDR pin connections
//  name  = analogpin;
int ldrlt = A0; //LDR top left - BOTTOM LEFT    <--- BDG
int ldrrt = A1; //LDR top rigt - BOTTOM RIGHT 
int ldrld = A2; //LDR down left - TOP LEFT
int ldrrd = A3; //ldr down rigt - TOP RIGHT

void setup()
{
  Serial.begin(9600);
// servo connections
// name.attacht(pin);
  horizontal.attach(9); 
  vertical.attach(10);
  horizontal.write(180);
  vertical.write(45);
  delay(3000);
}

void loop() 
{
  int lt = analogRead(ldrlt); // top left
  int rt = analogRead(ldrrt); // top right
  int ld = analogRead(ldrld); // down left
  int rd = analogRead(ldrrd); // down rigt
  
  // int dtime = analogRead(4)/20; // read potentiometers  
  // int tol = analogRead(5)/4;
  int dtime = 10;
  int tol = 50;
  
  int avt = (lt + rt) / 2; // average value top
  int avd = (ld + rd) / 2; // average value down
  int avl = (lt + ld) / 2; // average value left
  int avr = (rt + rd) / 2; // average value right

  int dvert = avt - avd; // check the diffirence of up and down
  int dhoriz = avl - avr;// check the diffirence og left and rigt
  
  
  Serial.print(avt);
  Serial.print(" ");
  Serial.print(avd);
  Serial.print(" ");
  Serial.print(avl);
  Serial.print(" ");
  Serial.print(avr);
  Serial.print("   ");
  Serial.print(dtime);
  Serial.print("   ");
  Serial.print(tol);
  Serial.println(" ");
  
    
  if (-1*tol > dvert || dvert > tol) // check if the diffirence is in the tolerance else change vertical angle
  {
  if (avt > avd)
  {
    servov = ++servov;
     if (servov > servovLimitHigh) 
     { 
      servov = servovLimitHigh;
     }
  }
  else if (avt < avd)
  {
    servov= --servov;
    if (servov < servovLimitLow)
  {
    servov = servovLimitLow;
  }
  }
  vertical.write(servov);
  }
  
  if (-1*tol > dhoriz || dhoriz > tol) // check if the diffirence is in the tolerance else change horizontal angle
  {
  if (avl > avr)
  {
    servoh = --servoh;
    if (servoh < servohLimitLow)
    {
    servoh = servohLimitLow;
    }
  }
  else if (avl < avr)
  {
    servoh = ++servoh;
     if (servoh > servohLimitHigh)
     {
     servoh = servohLimitHigh;
     }
  }
  else if (avl = avr)
  {
    // nothing
  }
  horizontal.write(servoh);
  }
   delay(dtime);

}

Credits

Trevor Moore

Trevor Moore

1 project • 1 follower
Juan Vargas

Juan Vargas

1 project • 1 follower
Malik Klaus

Malik Klaus

1 project • 1 follower

Comments