Relay connection to bolt

Can i connect the Vcc supply of 2 channel relay module directly to the 5v pin in bolt module??

Hi nimyug18,
If you are using 2 channel relay module, you can directly connect Vcc pin to 5v pin of bolt module. The connection of 2 channel relay module is like that:-

Vcc ==> 5v pin of bolt module
Gnd ==> gnd pin of bolt module
IN1 pin of relay ==> Any bolt module pin (0,1,2,3,4)
IN2 pin of relay ==> Any bolt module pin (0,1,2,3,4)

In this image, i want to show with only one channel relay module.

Hope this will be helpful for you !:slightly_smiling_face::slightly_smiling_face::slightly_smiling_face::slightly_smiling_face::slightly_smiling_face:

Mayur Jain

1 Like

I just have one doubt, with this same setup using relay can i connect 3v dc motor to it(gpio pins) or for using the motors i should use l293d motor drivers only??

Basically, we cannot use DC motor directly, we can use it with the motor driver Ic i.e L293D.Because driven current is more ,so it must be probably destroy our bolt module. So if we donot have L293d Ic then we can also control with transistor(TIP120),diode(1n4001) and 1k ohm resistor.

circuit is shown in the image.

Hope this will be helpful for you!
Mayur Jain

@JAINMAYUR1997 Thanks a lot for that.
So basically I have to connect 2 motors to 2 separate gpio pins of bolt module to turn one motor ON at a time. What will be the circuit configuration when i use l293d? Can you please help me out with it.

hi @nimyug18,
So if you want to connect two dc motors then you have to use 4 pins of bolt module. Now you see the image of L293d and how to connect dc motor with L293D.


You can see that 2 pin in L293d is used to control 1 dc motor so these two pins is connected to bolt module(like pin1 and pin2 of bolt module). Similarly, another two pins of input is used to control another dc motor so, it will also connect with pin3 and pin4 of bolt module.
Motor output pins are connected with both motors.
5V and gnd pins of l293d is connected with 5v and gnd pins of bolt module.

As we know that motor will only rotate if we give alternate logic on input pins of L293D.Example if we wnt to rotate first dc motor then one input pin should be HIGH and another should be LOW and vice-versa.
If we want to stop dc motor then we have to same logic on both input pins of L293D i.e it should be HIGH or LOW.

write this code on ubuntu server:-

from boltiot import Bolt
api_key = “Your api key which is in bolt cloud”
device_id ="Your device id "
mybolt = Bolt(api_key,device_id)
while True:

so this will rotate first dc motor .

Hope this will helpful for you.
Mayur jain

@JAINMAYUR1997 The 9/12V pin has to be connected to external battery or just the 5v is enough for it?
Thanks a lot for your effort. It really helped me in clearing all the confusions i had. Now i can proceed with my project. Thank you!!

Basically you can connect with external battery or can be 5v .if you use external battery then speed of motor will increase. And motor will be also rotate if you will give 5v to these pins but speed of motor is not much more.

Thanks for your compliment !:slightly_smiling_face::slightly_smiling_face::slightly_smiling_face:

1 Like

@JAINMAYUR1997 Ive this kind of motor driver with me. Im just confused with its pin configuration to connect 2 DC motors along with input pins to bolt module. Can you please help me with this configuration?