I'm making a data logger that uses a Pro Mini (3.3V), DS3231 RTC, and an SD card module. The whole thing is to be powered by a single cell Li-ion battery.
The Pro Mini and DS3231 should work perfectly well with the supply voltage range of the Li-ion battery (~3.5V to 4.2V). However, as I'm sure many of you know, an SD card will likely be damaged by a supply voltage that is greater than 3.6V.
The SD card module that I have (link to the module is below) can be supplied with either 5V or 3.3V, and 5V is reduced to 3.3V on the module by an AMS1117 regulator. The problem here is, if I connect the Li-ion to the 3.3V input of the module, the battery voltage will be too high for the SD card. If I connect the Li-ion to the 5V input of the module, the battery voltage can be below the minimum supply for the AMS1117 regulator.
I've had a good look through various forums and haven't seen any meaningful solution to this.
Off the top of my head, I'm thinking I could connect the Li-ion battery to the SD module 3.3V with a diode in between. The 0.7V forward voltage drop across the diode would ensure that the maximum voltage supplied to the SD card would be 3.5V (4.2V - 0.7V), and the minimum would be around 2.8V (3.5V - 0.7V).
Anyone have a solution to this, or any thoughts on using a diode to reduce the voltage from the battery?
In such cases I have always used LM317, you will find its circuit online quite easily. There's a variable resistor in it and by changing its value, you can change the output or you can also calculate the fixed resistance value for the required output voltage.
I've never used anything that exactly matches this model number.
But I have experience using other TOREX PMICs.
I think it's a reliable manufacturer.
P.S.
This manufacturer is runned from my country of origin.
Yep, Japan. It ’s not a very rich country right now.
But I think the quality of the manufacturing industry is high.
oliviasmithh900:
In such cases I have always used LM317, you will find its circuit online quite easily. There's a variable resistor in it and by changing its value, you can change the output or you can also calculate the fixed resistance value for the required output voltage.
LM317 is a very famous regulator.
However, I don't think this requirement can meet the specifications.
Because it requires a dropout voltage of 1.5V or higher.
An input voltage of 4.8V or higher is required for the 3.3V output.
I think Andy needs an output of 3.3V from an input voltage of 3.5V.
I've used the LM317 myself a few times too. However, in this instance it's not suitable, the voltage dropout is way too high - the datasheet states the minimum dropout is 3V! My application needs a dropout of around 100mV.
Is there a linear regulator with the same package and pinout as the AMS1117 on that module, but with a much lower dropout voltage? In other words - a better performing drop-in replacement?
larryd:
If your SD module can be powered by 5v, use a boost converter (MT3608 DC to DC Step Up Converter) on the battery to get 5v.
The input voltage must be > 2 v, has 93% efficiency.
Thanks Larry,
I see how that would work, however, because it's battery powered, power consumption is an issue. I fear that boosting the Li-ion voltage up to 5V only to have it then stepped down to 3.3v by (a lossy) linear regulator (AMS1117) wouldn't be the most power efficient option (even with the MT3608's high efficiency).
I suppose the ideal thing would be a step-down converter with similarly high efficiency and low drop out, do you know of any devices with these features? (Just to note, any LDO regulators that I've seen are linear devices, and so are wasteful because the power difference between input and output is simply dissipated as heat)
ShermanP:
Is there a linear regulator with the same package and pinout as the AMS1117 on that module, but with a much lower dropout voltage? In other words - a better performing drop-in replacement?
Thanks Sherman,
That would be a good solution. My brain has been spinning trying to understand all the various voltage regulators that are available, do you know of any that might fit the bill?
Also, do you know of any high efficiency LDO regulators?
(Just to note, any LDO regulators that I've seen are linear devices, and so are wasteful because the power difference between input and output is simply dissipated as heat)
A linear regulator operates by dropping the input voltage to the regulated output, acting as a resistor. So the most efficient linear regulator in the world is still going to dissipate as heat (i.e. - waste) power equal to the voltage drop across it multiplied by the current going through it. So to make it as efficient as possible, you try to have the input voltage as low as possible while still providing the regulated output. A regulator with a very low dropout voltage would let you continue to run as the battery discharges, but is still going to waste some power when the battery is fully charged.
The AMS1117 on your SD module appears to be an SOT-223 package, and the pinout, from left to right, is Ground - Output - Input, with the tab at the top connected to Output. Others here may want to check me on the SOT-223. There are a number of regulators with much lower dropout voltage, but the ones I've found have a different pinout. Maybe someone here knows of one that's a direct replacement.
Of course you can always build any regulator you like into your circuit, along with a couple capacitors, and feed its ouput to the 3.3V pin of the SD module. That would bypass the AMS1117, or you could just remove the AMS1117 from the module. But it would be nice to find a drop-in replacement.
Andy_C_:
(Just to note, any LDO regulators that I've seen are linear devices, and so are wasteful because the power difference between input and output is simply dissipated as heat)
That's the nature of the beast.
Don't worry too much about it. Quiescent current is far more important in most applications, as most of the time your SD card will be idle. Just get one that drops <300 mV or so, and can deliver the 500 or so mA the SD card needs when it writes data (I forgot the exact number, it does now and then draw such spikes), and you'll be fine. If the input voltage drops too low the output just drops with it. The SD card can work at a bit lower than 3.3V just fine.
One other thing you might want to think about is that the Pro Mini will draw more current running at 4.2V than at 3.3V. So it's not necessarily the case that you will maximize battery life by powering the Pro Mini directly from the battery. If you regulate the battery power down to 3.3V, even with a linear regulator, you may consume less power because the processor is drawing less current. So if battery life is crucial, it might make sense to run the power for the whole circuit through a switching buck regulator producing 3.3V, or if everything would still work, 3.0V, or even 2.8V. I think the 328P on the Pro Mini would work fine at 8 MHz at 2.8V, and the DS3231 will work at almost anything. The question would be the SD card. I don't know how much below 3.3V they will still work, and it may depend on the brand.
If you run the Pro Mini at 3.3V, you would not need the regulator or level shifter on that SD module. You could use a simple microSD breakout module, which basically just has the card holder and headers.
Edit: Here's an example of a pretty basic microSD breakout module. It has a couple capacitors and it looks like pullup resistors on the four lines, but no regulator and no level shifter. Some are even more basic, with just the card holder and the headers. This is the kind of module you can use if everything is running at 3.3V.
Edit2: On reflection, I don't think a buck converter will work. It would require close to a volt of headroom to give you regulated 3.3V output, so it would only work properly when the battery is fully charged. A buck/boost converter would work if it provides a 3.3V output from 2.5-4.2V input, but its efficiency probably wouldn't be very good. So I think it comes back to a linear, very low dropout, regulator for just the SD card, or possibly for the entire circuit if that produces the lowest battery drain.
BTW
If you have one inductor, one diode and one capacitor...
Yep, and just need transistor.
AVR microcontrollers can provide a step-down DC-DC converter.
With a timer? ... and an AC or ADC... you can do it!!
I would expect a datalogger to be in deep sleep most of the time - with the Pro Mini drawing some 1 µA most of the time, just waking up every now and then to take a reading, write it to the SD card, and go back to sleep.
And now it gets tricky as indeed increasing the voltage and with it the clock frequency could actually save power as the wake time is shorter. Hard to calculate which one is best.
But for sure in this scenario the quiescent current of the regulators becomes a major factor in the overall power consumption. A regulator with enable pin can help cut on that, so you can switch on the power to the SD card only when it's needed.
Don't forget the level shifting! Common is an 74LVC125 or 74LVC126 as they have high voltage tolerant inputs.
Thanks guys, some really good points raised there.
Sherman, I like your idea of running all of the boards from a single regulated 3.3V supply - resulting in lower power consumption from the Pro Mini, and it keeps things simple from a logic level perspective (i.e. no level shifting required for the SD card). In answer to your question, the SD card standard says 2.7V-3.6V supply range, so running everything at 3V or 2.8V should also work.
wvmarle, I also like your point that the wasteful nature of linear regulators is somewhat moot. I intend the the system to log data every 15 minutes, so the Pro Mini will be in deep sleep mode for around 99.9% of the time. The current consumption will be tiny (10s of uA range), and so the wasted power of the regulator will also be tiny for 99.9% of the time. However, as you said, it's important ensure the regulator has a low quiescent current.
This is just a personal project so I probably don't need to get into the minutiae of power consumption difference between higher and lower clock speeds vs awake time, although I do appreciate you raising the point - it's food for thought in the future!
So, the most promising sounding option is to use a simplified SD card module, and power everything from a 3.3V (or lower) LDO linear regulator with low quiescent current.
The only problem with that is that the SD card may not sleep very deeply at all. If it draws several milliamps when idle, you may need to add a mosfet to switch off power to the SD card while the Pro Mini is sleeping.
There are also characteristics of the DS3231 RTC which will affect how soundly it sleeps. Let me know if you want info on that.
SD card: easy to force asleep by disabling its regulator (the second reason of getting one with enable pin).
The DS3231 can be powered through its VBAT pin for very low power consumption. I still don't know of any real downsides of this, there must be a reason for the separation from the Vcc pin... A pair of (Schottky) diodes can help autoselect the power source: regular Vcc or backup battery.
ShermanP:
The only problem with that is that the SD card may not sleep very deeply at all. If it draws several milliamps when idle, you may need to add a mosfet to switch off power to the SD card while the Pro Mini is sleeping.
There are also characteristics of the DS3231 RTC which will affect how soundly it sleeps. Let me know if you want info on that.
Yes, I'm thinking of a regulator with an enable pin will allow me to switch power on and off for the SD card module and RTC module. I've seen a few ways to reduce power to the DS3231, but I'd appreciate seeing the info that you have on how it sleeps, thanks!
wvmarle:
SD card: easy to force asleep by disabling its regulator (the second reason of getting one with enable pin).
The DS3231 can be powered through its VBAT pin for very low power consumption. I still don't know of any real downsides of this, there must be a reason for the separation from the Vcc pin... A pair of (Schottky) diodes can help autoselect the power source: regular Vcc or backup battery.
Yes, I think a regulator with an enable pin is a pretty good way to go.
I've seen some info about not using the DS3231 Vcc pin, can you tell me how you would use the diodes to do the autoselect function? Many thanks!