The two power source options we will consider for powering our wireless sensors are battery power and an AC line powered DC power supply. What I mean by “AC line powered DC power supply” is the low cost constant voltage power supplies that often come with consumer electronics or that can be bought standalone from places like Radio Shack. In the below picture is an example of low cost DC power supply that puts out a constant 12 VDC and up to 200 mA.
Before deciding on a power source, lets first cover the need for a voltage conversion stage in our sensor designs. Whether we use a power supply or a battery pack they probably will not output the exact voltage we need for the sensors, which is 5 V for the controller and approximately 3.3 V for the routers hence the need for a voltage conversion stage. For doing voltage conversion there are two main options available: voltage regulators and DC to DC converters. Each has their advantages and disadvantages. Voltage regulators are low cost and less complex, but are less efficient (more power loss in the conversion process). DC to DC converters are more efficient, but are more complex to implement and can be more expensive. Let me add explanation around the complexity of DC to DC converters. When you implement a DC to DC converter you need to add a lot of “supporting components” (resistors, capacitors, inductors) at the input and output of the DC to DC converter to have it operate correctly, which is beyond the scope of this post. But there is a way around it, some companies sell DC to DC converters with the “supporting components” already built-in. These DC to DC converters are easy to implement like voltage regulators, but still deliver great efficiency. Their downside is cost, they will easily be 5 or more times the price of a voltage regulator.
Which voltage conversion method you use in your design depends on factors such as power efficiency needs, budget, project time table. For instance, is power efficiency critical to your design? If your sensor needs to be battery powered and it is going to be located in a place where it can not be easily accessed than you probably want to go with a DC to DC converter. If your sensor will be near a power outlet or if changing the battery and recharging it is easy than the voltage regulator is a good choice. In this tutorial we will us both conversion methods for example purposes.
- For the controller the Arduino Uno has a built-in voltage regulator at the power input connector that takes 7 to 12 VDC power source and converts it to 5 V to power the Uno. A 9 V DC power supply will be used to power the controller. The power supply was obtained from an old cordless phone.
- For sensor 1 (XBee router with temperature sensor) we will use the LM317 voltage regulator for the conversion stage. This is a common low cost regulator that has an adjustable output voltage. You can find it at RadioShack. The datasheet, which you can easily find online, explains how to set the output voltage using basic components. For instructions on how I set the output voltage to 3.3 V for this project see the last section of this post. The power source we will use is a 7.4 volt Li-ion polymer rechargeable battery pack.
- For sensor 2 we will use the TSR12433 DC to DC converter that requires no external components, just plug in and go. This was $15 and it was purchased from Adafruit. The power source we will use is four series Alkaline batteries. You could easily get away with three series Alkaline batteries, four was used because I had a holder for four batteries.
- The 7.4 V Li-ion Polymer is rated for 2200 mAh or 2.2 Ah.
- The Ah ratings for Alkaline batteries varies widely depending on the brand, a good rule of thumb is the higher the cost the more Ah you are getting. We will use the conservative estimate of 1500 mAh or 1.5 Ah for each battery so a total of 6000 mAh or 6 Ah
- Sensor 1 --> 2200 mAh / 16 mA = 137.5 hours of battery life or ~ 6 days
- Sensor 2 --> 6000 mAh / 7 mA = 857.1 hours of battery life or ~ 36 days
The LM317 is a widely used low cost regulator. It is great part to keep in stock around you electronics lab bench since its output voltage level is adjustable so you can fit it into any project you are working on. It is made by a couple different manufacturers including Fairchild, you can find its data sheet by following the link: http://www.fairchildsemi.com/ds/LM/LM317.pdf. The figure below is from page 5 of the datasheet and it shows the circuit setup and equation to set the output voltage level to the value you desire.
R2 = (Vo*R1)/1.25 - R1. Now we just need to plug in our known values which are 3.3 V for Vo and for R1 I used a 301 Ohm resistor that was laying around. plugging in our values to the equation we get 494 Ohms for R2. To implement R2 a 1 kOhm adjustable resistor was used. The resistor was adjusted to about ~500 Ohms. I then connected its input to the battery and its output to the sensor. I used a DMM to measure the resulting output voltage of the regulator and fine tuned the resistor value to get exactly 3.3 VDC, the desired output voltage.