Project tutorial
Remote Controlled Shopping Cart Using evive

Remote Controlled Shopping Cart Using evive © CC BY

This project will show you how to upgrade your regular shopping cart to an RC shopping cart.

  • 999 views
  • 2 comments
  • 4 respects

Components and supplies

Screen%20shot%202016 08 17%20at%2012.06.19%20pm
STEMpedia evive
×1
Ardgen mega
Arduino Mega 2560 & Genuino Mega 2560
×1
DC motor (generic)
×1
Transmitter
×1
Receiver
×1

Apps and online services

About this project

Our DIY Shopping Cart transforms your shopping time from a boring project to a fun-filled activity. Get ready to change its face once again this during the Black Friday shopping mania this year. Behold *drum roll* the RC Shopping Cart - a shopping cart that dances to the waves sent by a remote control transmitter, just like a remote control car, only that the car has been replaced by the cart.

Want to turn some heads while you shop?

Then why are you still here?! Begin right away!

Step 1: Things You'll Need:

  • Transmitter and Receiver
  • Male to Female Jumper Cables

The components for the Shopping Cart and Mobile Robot are given on their respective pages.

Step 2: The Twist

We have listed a number of tutorials that can be controlled using Smartphone through the GamePad app.

They use Bluetooth Module to connect themselves to the Smartphone.

But, all those projects can even be controlled with the help of Remote Control. In this project, we are going to transform two projects, Smartphone Controlled Shopping Cart and Mobile Robot.

Step 3: The Heart and the Soul of the Project

The Remote Control that we are going to use comes in a pair of a Transmitter and a Reciever.

The model which we are using is the FLYSKY CT6B and the transmitter is the MOD2 type.

The receiver gets connected to evive. And transmitter is with which you control your cart or the robots. It is not a one-step process and also the sequence of the steps should be the same.

Step 4: Binding

All the below steps will be the same for both of the projects.

The first and foremost step is binding. As the name suggests, you must have guessed correctly.

The process of connecting the receiver to transmitter is binding.

The BAT pin on the receiver is used for the same. Short the GND and SIGNAL pin of BAT Channel using Jumper Channel. To power up the receiver connect VCC and GND of any other channel to +5V and GND of evive. Once you do so, the LED of the receiver starts blinking.

Next, take the transmitter and hold the BIND button and press START.Thus, the blinking light on the evive thus becomes stable.

YAY! One down.

Step 5: Channel Identification

Once you complete the binding disconnect receiver from evive.

This process is done so that we can know which key on the transmitter is used to control which channel of the receiver.

Connect a servo to any one channel of the receiver except BAT channel. Once you have connected the servo.

Switch ON the transmitter. Try moving the sticks and potentiometer to check which controls it.

Repeat the same process for all the channels.

Step 6: The Final Step: Connection

We will be connecting the receiver with evive.

Connections of Channel 1, Channel 2, Channel 3, and Channel 4 with evive is given below: The GND and VCC of all of them will be connected to GND and +5V of evive.

Their Signal pins are connected as:

  • Channel 1 - Digital Pin 2
  • Channel 2 - Digital Pin 2
  • Channel 3 - Digital Pin 18
  • Channel 4 - Digital Pin 19

Check the below fritzing image for the connections:

Step 7: The Finishing Touch

As we know that the transmitter and the receiver pair work on PPM ( Pulse Position Modulation).

The DC Motors work on PWM ( Pulse Width Modulation).

The code below is used to convert PPM to PWM.

And then the motor runs on the given PWM.

Download the Arduino Code and evive Library from the code section below.

Step 8: Conclusion

With this, the RC Shopping Cart is ready to transform your Black Friday shopping experience for good! Enjoy!

Code

Arduino Code for RC TrolleyArduino
#define NEUTRAL_THROTTLE 1500

#define motor1_enable 44
#define motor2_enable 45
#define motor1_dir1 28
#define motor1_dir2 29
#define motor2_dir1 30
#define motor2_dir2 31

#define channel1 2
#define channel2 3
#define channel3 18
#define channel4 19
#define channel5 20
#define channel6 21

