Remote ControlledCars
- WifiControlledMbot Car
mBotRobotic Kit is an educational kit madebyMakeBlock. mBot has a Mcorecardwhich is supportedbyArduino, andthankstothissupport, mBot can be madedifferentfeatures, regardless of otherprograms.
Since thecard has a modularstructure, installation is veryeasy. Itdoes not havecomplicatedconnections.
STEM, whichenableschildrenmeetwithtechnologybyconsciouslyand step by step, can be usedwithmBot.
mBotprovidesthedevelopment of skillssuch as handskills, mechanics, control, algorithmandprogramming.
Thereare RGB led, Buzzer, IR Receiver, Light Sensor, IR Transmitting, Button, Motor Port, RJ 45 port on themCoreCard.
For WifiControlledMbot Car, Mcorecardmusthave Motor 1 and Motor 2 connectionsandWifiModuleinstalled.
Thefollowingstepsarefollowedto set upandwirelesslycommunicatewithMbotviatheMblock program:
- Installthecurrent USB driverforyour Operating System.
- Connect the USB cableandselecttheappropriate COM port or /tty/dev (depending on youroperatingsystem).
- Update the firmware on themBot.
- Select the 2.4G Serialoption on the Connect menu.
Codesthatwill be used in theMblock program are as follows:
- Whenuparrowkeypressed – Run forward at speed 255
- Whenuparrowkeyreleased – Run forward at speed 0
- Whenleftarrowkeypressed – Turnleft at speed 255
- Whenleftarrowkeyreleased – Run forward at speed 0
- Whenrightarrowkeypressed – Turnright at speed 255
- Whenrightarrowkeyreleased – Run forward at speed 0
- Whendownarrowkeypressed – Run RunBackward at speed 255
- Whendownarrowkeyreleased – Run forward at speed 0
- Bluetooth ControlledArduino Car
Arduino is an opensourcemicrocontrollercard. Electronic androboticapplications can be easilydevelopedusingthiscard. Manysensors can be connectedtothiscardwithInputandOutputpins. It can be programmedwithprogramsusingcodeblockssuch as Scratch, Mblock as well as programmingwiththe C language. Thiscard, which is usedforchildren'scodingandelectroniclearning, has manysensors.
Thematerialsneededtomake a Bluetooth ControlledArduino Car are as follows:
Hardware
- ArduinoUno
- Motor Shield L293D
- HC 06 Bluetooth Module
- Robot Platform (2 DC Motor)
- PowerBankor 4x1.5 Volt Battery (for L293D)
- 9 Volt Pil (forArduino )
Software
- ArduinoIde
The DC motorsareconnectedtothe engine compartments on the L293D. The HC06 Bluetooth Module's VCC pin is connectedto 3.3 Volts, GND pinto GND, RxpintoTx, andTxpintoRx. Ifthejumper is removedviathe L293D, themotorstaketheirpowerfromtheexternalpowersupply. If it is attached, thepower is takenoverArduinoandthe car movesslowlybecausethispower is insufficient.
Inorderforthecodesto be loadedintoArduino, ArduinoIdemust be installedwiththelibrarynamedAFMotor.hinstalled. Ifthe TX and RX pinsareconnectedwhilethecodesareloaded, theloadwill fail. Thecables of thesepinsneedto be removedduringcodeloading.
Fromthe Play Store, installthe Bluetooth Rc Controller namedapplication on thephoneor tablet.
Thecodesto be loadedintoArduinoare as follows:
#includeAFMotor.h
AF_DCMotor motor1(3);
AF_DCMotor motor2(4);
chardata;
voidsetup()
{
Serial.begin(9600);
}
voidloop(){
if(Serial.available() > 0){
data = Serial.read();
Stop();
Serial.println(data);
switch(data){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
}
}
}
voidforward()
{
motor1.setSpeed(255);
motor1.run(FORWARD);
motor2.setSpeed(255);
motor2.run(FORWARD);
}
voidback()
{
motor1.setSpeed(255);
motor1.run(BACKWARD);
motor2.setSpeed(255);
motor2.run(BACKWARD);
}
voidleft()
{
motor1.setSpeed(255);
motor1.run(FORWARD);
motor2.setSpeed(0);
motor2.run(RELEASE);
}
voidright()
{
motor1.setSpeed(0);
motor1.run(RELEASE);
motor2.setSpeed(255);
motor2.run(FORWARD);
}
void Stop()
{
motor1.setSpeed(0);
motor1.run(RELEASE);
motor2.setSpeed(0);
motor2.run(RELEASE);
}