Tag: Electronics

Introduction

Lets build a WiFi temperature data logger!! The reason this project came to mind was because I needed to monitor the temperature of an outside enclosure box that will eventually house a couple of lithium ion batteries. Can’t have the box get too hot or else we will end up having a nice backyard campfire.

Hardware/Schematic/Assembly

I’ve designed this project to consist of two microcontrollers. Its not the most efficient way of doing it but it is effective. The heart of this project is the ESP8266-ESP01 IC. It will take in the data from the BMP180 sensor over I2C and send the data over to a web hosting site Thingspeak.com

Schematic:

The schematic is not that all complicated but it is very effective at trying to save as much battery as possible and deliver my data for viewing purposes.

In order to have this be powered by 2x AA batteries and last longer then a couple of days or weeks, I needed a couple of things to make this possible which is where the second microcontroller comes into play.

First, we need to make sure we have a stable power supply that can provide up to at least 0.3A and have a minimum quiescent current in the low uA range.

Thingspeak.com

Before we get started into writing the code on the ESP8266 we need to set up an account at thingspeak.

Click on the signup and fill out the information:

Click on new channel:

The most important information to fill out is the fields, in our case we will fill out field 1 and type in temperature. The name could be any name you want, for this purpose we will write Temperature Data Logger. Once finish, scroll down and click save.

The final piece of information we need is the API key, for this just click on the API Keys button and copy the Write API Key.

Now we can move on to the code.

Click here for step by step on installing the ESP8266 arduino addon.[3]

Its time to show you my 3.3V output boost Converter design. In one of my earlier post I showed you step by step on how to design your own boost converter and if you haven’t read that yet then click here.

Lets get started:

Intro.

First of all, why do we even need this converter? Well every sensor, microcontroller, arduino, ESP8266, and various other digital components need a constant voltage. A constant voltage is necessary to maintain proper operation of these components.

Here we will see the advantage of this boost converter.

Specifications.

Below are the operating specs for this converter

Note: Different Vin voltages gives you different max power output

Bill of Materials.

Here is a screenshot of the bill of materials. I added the suppliers on the spreadsheet because I’ve found that some sites have better pricing than others.

Using octopart.com, you can actually find the best value for the component you’re looking for. I highly suggest you go look at the site.

Schematic.

Attached here is the schematic for this project. All the original files are available for download at the bottom of the page.

Layout.

I figure I’d help you guys out a bit if I added the layout for this board. My approach for this layout was to minimize the overall size in order to get a better price for manufacturing the board.

Testing.

Here comes the fun part, actually testing what you designed. Now one thing that took me awhile to learn was that design and theory never really match reality. There are a lot of different parameters that are not accounted for when designing in theory.

A couple of the major issues that could make or break your design is parasitic elements. One of the biggest parasitic elements is ESR for output capacitors. This is the equivalent series resistance of the capacitor that is not taking into account when designing. In my post that covers the design of a boost converter, I emphasizes this topic to make you aware of this parasitic element.

Now, my design parameters consisted of loading the converter at 3 different voltage inputs (1.8V, 2.0V, and 2.4V). Each input voltage was loaded starting at 0.1A and ending at 0.4A. This load all depended on which input voltage was tested because the lower input voltage cannot provide the max output power.

First test – Vin: 1.8V @ 0.2A

Will add soon.

Next test – Vin: 2.0V @ 0.3A

Last test – Vin: 2.4V @ 0.4A

After completely the voltage ripple test, I also conducted a load regulation test at max load for each input voltage. I got a 1.5% voltage drop from calculated voltage meaning at full load, my output voltage was 3.25V at the lowest.

Designing a boost converter sounds complicated and intimidating, well that was always my impression when it came to this topic in school. In reality, the design and testing of a boost converter is a lot easier than meets the eye.

Here I will walk you step by step on designing your first boost converter and how the datasheet is your best friend when designing. For this tutorial we will be using the L6920DC IC Boost converter from skyworks.[1]

Download the Boost Converter excel spredsheet from the Resources page.

First and foremost, download the highlighted datasheet, datasheet-l6920dc. This has all the highlighted paremeters that you will need when designing a boost converter.

Step 1:

You need to decide what are your specifications. These are the key parameters:

Vin(min)

Vin(max)

Vout

Iout

n = efficiency; Most boost converters average around 85 to 90% under medium load and up to 95% on heavy load. We will use the lowest percentage to be safe.

