Is a transistor necessary?

Hi! I'm using in my project two PNP transistors to control this SD card module and this GPRS/GSM module.

My question is, are necessary the transistors or I can control these modules with the digital pins? Someone said me that transistors controlled by digital pins waste less power than digital pins, but I think that they are unnecessary if I have an Arduino and its fabulous digital pins, or not?

Thanks.

What do you mean by "control"? How have you got things wired up?

This information is vital for a sensible answer.

Someone said me that transistors controlled by digital pins waste less power than digital pins,

Don't believe what inexperienced people tell you. You can tell they are inexperienced by the use of the words "waste power" in this context.

Sorry Grumpy_Mike. Look the attached image for a better understanding of my question.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :)

Hi,
c4e67b8129e5bd934001037c18a7a92ceb28c1b4.png
No I’m sorry that is not a circuit diagram.
Please a diagram with labels on leads, pins and components.
That is not how you use PNP transistors.

Can you tell us your electronics, programming, Arduino, hardware experience?

Thanks… Tom… :slight_smile:

PinaGamer: Sorry Grumpy_Mike. Look the attached image for a better understanding of my question.

Hi PinaGamer. Since you are using Fritzing, please click on the "Schematic" tab (rather that the "Breadboard" tab) near the top of the screen and export that to png.

A breadboard layout is not a circuit diagram!

Basically you should not be trying to turn off the power to a device on the SPI bus at all.

Hi again, next time I will do the schematic circuit first.

TomGeorge - I’m not an electrical engineer but I’m studying computer science. I have some experience with Arduino (for example, I made a beverage machine using the l293d to control the motors). I think that the transistors work in saturation mode. So for that, I think that I can remove transistors and connect the Vcc pins to the digital pins 3 and 2 directly (look the schematic).

Grumpy_Mike - What? I don’t understand you. But SPI pins were wasting power so before switch on/off the SD card module, I’ve used SPI_end() and SPI.begin() statements to reduce power consumption.

I’m not worried about if I can connect the Vcc pins to the digital pins because I know that I can do it but the question is the same, are the transistors necessary in this case to reduce power consumption?

I’m not worried about if I can connect the Vcc pins to the digital pins because I know that I can do it

From the specs in the link for the GPRS/GSM module

  • Working Current: maximum of 2A

Just because you can do it does not mean that you should.

If you want to switch the power to either of those modules, yes you need a transistor. It you are happy to leave them powered up, then of course you don't need them.

Neither module can be powered from a logic pin.

Grumpy_Mike - What? I don't understand you.

Sigh. There is a great deal you don't understand. You don't understand you need resistors in the base of a transistor. You don't understand how to draw a schematic. and you don't understand what happens when you remove the power from a device yet still have active signals going into it. You are also wasting power by having a pull down resistor on the switch rather than using the external pull up resistors.

But SPI pins were wasting power

Stop it, they are not wasting power. When not in use these devices will be in standby using ( not wasting ) very little power. When you send a signal into a device that is not powered the inputs look like a diode short to the power and ground rails. That:- 1) puts way more current into the device than a powered device on standby. 2) generates some phantom powering that can damage the device. Having two devices connected to the SPI and only powering one of them is a very bad thing to do.

before switch on/off the SD card module, I've used SPI_end() and SPI.begin() statements to reduce power consumption.

It makes no odds because the SPI pins are active if any one device is active.

I'm not worried about if I can connect the Vcc pins to the digital pins because I know that I can do it

No you can't, not without damaging your Arduino.

So in conclusion you do not save any power by doing this you actually increase the power usage and you damage the devices. Plus the lack of any base resistors on the transistors is not only wasting more power than any potential saving, it is also over stressing the Arduino pins that drive the transistor.

Grumpy_Mike

There is a great deal you don’t understand. You don’t understand you need resistors in the base of a transistor. You don’t understand how to draw a schematic. and you don’t understand what happens when you remove the power from a device yet still have active signals going into it.

Okay, so I’ve understand why it’s important to put a resistor in the base of the transistor (Ohm’s Law). In fact, the GSM module does not work properly now, so the reason can be due to I didn’t put this base resistor.

You are also wasting power by having a pull down resistor on the switch rather than using the external pull up resistors

I don’t understand what you refer to external pull up resistor. Do you refer to connect the switch to the Vcc instead of a digital pin?

Stop it, they are not wasting power. When not in use these devices will be in standby using ( not wasting ) very little power.
When you send a signal into a device that is not powered the inputs look like a diode short to the power and ground rails.

This project needs to use the lowest quantity of power as possible. So SD card can’t be in standby mode. As well as, the project uses the SD card few times.

It makes no odds because the SPI pins are active if any one device is active.

It’s logical, but when the transistor is in cut-off mode the current of SD card pins is not 0! Why? I don’t know.

I was thinking again the importance of the base resistor. In any case, is it possible that the A6 module contains an initial resistor to protect the circuit from crazy people like me? Thanks to it, base resistor wouldn’t be necessary, or am I wrong again?

Thanks

What module? The datasheet or schematic will tell you what's in it.

In fact, the GSM module does not work properly now, so the reason can be due to I didn't put this base resistor.

No, you put the wrong value of resistor in the base. What value did you use?

I don't understand what you refer to external pull up resistor.

Sorry I meant you should use the internal pull up resistor not use an external pull down resistor you have in your button. Read http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

but when the transistor is in cut-off mode the current of SD card pins is not 0! Why?

I told you why, it is phantom powering, or sometimes called parasitic powering.

is it possible that the A6 module contains an initial resistor to protect the circuit from crazy people like me?

What is this A6 module? I doubt it has any such protection because it would make some stuff not work.

or am I wrong again?

Yes.

Designing a low power system is difficult, it requires more knowledge than a normal design. But you have not got the knowledge ( yet ) to do a normal design so you are piling errors on top of misconceptions.

If you want to turn off the power to a device, first of all you have to use top switching not bottom switching like you have. You can not do this on an SPI bus without either:- 1) cutting the power to both devices or 2) having two SPI buses. There is only one hardware SPI bus on an Arduino Uno so if you want a second you have to bit bang it.

Grumpy_Mike

No, you put the wrong value of resistor in the base. What value did you use?

I didn’t put any base resistor. Please, see the image attached to this message to appreciate this.

What is this A6 module? I doubt it has any such protection because it would make some stuff not work.

The A6 module is a cheap GPRS/GSM board.

If you want to turn off the power to a device, first of all you have to use top switching not bottom switching like you have

Why do I need to use top switching instead of bottom switching?

  1. cutting the power to both devices

Do you refer to cut to power to the Arduino and the module that you are using? Can I cut only the power to the SD card and control its pins using more transistors? It’s too much confusing to me.

Thanks for your help!

Do you refer to cut to power to the Arduino and the module that you are using?

No. You have the SD card and the GSM card, both are on the SPI bus. You currently cut the power to each device. What I am suggesting is that you cut the power to both of these and power them up at the same time using the same circuit. Before you do that you have to change all the output pins on the SPI bus into inputs, and restore them to outputs after you switch the power on again.

Why do I need to use top switching instead of bottom switching?

Because with a bottom switch the ground for your switched device(s) is sitting at least 0.7 to 1.2V above the ground of the Arduino. This can cause problems, where as with top switching the 5V rail is 0.7 to 1.2V below 5V with the ground being the same which is much less of a problem.

I didn't put any base resistor.

Sorry I thought you were taking some advice and then saying it did not work. With transistors wired like this you always need something in the base to limit the current. This applies to the PNP transistors you should be using for top switching.