Wifi controlled car using bolt wifi module and arduino uno

I have started my project which is a wifi controlled car which includes wifi bolt module and arduino uno.

I have uploaded the code on arduino.

My confusion is what should be done on the bolt cloud

Am I suppose to write a code on blot cloud or jus an online status of wifi module is need and then enter the api key and device ID on the controller.html

Pls answer

1 Like

@erinepereira27

We have received your query. My colleague @vinayak.joshi will help you out with the same.

Hi @erinepereira27,

I believe that you are following the code given in the following link.

The project assumes that you have connected the Bolt WiFi module to your Bolt Cloud account.
So you should be able to get the API key from the Bolt Cloud.

2ndly it assumes that you have connected the Bolt WiFi module to a WiFi source and that the WiFi module is online. This means that it should show as online in the Bolt Cloud dashboard.

The controller.html is a file can be run from your local system. For example if you have downloaded the zip file and extracted it in the downloads folder, then you will have to go to the controller.html file, right click it and open the file with some browser.

You can then enter a device id and API key and then click on submit.

Once this is done, you should be able to control the robot using the 4 arrow button in the view.

Thank you sir for helping me

Dear Sir I would like to thank you for ur help.

Sir so I dnt have to do anything on the cloud jus the status of my wifi module should be on rht Sir?
After that I have to open the controller.html file using brower and enter the device ID and api key there

pls correct me if I am wrong

Hi @erinepereira27,

Yes you are right.

Sir when I open the controller.html file on the the browser after putting the api key and device id and clicking submit, the api key and device ud slot becomes empty if I fill the details again… same thing happens again and again

The code which I have uploaded on my arduino uno is this
#include <BoltIoT-Arduino-Helper.h>

define left_motor1 6

define left_motor2 7

define right_motor1 8

define right_motor2 9

define sensor 3

String command = “”;
int delay_time = 250;

String check() {
int sensor_value = digitalRead(sensor);
Serial.println(sensor_value);
Serial.println(command);
if ((sensor_value == 0) && (command == “FORWARD”)) {
digitalWrite(left_motor2,LOW);
digitalWrite(left_motor1,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,LOW);
command = “”;
}
return “STOP”;
}

String forward(String *data) {
command = “FORWARD”;
digitalWrite(left_motor1,HIGH);
digitalWrite(left_motor2,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,HIGH);
return “Success:Forward”;
}

String backward(String *data) {
command = “BACKWARD”;
digitalWrite(left_motor1,LOW);
digitalWrite(left_motor2,HIGH);
digitalWrite(right_motor1,HIGH);
digitalWrite(right_motor2,LOW);
return “Success:Backward”;
}

String right(String *data) {
command = “RIGHT”;
digitalWrite(left_motor1,LOW);
digitalWrite(left_motor2,HIGH);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,HIGH);
delay(delay_time);
digitalWrite(left_motor2,LOW);
digitalWrite(left_motor1,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,LOW);
return “Success:Left”;
}

String left(String *data) {
command = “LEFT”;
digitalWrite(left_motor1,HIGH);
digitalWrite(left_motor2,LOW);
digitalWrite(right_motor1,HIGH);
digitalWrite(right_motor2,LOW);
delay(delay_time);
digitalWrite(left_motor2,LOW);
digitalWrite(left_motor1,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,LOW);
return “Success:Right”;
}

String stopcar(String *data) {
digitalWrite(left_motor2,LOW);
digitalWrite(left_motor1,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,LOW);
return “Success:Stop”;
}

void setup() {
// put your setup code here, to run once:
pinMode(left_motor1,OUTPUT);
pinMode(left_motor2,OUTPUT);
pinMode(right_motor1,OUTPUT);
pinMode(right_motor2,OUTPUT);
pinMode(sensor,INPUT);
boltiot.begin(Serial);
Serial.begin(9600);
boltiot.setCommandString(“FORWARD”,forward);
boltiot.setCommandString(“BACKWARD”,backward);
boltiot.setCommandString(“LEFT”,left);
boltiot.setCommandString(“RIGHT”,right);
boltiot.setCommandString(“STOP”,stopcar);
}

void loop() {
// put your main code here, to run repeatedly:
boltiot.handleCommand();
check();
}

And I am using 4 motors with this driver shield shown below

Pls tell me sir if there’s a error @vinayak.joshi

Hi,

This query has been cleared in the following link