Example:

Vin(min): 1.8V

Vin(max): 2.4V

Vout: 3.3V

Iout: 0.4A

n = 87% or 0.87

Step 2:

With your specifications, next step is to find your DUTY CYCLE:

We calculated the duty cycle for both lowest input voltage and highest input voltage.

Lowest input voltage gives you the highest switching current you will see

Highest input voltage gives you the highest output current your converter can produce

Example:

= 0.52

= 0.36

Step 3:

Next we will estimate the switching current or CURRENT RIPPLE of the Inductor:

ΔIL =

Example:

ΔIL = = 0.22A

ΔIL = = 0.165A

Step 4:

Next we calculate the minimum INDUCTANCE we need:

– This is the switching frequency that the converter will operate at.

Example:

= 3.72uH

= 3.97uH

We would select the highest inductance value to meet our input voltage rage of 1.8V-2.4V

When selecting the inductor, the key parameters you need to look for is low DCR, package size, and max current the inductor can handle.

DCR – Is the resistance in the coil because at the end of the day, an inductor is still a wire. When you keep this value at a minimum, it will increase your effieciency and the ability to provide a higher output power.

In step 7 , you will calculate the maximum current the inductor will see and there you will have all the necessary parameters needed to chose the inductor.

Step 5:

Now that we have our inductor value, we can calculate the actual CURRENT RIPPLE of the Inductor:

ΔIL =

Example:

ΔIL = = 0.19A

ΔIL = = 0.18A

Step 6:

Next we need to calculate the MAX OUTPUT CURRENT the boost converter can output:

=

– This is the current switch limit of the boost converter.

Example:

= = 0.33A

= = 0.45A

Step 7:

Next we will calculate the MAX SWITCHING CURRENT, the Inductor will see. This value cannot exceed the ILIM value of the boost converter:

Example:

= 0.94A

= 0.72A

Note: value cannot exceed which can be found in the datasheet. In this example we see that with a low input voltage, the switching current exceeds the limit in the datasheet. The boost converter might still be able to output the desired current at that low input voltage because is the minimum switching current it can handle. But better to be safe than sorry.

Here you can see the inductor will see a max of 0.94A at its lowest input voltage. Now we can chose the inductor for our design.

For this design I went with,MSS5131-472MLB, a 4.7uH inductor from coilcraft.[3]

Since I chose an inductor that has a higher value than previous calculated, the inductor current ripple and output power will be slightly lower but it will not effect your design negatively.

Step 8:

This step is only if your boost converter has an adjustable output voltage.

(This boost converter is a fixed output and does not require these resistors. Step 8 values are dummy values but the process )

Here we will find R1 AND R2 values for the feedback network:

– This is the current that the feedback resistor draws.

– This is the feedback reference voltage

Example:

= 35mA

= 35.4kΩ

= 58.74kΩ

Step 9:

Next l, we will calculate the INPUT CAPACITOR and OUTPUT CAPACITOR needed to minimize the ripple going in and out of the system:

– This is the maximum on time of the boost converter. It is also written as

Were

ESR – All capacitors are not ideal capacitors and therefore have what is known as Equivalent Series Resistance. This is an important parameter that you need to consider when choosing the right output capacitor.

Example:

Cin = 10uF

First, we need to choose a voltage ripple that we can live with. Here I chose 50mV, and if we rearrange the first equation, we get:

= 50uF

Now we have a couple of options to choose from when it comes to materials for capacitors.

Most common are ceramic and electrolytic capacitors. Each have there own pro and con.

Ceramic capacitors offer lower ESR for lower ripple but they typically do not have the bulk capacitance.

Electrolytic capacitors have bulk capacitance but generally have a high ESR that adds to ripple.

In this case I decided to go with both, getting the benefit of bulk capacitance and low ESR.

I went with a 1206 package, 10uF ceramic capacitor and a 47uF Electrolytic in parallel. For the electrolytic, they also have an aluminum polymer that has high capacitance with the added benefit of low ESR. I went with a 47uF that has an ESR of 40mΩ.

Now we plug in the values we got back into the equations and we get:Special Note: For ceramic capacitors, you need to be careful of which class and package size you choose because you only see a certain percentage of your nominal value (ex. 1206 10uF X7R will see 73% of 10uF)[4]. Click here for more info. I generally go with 1206 or 1210 with capacitors.