Question about sharing Linvor Bluetooth whilst uploading

Hi,
I have a linvor bluetooth board, the kind with 4 header pins that works off 5v.

As long as I unplug it while uploading software to the Arduino, it works fine.

Because it shares the tx/rx pins, I cannot leave it plugged in while uploading.

Is there a way to disable it whilst uploading? Or should I simply use NewSoftSerial to use 2 different pins? (Though I believe this creates a cpu overhead?)

The thing is, I would like to solder up a permanent solution using a protoboard, but I also want to be able to change the software.

Is there an alternative 5v power line that turns off while uploading? That would be ideal.

Thanks,

Brian Williams

Just use a transistor to switch the 5V power to the bluetooth board. In your sketch you just have to drive the associated pin HIGH a few seconds before you use the bluetooth or directly in your setup routine. This way you have your alternative 5v power line with just a transistor and a resistor.

Not a bad idea. Do you know off the top of your head whether the Arduino IDE sets any digital pins to a known state before uploading? I'd need the bluetooth to be turned off automatically if it had already been on, you see.

Also, I'll need a constant 40mA going through the transistor, so dissipating some 200mW. Wouldn't it get a bit hot? Would I need a power transistor with a heat sink? I'm a bit rusty on this.

Thanks!

Brian Williams

Before the uploading starts the Arduino is reset (by the DTR line of the serial interface). On reset the ATmega328 resets all digital pins to mode INPUT, so no power is supplied to your transistor until you explicitly set the appropriate pin to mode OUTPUT and it's value to HIGH.

I'm not an electronics expert but my cheap transistors are switching the power for a laser diode consuming more than 0.5W and doesn't get hot.

40mA are almost within the limit for using an Arduino output pin directly, although I'd always go for the transistor version.

Great!

Many thanks, I'll try it.

Brian Williams

Well, it was a good idea, but it didn't work. I'm guessing it is because the BT device still sinks the tx and rx pins, because although the light isn't flashing, the upload cannot complete.

Anybody got any suggestions?
Thanks

Brian Williams