I'm a programming student and I got into an Arduino class this semester. Here's some backstory behind this question:

I need to make a Bluetooth module switch modes from master to slave and back, but I found out that the module only switches modes by being unpowered then powered again (and doing some specific things). This means I would have to unpower it manually by unplugging its power, but that'd mean it wouldn't be completely automated, so it's a no-no.

Because of that, I'm considering using a relay to be able to power it down then back on again via code, and found some relays that can be controlled by supplying 3.3-5 V.

However, all relays I've seen state that they work on 30/110/220 V.

So, if I use 3.3/5 V to control the relay, and 5 V to power the module through the relay, will the circuit through the relay work?

  • \$\begingroup\$ a relay is just a mechanical switch .... technically, it does not power anything ..... it can be replaced by a piece of wire ..... so, if the circuit will work when a piece of wire is inserted, then the relay will also work .................. that said, are you sure that the module does not have a reset pin or a reset command? ..... resetting the module may be the same as power cycling the module \$\endgroup\$ – jsotola Nov 15 '18 at 20:01
  • \$\begingroup\$ Yeah, I probably made some bad wording there, but I mean that: if I can supply enough power to switch the circuits, can I pass any voltage through the circuit, right? \$\endgroup\$ – RafaP Nov 15 '18 at 21:15
  • \$\begingroup\$ It has! There's a EN pin which, when not powered, disables the module. I tried it and it works. I just need to test if disabling the module actually turns it off(for resetting purposes), instead of just making it stop until enabled again, else I'll still need a relay. Thanks! \$\endgroup\$ – RafaP Nov 15 '18 at 22:17
  • \$\begingroup\$ An Hc-05. By the way, it works! The EN pin counts as powering off. I still need a relay to supply 3.3V to a pin so it can enter AT mode, but thank you so much! \$\endgroup\$ – RafaP Nov 15 '18 at 23:39
  • \$\begingroup\$ No, I don't have a relay right now, so I can't test myself. For the bluetooth module to enter AT command mode, I need to supply 3.3V(PWM doesn't work, it has to be the 3.3V out from the board) to a KEY Pin on the side of the board while the board is off, then turn it on. To turn it off, the EN pin must be off, which I can do via arduino. So the only problem now is that I need a relay to shut off the 3.3v to this KEY pin so I can exit AT command mode and go back to master/slave modes. \$\endgroup\$ – RafaP Nov 16 '18 at 0:18

This could work. The voltage requirement you must meet is for the coil. The contacts are rated for the maximum voltage they can safely interrupt. You will start to run into problems with the contacts with very small voltages, but 3.3V is high enough for the vast majority of relays out there to not have a problem.

| improve this answer | |
  • \$\begingroup\$ So basically as long as I can supply 5v to switch the circuits on/off, the circuit itself carries any voltage up to the max switching voltage? \$\endgroup\$ – RafaP Nov 15 '18 at 21:04
  • \$\begingroup\$ That is correct. \$\endgroup\$ – evildemonic Nov 16 '18 at 15:44

Depending on the current the module consumes, you could power it directly off one of the digital outputs of the Arduino, or if it's more than that use a P-FET to switch the supply to the module, but there are plenty of relay modules available that can run from an Arduino, they have a transistor on board that reduces the load the 5V coil takes from the Arduino output.enter image description here

| improve this answer | |
  • \$\begingroup\$ Powering the module straight from the arduino... of course! I had completely forgotten that my board suports this. arduino.cc/en/Tutorial/PWM If I put on a 100% duty cycle, it'll be supplying a steady 5V until I disable it, which solves part of the problem(or the entire problem, if the HC-05 I'll use has a KEY pin). Thanks! If the HC-05 does not have a KEY pin however, I still need a relay(instead of 2), so I can supply a steady 3.3v (pwm simulates 3.3v, but by floating between on and off, so it won't work). \$\endgroup\$ – RafaP Nov 15 '18 at 21:12
  • \$\begingroup\$ Digital out is better than pwm for this. But I'm sure your Bluetooth module uses more than 20 ma. So a relay is best. A transistor could work too. \$\endgroup\$ – Passerby Nov 15 '18 at 21:20
  • \$\begingroup\$ I just tried it and unfortunately the module does not turn on when trying to power it through PWM/Digital high. It only turns on when connected to 5v. \$\endgroup\$ – RafaP Nov 15 '18 at 21:44
  • \$\begingroup\$ I tried mine and it does power on, but the spec sheet for the module says current consumption is about 10mA and 30mA once connected, so it's a bit much for a direct connection. \$\endgroup\$ – Phil G Nov 15 '18 at 22:01
  • \$\begingroup\$ Apparently my module has a pin that disables the module when not powered(the EN pin), so hopefully I can just leave the Vcc connected to the 5V out and just use the EN pin for rebooting. I just need to test now if using this pin counts as "powering off" for changing into AT command mode. \$\endgroup\$ – RafaP Nov 15 '18 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.