Voltage Regulation

A project log for Magnificent Moisture Management

I've got a balcony, tomatoes and a micro controller

Michael HaasMichael Haas 11/01/2014 at 12:320 Comments

...or keeping the magic smoke in.

The MSP430 runs at 1.8V-3.3V. The servo, on the other hand, requires 4.8-6V.

I plan on using a 4 cell AA battery pack. With Eneloop batteries, this will result in 4.8V input voltage. Optionally, it should work with five cells. Higher voltage will result in more torque for the servo.

Although the MSP430 can go as low as 1.8V, the DHT22 humidity sensor requires 3.3V-6V. I am not sure so sure about the Voltage for the Chirp moisture sensor. The chirp uses an ATTINY85 which comes in a high-voltage and a low-voltage version. In any case, given the DHT22 and the ESP8266, I will have to come up with a way to generate 3.3V for the logic. The servo will be powered directly from the battery pack.

Several voltage regulars are available. After all, I am not the first person to connect some chips to a battery pack. How do I select the appropriate regulator? Easy, just use the first thing that's available in the Fritzing library: a 7803. Looking at the 7803 datasheet, we can see that it will deliver 3.3V just fine. It also only requires two additional capacitors, which makes it very easy to integrate. Unfortunately, the minimum required input voltage Vin is 5.8V. 4 AA cells won't cut it here.

Another popular option is the LM317, which is an adjustable linear regulator. It also requires that Vin is 3V over Vout. Another possible problem of linear regulators is that can be very inefficient. Wikipedia says:

Linear regulators inherently draw as much current as they supply. When this current is multiplied by the voltage difference between input and output, a significant amount of power is wasted as heat.

The current drawn by the circuit is not very high. I assume that the ESP8266 is the biggest consumer, which, at peak times, draws up to ~300mA if my memory serves me right. So a 500mA regulator should be fine.

A last consideration is the minimum power draw. If the circuit does not draw enough power, the voltage regulator ceases to function properly. For the LM317, the "minimum load required to maintain regulation" is 3.5mA. If I configure the MSP430 properly and disable all peripherals, I should be able to go below that. At least I hope I'll be able to maintain low power consumption in standby. I'm still wondering what happens with the regulator if current draw goes below 3.5mA. Even at 3.5mA, the batteries would only last 24 days.

What we need is a Low Drop-Out (LDO) voltage regulator. LDO means that the regulator does not drop much voltage. Thus, Vout can be very close to Vin.

The LD1117A is a good alternative. Depending on the current draw, the voltage drop is only 1V to 1.2V. This will work fine for the 4.8V supplied by the battery pack, even if the battery is almost discharged. It also requires two capacitors at 10µF and 100nF. I can't find the minimum power draw in the data sheet, unfortunately. The power consumed by the regulator itself, the quiescent current, is 5mA. That's a lot - but I'm running out of power regulators in Fritzing ;)

For now, I will design the circuit around the LD1117A. I will add a diode to protect against polarity reversal and possibly a fuse.

TI has some helpful blog posts on voltage regulators for the MSP430: