How to connect the 2 relay module to bolt

there are 7 pins to connect “JD-VCC,VCC,GND,GND,IN,IN2,VCC”

You can use other GPIOs on Bolt. For more VCCs and Grounds you can use a breadboard.

I want to on the first relay sir for that if I give the IN1 to the gpio pins and the GND To gnd on the bolt is it correct sir???..

That seems to be correct.
Note: Be extreamly careful with relay experiment as you are working with 240V.

i got the output sir but when i am giving the “high” state to the pin bulb is going off and when i’m giving the “low” state it bulb is going on

That depends on your circuit connection. Just check which pins are connected to ground and which pins to VCC. That will solve it for you. BTW do share a video of your output.

Note: you can not upload videos directly on this forum. Upload on youtube and embed the link.

output

2 Likes

Awesome work @gowthamkrishnateja

1 Like

I hope that was because your NO & NC was interconnected, am I rite @gowthamkrishnateja

yes due to the interconnection between NO and NC this is happens.
when i’m giving the “HIGH state” it is connecting to “NO”
when i’m giving the “LOW state” it is connecting to “NC”

we can change its behavior by changing the connection on relay.

1 Like

@PPV in the experiment above, the module uses a simple amplifier circuit using transistor to power up the relay, but in tutorial, relay is directly connected to BOLT, is it advisable?

Is it done just for teaching only, and for long run, I think we need a amplifier, am I correct, please confirm!

Yes it , advisable to drive relays with a transistor , but with the modules recommended here Recommended Relay Module For Home Automation applications using Bolt

You can safely drive these with the 40mA output current that bolt can drive through its output pins.

2 Likes

That’s cool!!

Just gone through the post of yours.

Thanks.

1 Like

[UPDATE]
Hi, @mariarichy and @gowthamkrishnateja!

The relay board uses an optocoupler to isolate your embedded device from the high voltage appliances being controlled. It is ok to use the Bolt’s VCC to power the relay(JD-VCC) but it would be counter productive. Instead, you can connect a different power supply for powering up the relay. Follow this guide https://arduino-info.wikispaces.com/RelayIsolation.

3 Likes

Connect the VCC and GND pins of the relay to the respective VCC and GND pins of bolt wifi module. Connect the IN1 and IN2 of the relay to the D0 and D1 of the Bolt wifi module.
then connect the bolt iot module to the mobile. Then paste the code on the configuration setup . This is the simple java script:

var dual =dualButton("left");
dual.first_button({name:"Relay1 Off", action:"digitalWrite", 
                  pin:"0", value:"LOW", bgcolor:"blue",
                  shape:"rectangle", text_color:"white"})

dual.second_button({name:"Relay1 on", action:"digitalWrite", 
                    pin:"0", value:"HIGH", bgcolor:"black",
                    shape:"rectangle", text_color:"white"})
                    
                    
var dual2 =dualButton("right");
dual2.first_button({name:"Relay2 off", action:"digitalWrite", 
                  pin:"1", value:"0", bgcolor:"Green",
                  shape:"circle", text_color:"black"})

dual2.second_button({name:"Relay2 on", action:"digitalWrite", 
                    pin:"1", value:"250", bgcolor:"Red",
                    shape:"circle", text_color:"White"})