volatile int nThrottleIn1 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod1 = 0;
volatile boolean bNewThrottleSignal1 = false;

volatile int nThrottleIn2 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod2 = 0;
volatile boolean bNewThrottleSignal2 = false;

volatile int nThrottleIn3 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod3 = 0;
volatile boolean bNewThrottleSignal3 = false;

volatile int nThrottleIn4 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod4 = 0;
volatile boolean bNewThrottleSignal4 = false;

volatile int nThrottleIn5 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod5 = 0;
volatile boolean bNewThrottleSignal5 = false;

volatile int nThrottleIn6 = NEUTRAL_THROTTLE;
volatile unsigned long ulStartPeriod6 = 0;
volatile boolean bNewThrottleSignal6 = false;

void setup()
   {
     //put your setup code here, to run once:

    pinMode(2, INPUT_PULLUP);
    pinMode(3, INPUT_PULLUP);
    pinMode(18, INPUT_PULLUP);
    pinMode(19, INPUT_PULLUP);
    pinMode(20, INPUT_PULLUP);
    pinMode(21, INPUT_PULLUP);

    pinMode(motor1_enable,OUTPUT);
    pinMode(motor2_enable,OUTPUT);
    pinMode(motor1_dir1,OUTPUT);
    pinMode(motor2_dir1,OUTPUT);
    pinMode(motor1_dir2,OUTPUT);
    pinMode(motor2_dir2,OUTPUT);


    attachInterrupt(digitalPinToInterrupt(2), calcInput1, CHANGE);
    attachInterrupt(digitalPinToInterrupt(3), calcInput2, CHANGE);
    attachInterrupt(digitalPinToInterrupt(18), calcInput3, CHANGE);
    attachInterrupt(digitalPinToInterrupt(19), calcInput4, CHANGE);
    attachInterrupt(digitalPinToInterrupt(20), calcInput5, CHANGE);
    attachInterrupt(digitalPinToInterrupt(21), calcInput6, CHANGE);

    Serial.begin(9600);

  }

void loop() 
  {
     // put your main code here, to run repeatedly:

     if (bNewThrottleSignal3)
        {
  
        if(nThrottleIn3<1200)
           {
              Stop();
              Serial.println("stop");
     
           }
        else if(nThrottleIn3>1201)
           {
               nThrottleIn3 = map(nThrottleIn3 , 1130, 1908, 0, 255);
               analogWrite(motor1_enable, nThrottleIn3);
               analogWrite(motor2_enable, nThrottleIn3);
               nThrottleIn3 = map(nThrottleIn3 , 0, 255, 1130, 1908);
               Serial.println(nThrottleIn3);
           }
            bNewThrottleSignal3 = false;
         }

   if (bNewThrottleSignal1)
        {
             bNewThrottleSignal1 = false;
           if (nThrottleIn1 < 1200 && nThrottleIn3 >1200)
               {
                  left();
                  Serial.println("left");
               }
          else if (nThrottleIn1 > 1750 && nThrottleIn3 >1200)
              {
                  right();
                 Serial.println("right");
              }
          
        
        }

  if (bNewThrottleSignal2)
         {
           bNewThrottleSignal2 = false;
             if (nThrottleIn2 > 1750 && nThrottleIn3 >1200)
                {
                    forward();
                   Serial.println("forward");
                }
            else if (nThrottleIn2 < 1200 && nThrottleIn3 >1200)
               {
                  backward();
      Serial.println("back");
    }
   
  }

   if(1400<nThrottleIn1<1600 && 1400<nThrottleIn2<1600)
   {
    Stop();
   }



}



void calcInput1()
{
  // if the pin is high, its the start of an interrupt
  if (digitalRead(channel1) == HIGH)
  {
    ulStartPeriod1 = micros();
  }
  else
  {
    // if the pin is low, its the falling edge of the pulse so now we can calculate the pulse duration by subtracting the
    // start time ulStartPeriod from the current time returned by micros()
    if (ulStartPeriod1 && (bNewThrottleSignal1 == false))
    {
      nThrottleIn1 = (int)(micros() - ulStartPeriod1);
      ulStartPeriod1 = 0;

      // tell loop we have a new signal on the throttle channel
      // we will not update nThrottleIn until loop sets
      // bNewThrottleSignal back to false
      bNewThrottleSignal1 = true;
    }
  }

}


