Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MCU controlling BT module with NPN transistor

Status
Not open for further replies.

Urahara

Member
Hi

I would like to have my pic MCU turn on/off a bluetooth module via a NPN transistor. Previously I had connected only one of the BT's ground pin (pin 13) to the collector pin of the transistor. It didn't work. The BT module just cannot be turned off.

I suppose I had to connect the 3 ground pins on the BT module. See attached. Is this the right way to do so? Thanks!

MCU-BT.png
 
You would use an PNP or PFET to switch the positive power supply to HC-06 chip; not break the ground....
 
You would use an PNP or PFET to switch the positive power supply to HC-06 chip; not break the ground....

It's perfectly valid to switch the ground side, and no different to switching the +ve side - it's only a 'convention' to switch the positive, and prior to that the 'convention; was to switch the negative :D

I'm presuming the OP is planning having a resistor feeding the base?, and (for NorthGuy) switching this way will lose very little voltage, and 'possibly' less than an FET.
 
It's perfectly valid to switch the ground side, and no different to switching the +ve side - it's only a 'convention' to switch the positive, and prior to that the 'convention; was to switch the negative :D...
It is NOT valid if there are low inputs to a logic chip. You can get some weird behaviors when you float the ground pin on the logic chip, and the chip tries to find a ground by forcing unnatural currents into the low outputs of the driving logic sources...

It can also "latch up" the logic chip
 
It is NOT valid if there are low inputs to a logic chip. You can get some weird behaviors when you float the ground pin on the logic chip, and the chip tries to find a ground by forcing unnatural currents into the low outputs of the driving logic sources...

It can also "latch up" the logic chip

Just as bad removing the positive supply, and leaving inputs high from the micro - essentially in either case you have to set the I/O pins accordingly.

Without the rest of the circuit (and the software) though we're all just guessing :D

Assuming micro and module run off the same supply?, how about feeding it directly from an I/O pin (or a few paralleled) - but again, no specs on micro or module.
 
There should indeed be a resistor between the mcu pin and the npn in the picture (missed that one, sorry).

I am less familiar with fet and a quick search suggest that it has a minimum voltage requirement. My circuit is only 3.3v. What component should i use and how should they be connected? i tend towards a pnp solution but am open to the fet possibility.
 
If you want to consider a FET, you should look for so called "logic level" MOSFET. I looked at Digi-key and there are hunderds of FETs matching your criteria, for example this one:

**broken link removed**

FET connects very similar to BJT. It has 3 terminals - gate, which plays the same role as base in BJT, drain takes place of collector, and source takes place of emmiter. It's a good idea to connect a rsistor (1M or so) between gate and source to prevent the FET from accidentally turning on when gate is floating.

If you want to switch on the high side, you can use a P-channel FET for that.
 
Was re-reading Nigel's #7 post.

The BT module consumes max 50mA. If we can feed two MCU pins into the 3.3V pin of the BT module, then that would be a fuss-free way to turn on-off the BT module. Saves me some money too :joyful:.

Can this be done?
 
Was re-reading Nigel's #7 post.

The BT module consumes max 50mA. If we can feed two MCU pins into the 3.3V pin of the BT module, then that would be a fuss-free way to turn on-off the BT module. Saves me some money too :joyful:.

Can this be done?

Yes, that's why I suggested it :D

Give it a try and see - you might find that using more pins (I'm presuming you have plenty spare?) help to keep the voltage up.
 
Just tried combining two mcu pins to the 3.3v pin of the BT module but does not seem to be working.

Looks like I am back to exploring the fet or pnp options.
 
Just tried combining two mcu pins to the 3.3v pin of the BT module but does not seem to be working.

Looks like I am back to exploring the fet or pnp options.

You are asking each of the two pins to source ~25mA each. I would be surprised if the Vdd to the RF chip would get higher than about 2.5V...
 
About 1 volt unfortunately with part of the circuit on a breadboard. What's the theoretical explanation for such low voltage?
 
Last edited:
About 1 volt unfortunately with part of the circuit on a breadboard. What's the theoretical explanation for such low voltage?

My guess is that you accidentally turned one pin high and the other low for relatively long period of time, after which one of the pins (or both) burned down.
 
The current measured was about 40+mA from both pins. At software level one pin was turned on immediately after the other.

don't think pin was burnt as they seem to be still working
 
Hi All

Just to close off the thread...found a PNP transistor and set up the circuit on the breadboard. Working now! :)

Thanks to Nigel, NorthGuy and Mike for the advice! Part of the fun is testing out different ideas! :woot:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top