How to connect Arduino and bolt module

Hi I don’t know how to connect Arduino and bolt module can anyone help me from basis level of connection ,

Does this tutorial help? https://docs.boltiot.com/docs/arduino-library

Let me know if you are able to build with its help. Else ill try to shoot a tutorial over the weekend and share the video.

First go through the documentation -


For UART commands,
1 Like

Hi thanks for your support i can’t understand what is hardware serial and software serial,I I the Arduino library I can understand only until importing the bolt iot-arduino helper library .can anyone help me out from the beginning please

1 Like

@indus19 I am not able to find a publicly available tutorial on it as of now. Ill try to make one over the weekend and share.

P.S.: It will be great if any student could make one and share here. :point_left:

You can refer to this -

Other than this there are various open source projects available on Arduino Project Hub. Just Search BoltIoT on the search box.

1 Like

Hi it will be so helpful thank you for your support

@indus19 Let us know once you have done the connection. Keep us posted about your progress. We look forward to your product.



The first image is my Arduino Uno board and the second image is the connection u guys told me,I do know where is D0 And D1 PIN in my board can anyone help me to connect the Arduino and bolt.

Calm down. This diagram is for Atmega328P chip (Applicable and helps connecting to nano, mini, r3 etc)

Connect RX bolt -> TX arduino
TX bolt -> RX arduino

From the fig. D0 =RX, D1 = TX

5V and GND is to power the Bolt from Arduino’s 5V supply.

Yeah done with connection which u told what’s next step

Go through the project I mentioned above. Start with that. If you face any issue, ask here.

Hi I have an doubt in API, I have copied my API key and device name.
https://cloud.boltiot.com/remote/your_api_key/command?&param1=…&param2=…&deviceName=BOLTXXXXX
Once I have entered my API key and device name where should I upload it in the Arduino ide ,but the above is like link ,what should I do now

You dont have to upload the API and device ID to arduino IDE.

Here, we are controlling the uploaded code in arduino USING Bolt URL.

Below is the serialBegin API URL to initialise the serial communication between Bolt and Arduino.

https://cloud.boltiot.com/remote/API_KEY/serialBegin?baud=9600&deviceName=DEVICE_ID

Above, replace API_KEY and DEVICE_ID with your device credentials. Its like a username and password for your module.

For example you want to light up the LED on analog pin 3 (in arduino),

  1. You have to mention it in the arduino code - pins used (3,5,6,7,9…) where pin at array1 has first LED.
    LED pin no. 3 (i.e led 1) with PWM value of 120 then the data variable in the API call will be given by:
'data=ON 1 120 '

Note: There is space at the end of the data variable also.

I hope you are clear that above, 1 is the position of pin in array. And 120 is PWM value of LED brightness.

The complete code would include lot more ofcourse. But after declaration and this input.
The URL to turn ON that particular LED would be

https://cloud.boltiot.com/remote/0e17f7d8-c1a3-4692-b667-7251175f7ab6/serialWrite?data=ON

After the serialWrite, we have to read the serial Data for Bolt too.

The URL for that -

https://cloud.boltiot.com/remote/0e17f7d8-c1a3-4692-b667-7251175f7ab6/serialRead?till=10&deviceName=BOLT8795377

If you are successful, it sends a response back saying '“Pin X was set to pwm value Y”
where X = pin no. 1 or 2 or 3… etc
and Y = pwm value (0-255)

I recommend you to read from the very beginning, the description, working principle, method of communication etc. There is a reason, why students upload projects in portals for other people to learn from. They write and define everything, only so it benefits us.

Do not leave any sentence idle, its important to understand what’s happening to understand what more scope you have when you edit it for your personal projects.

#include <BoltIoT-Arduino-Helper.h>

int pwm_pin[] = {3,5,6,9,10,11};

String switchOn(String *data) {
  int pin = data[0].toInt();
  int pwm = data[1].toInt();
  if ((pin < 1) || (pin > 6)) {
    return "pin number should be b/w 1 and 6";
  }
  pin--;
  analogWrite(pwm_pin[pin],pwm);
  return "Pin"+String(pin)+"was set to pwm value"+String(pwm);
}

void setup() {
  // put your setup code here, to run once:
  pinMode(3,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);
  boltiot.begin(Serial);
  boltiot.setCommandString("ON",switchOn,2,' ');
}

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

Code for Arduino of that project, where the arduino only communicates with the module and LED.
API is for connecting through the internet. For more clarifaction, i recommend you to go through the training module of API requests and this -

Hi I am not getting an clear idea ,do I need to enter my API key and device name in the syntax u gave and paste it in the browser. am I right or wrong

Yes, but only after you have written the arduino code, uploaded on the board and connected rx/tx pin with Bolt.

Look what i wrote below the URL.

And if your question is what is your API, i recommend you to complete your training module first. All the details with practical implementation is already in the course.

Hi guys thanks a lot for your support and response even though ur trying to teach me I am not getting it.i don’t think I can do this .