void calcInput2()
{
  if (digitalRead(channel2) == HIGH)
  {
    ulStartPeriod2 = micros();
  }
  else
  {
    if (ulStartPeriod2 && (bNewThrottleSignal2 == false))
    {
      nThrottleIn2 = (int)(micros() - ulStartPeriod2);
      ulStartPeriod2 = 0;
      bNewThrottleSignal2 = true;
    }
  }

}


void calcInput3()
{
  if (digitalRead(channel3) == HIGH)
  {
    ulStartPeriod3 = micros();
  }
  else
  {
    if (ulStartPeriod3 && (bNewThrottleSignal3 == false))
    {
      nThrottleIn3 = (int)(micros() - ulStartPeriod3);
      ulStartPeriod3 = 0;
      bNewThrottleSignal3 = true;
    }
  }

}


void calcInput4()
{
 
  if (digitalRead(channel4) == HIGH)
  {
    ulStartPeriod4 = micros();
  }
  else
  {
    if (ulStartPeriod4 && (bNewThrottleSignal4 == false))
    {
      nThrottleIn4 = (int)(micros() - ulStartPeriod4);
      ulStartPeriod4 = 0;
      bNewThrottleSignal4 = true;
    }
  }

}


void calcInput5()
{
 
  if (digitalRead(channel5) == HIGH)
  {
    ulStartPeriod5 = micros();
  }
  else
  {
   
    if (ulStartPeriod5 && (bNewThrottleSignal5 == false))
    {
      nThrottleIn5 = (int)(micros() - ulStartPeriod5);
      ulStartPeriod5 = 0;
      bNewThrottleSignal5 = true;
    }
  }

}


void calcInput6()
{
  if (digitalRead(channel6) == HIGH)
  {
    ulStartPeriod6 = micros();
  }
  else
  {
    
    if (ulStartPeriod6 && (bNewThrottleSignal6 == false))
    {
      nThrottleIn6 = (int)(micros() - ulStartPeriod6);
      ulStartPeriod6 = 0;
      bNewThrottleSignal6 = true;
    }
  }

}

void forward()
{
  digitalWrite(28,HIGH);
  digitalWrite(29,LOW);
  digitalWrite(30,HIGH);
  digitalWrite(31,LOW);
  delay(30);
}
void backward()
{
  digitalWrite(28,LOW);
  digitalWrite(29,HIGH);
  digitalWrite(30,LOW);
  digitalWrite(31,HIGH);
  delay(30);
}
void left()
{
   digitalWrite(28,HIGH);
  digitalWrite(29,LOW);
  digitalWrite(30,LOW);
  digitalWrite(31,HIGH);
  delay(30);
}
void right()
{
   digitalWrite(28,LOW);
  digitalWrite(29,HIGH);
  digitalWrite(30,HIGH);
  digitalWrite(31,LOW);
  delay(30);
}
void Stop()
{
   digitalWrite(28,LOW);
  digitalWrite(29,LOW);
  digitalWrite(30,LOW);
  digitalWrite(31,LOW);
  delay(30);
}
evive LibraryC/C++
No preview (download only).

Schematics

Fritzing Diagram for RC Trolley
Rc robot bb rhsqyyphyy

Comments

Similar projects you might like

Smartphone Controlled Electric Skateboard

Project showcase by Team evive

  • 8,924 views
  • 5 comments
  • 24 respects

PlayStation Remote Controlled Wireless Car

Project showcase by Jasmeet Singh

  • 2,587 views
  • 1 comment
  • 6 respects

Remote Controlled Bulb With Arduino

Project tutorial by muhammed shameel k.v

  • 2,870 views
  • 0 comments
  • 12 respects
Add projectSign up / Login