Hello,
I am trying to save some electricity by turing off the SD card reader of my Arduino setup (battery powered). For that I am using NPN transistor. The transistor works well, but when I take the 5V off the SD card reader, the LED on card reader still illuminates (although dimmed). I think that it is because I have connected the other SD card reader pins to Arduino "PWM" pins (MOSI -> D11, SS -> D10, SCK -> D13, MISO -> D12).
I am also using Arduino deep sleep using RTC DS3231 to wake it up every 15 minutes.
How to turn off the power completely to SD card reader?
A NPN needs to be in the low side (switch ground) to work properly. A NPN transistor in the high side (switch Vcc) is not right. A PNP is appropriate for high side switching.
Many devices do not like to have their ground switched.
There is more to turning off the SD module than just cutting the 5V. Arduino outputs that go to the SD module should be set to input before turning the power to the SD module off to prevent "back powering" the module.
In electronics we find verbal or written circuit descriptions lacking. We use the schematic diagram to communicate the circuit. Here is a NPN low side switched SD module schematic.
Now, like I have said, low side switching will likely not work as the module will not like having its ground switched (power is still on the 5V input).
If you must switch off power to the module use high side switching and mind the inputs.
If I would like to put the transistor to the "Low side"
It is not a question of "like". People do not use a low side switch on logic circuitry because GND is not GND, from one part of the circuit to another.
Use a high side switch for logic modules and sensors. Use a low side switch for motors, relays, and lights.
It is common sense (?) that a switch should be connected to the positive side of the energy source.... for example a light switch in a room must disconnect the wire from the positive side because otherwise a human can be ground when changing the light bulb.... therefore lifethreat....
The SD card module uses a linear regulator to reduce 5V to 3V3. If it can work with the reduced voltage (let say 4V; I doubt it) it will be fine with the high side switching using NPN. But use no base resistor in this configuration. And can this transistor handle the current a SD card needs?
I don't see some great advantage in the high side switching vs low side switching. You need to ensure phantom powering via communication lines does not happen in either case; in general you can do this in both configurations with similar effort.
Fredx:
It is common sense (?) that a switch should be connected to the positive side of the energy source.... for example a light switch in a room must disconnect the wire from the positive side because otherwise a human can be ground when changing the light bulb.... therefore lifethreat....
Dont confuse yourself.
Most all 'light switch in a room' setups use alternating current, so the terminals of the light bulb are not 'positive' relative to ground, but are switching rapidly between 'positive' and 'negative'
Yes, i know that alternating current is periodically reversing the direction. But when using the contactless "voltage pen tester" it distinguishes the positive and the ground (neutral) wire... the light switch in a room should disconnect the "postive" wire..
For example "Non contact voltage tester"
that helps the distinguish which wire to install the light switch in an apartment room
You can't conflate domestic electrical practices with electronics. Of course a lot of the basic principles of electricity still apply but as you mentioned, you want to be switching the live conductor of a light. This is because there will still be 240 at the fitting despite it being off, and it could could go to ground through you when you change the bulb.
5V isn't going to kill you. If you're taking the card in and out with the board still live though, it could be prudent to switch on the high side - not for your protection but for the cards.
Try not to go on a crusade, at the end of the day you're using a transistor that's specifically designed for low-side switching.
You must however, set all pins which connect to the SD card module to INPUT before you switch off the transistor and restore (re-initialise) the SD card code after switching it back on to use it again. It is as simple as that and will work just as well as high-side switching (which also requires you to disable all the interface pins).
In short, if the transistor will disconnect the ground side, you must ensure that there is no other connection to ground whether through an I/O pin or any other path (such as the frame of the card holder).
Hello!
I am trying to make a battery powered temperature logger. For minimizing the current between the measurements (15min) I would like to turn off the SD card reader using a transistor. I have seen that a resistor is used between the "base" of transistor and Arduino digital pin. My question is what kind of resistor do I need if the SD card module uses 5V from Arduino? Some use 1K Ohm, others 2.2K Ohm resistor.
The resistor I am using is NPN-type (KT972A) and the parameters:
Maximum Collector Power Dissipation (Pc): 8 W
Maximum Collector-Base Voltage |Vcb|: 60 V
Maximum Emitter-Base Voltage |Veb|: 5 V
Maximum Collector Current |Ic max|: 4 A
You should have all your questions for the same project in one thread.
We might miss details if you keep spreading it.
Base current needed depends on collector current, and should be about 5-10% of collector current for switching, depending on the type of transistor (signal, medium power or power).
Say the SD card uses about 200mA, then base current should be 10-20mA.
Since you're on battery power, calculate for 5%.
If you're using a 5volt Arduino (probably in your cross-post), I calculate (5-0.7)/0.01= 430ohm.
390 or 470 ohm would do.
Leo..
The temperature logger is almost ready. Although as I am doing it on breadboard, I would like to remove the capacitors and the crystal. I have read that it is possible to use the internal clock that is inside the ATMEGA328P. Saves some space. In the end I am putting the logger into a plastic tube, maybe a small PVC pipe and use it as underwater temperature logger to detect the upwelling effect (due to wind) that causes cold water to rise from the bottom of the sea.
Also, I am not so sure about the DS3231 RTC module precision, because it has drifted about 10 seconds since I set it up (15 days ago).