power bluetooth module from digital pin

Hello,
Has anyone tried to power a bluetooth module from a digital pin?

This way i can turn the bluetooth module on or off when i need to.

The datasheet claims max power usage of 30m mA, and a Mega claims to deliver 40mA per I/o pin, so in theory it should work.

Just wondering if there is anybody that has tried it before.

Should i use 2 pins, to be safe?

No, you really shouldn't pull that much current from one pin (or 2). Instead, I suggest that you use a transistor :wink:

See this.

Hi guix,
thanks for your reply, sorry it took me a while.

When i try to replicate the setup in the link you provided, the LED does switch on and off with the signal from the digital pin, but the brightness is significantly less than when i connect the led (and resistor) directly to 5v (or digi9).
Am i doing something wrong?
(transitor: BC547B C27, 10kΩ on digi 9, 200Ω on the led)

(have not tried to hook up the BT yet)

thanks

Hello,

I'm far from an expert with transistors (and I don't have a BC547 to test), but try with a 1K resistor instead of a 10K.

What is the model of BT you have?
I just open up command set list for HC-05, and it turns out it has:

  1. Energy-saving mode
    Command
    Respond
    AT+ENSNIFF= OK
    Address
    Parameter
    Param : Device
    Address
  2. Exerts Energy-saving mode
    Command
    Respond
    AT+
    EXSNIFF OK
    =
    Parameter
    Param : Device
    Address

I think powering the BT module from an Arduino pin is perfectly feasible (not on a Due - those pins are pretty weak.)

But, read closely the datasheet. When it is delivering the rated 40mA, the voltage sags down. Can the BT work at this voltage?

Two pins works but when you switch on and off, you must switch them together. Doing two digitalWrite()s doesn't do this. You have to do some direct port manipulation which then makes your program difficult to move to a different processor or board, if you later decide to use a Pro Mini instead of an UNO. For my code which runs on multiple boards and powers sensors from the outputs, there's a lot of #define code.

@guix
1kΩ works better indeed, thanks

@Magician
i have a couple of bluetooth mate gold, and silver units

There are several power management options it seems. That would probably be the safest option.

@MorganS
The simpilicity of just a single digitalWrite() command appeals to me.
I'll give it a try once it is wired up.

thanks everybody

RN-41 supports "Enabling Deep Sleep" :

You can use deep sleep mode to obtain extremely low power operation. In this mode,
the device shuts down completely and only draws about 300 μA of current. T

I tried powering the bluetooth mate gold by setting HIGH port 7 on an usb powered UNO. softwareserial on digiports 2/3.

The BT unit does power up, and does connect to my phone, but characters I send through are not correct.

If I power normally from the 5V pin, all works well, and the chars I send from my phone are displayed correctly on the serial monitor.

So... nothing blew up, but it's not working for now.

I'll try some of the advanced (power) commands next.