Friday 9 November 2012

Power Supply design for the thermometer

OK for the power supply design I will be using a dc dc boost converter to crank up 3 volts from  two AA batteries to 5 Volt which will be the system VCC.

We also need a -5 volt negative supply and for that we will be using another dc dc converter using the flying capacitor configuration. Luckily the IC we will be using MCP34063  is a multi purpose converter chip capable of step up, step down, and inversion.

So using the fist converter we convert 3 volts to 5 volt system VCC. Then +5 volts from system VCC to -5 volts for the negative supply. Although as the negative supply will be used only for biasing the opamp its current requirement will be much lower.

Let us discuss some feature for the MCP34063 converter:
For calculating the values of the other passive elements we follow the tabular approach.

Just filling in the equations we can calculate the values of the various other passive components components.

For our requirement we need 3 to 5 volt boost.
Turns out I had already designed a power supply which uses this kind of approach i.e. using two AA batteries to generate 5 volt supply. I actually designed a board with it as well which I will share here.

First the circuit diagram
The final value of the output voltage is set by the ratio of two resistor   R4 and R5 here so I have chosen accurate 1% tolerance E96 values. Yes these resistors are costly but to maintain the accuracy of the output voltage it is necessary.

Actually this project I did for the open source hardware community. One of the forums I saw some students wondering how to power the common rail of their breadboard from battery they were using an entire 12 volts 8*AA batteries and then converting then using a linear regulator 7085 to 5 volts. This was cumbersome 8 battery pack plus wastage of power due to linear regulator. So I decide to use this scheme to design a board which has output pins which directly clamp on the breadboard powering the VCC and the ground rails respectively and just using 2*AA rather than 8.

PCB design
The above circuit on a double layer board. XCON1 and XCO2 are the power and Ground pins which directly clamp on with the bread board.

Let us look at the finished PCB design

The complete populated board with onboard battery holder installed

So far for the power supply design in the future I am sure to make modifications to it but for now this will do.
In the next blog we will start working with our software.

To be continued...

Tuesday 6 November 2012

Smart Digital Thermometer design 2 -- Temperature independent voltage reference

In the last blog we completed the offset circuit for our temperature sensor. We saw that for offsetting the voltage we need a precise temperature reference. This temperature reference should have fairly low temperature co-efficient (dV/dT) thus should not change its reference voltage output considerably as the thermometer is subjected to varying temperature.

Now as we are using a intelligent controller the ATMEGAGA168 it is capable of outputting an temp independent analog voltage as a PWM output. But in order to use that we need to use the PWM output pin and further filter it to eliminated ripples. At least we need a second order filter for smoothing out the voltage considerably. However the main disadvantage of using this scheme is the fixed quantization level for the PWM output. For the ATMEGA 168 controller it has 256 levels i.e. the duty cycle for the PWM output can have only certain fixed value. This may be sufficient but for this case we are opting for ultra precise accuracy so we will use a separate voltage reference IC.

When it comes to voltage reference the most common is a zener diodes. Zener diodes work in reverse bias condition and the reverse breakdown voltage is actually its voltage reference. We are going to use the LM336 band gap reference zener.

Before we continue let us characterize the features for an ideal voltage reference :
  • It should be accurate in its voltage output.
  • NOT temperature dependent. Voltage should not change with temperature.
  • Cannot deliver high current.
  • Need not have low output impedance.  
This is a simple scheme for biasing a zener reference. R1 is the biasing resistor.
For a generic zener dV/dT = 2.2mV/deg C
For a generic diode dV/dT = -2.2mV/deg C
So using them in combination will eliminate the temperature dependence.
Let us implement such a scheme
The base emitter junction of the transistor Q4 acts as a diode drop which has negative temperature coefficient so this scheme incorporates both positive and negative temperature coefficient thereby greatly reducing temperature dependence of the circuit. R2 should be sufficiently large to prevent high current drain from the circuit which would change the biasing voltage V2.
This type of scenario is highly unlikely but if it does happens current through R1 will change thus reference voltage of D1 will deviate.

Solution

Here we are using the Wilson's Current mirror concept any change in the load current will get reflected in the biasing current keeping the reference voltage more or less constant. With this current configuration we get a value of 3.1788V across the 1 MEG resistor. By using a proper voltage divider circuit we can then convert this voltage into 2.73 reference. So let us add this circuit in our design.

Sunday 4 November 2012

Smart Digital Thermometer - design1

In the previous blog we discussed the requirement of offsetting the voltage we get as output from LM335 temperature sensor.
Now let us design the subtractor ckt we talked earlier.

Here is the circuit diagram (EAGLE CAD)
OK so this is a basic op amp based subtractor ckt. We are using a 2.73V reference (a whole new blog on how to generate temperature independent precise voltage reference) which will get subtracted from the voltage coming from the sensor in the resistor R6.
You may notice that I have left one terminal of the sensor open that is the adjustment terminal which we will use for the calibration purpose again another new blog.
Anyways with this arrangement what we get is 0volt when the temperature of the sensor is more or less 0 deg C.
For the op amp I have used a generic LM358 op amp which has a modest offset voltage. Right now I will use this later if required will upgrade to ultra low offset voltage chopper amplifier.

Now for some simulation
However before we do so let me tell you the above ckt wont work. Reason for a subtractor circuit to work the opamp must be powered from a dual supply how ever above we are using single so output just wont swing. 
Now for simulation let us apply 3.73 volt at the input stage of the amplifier (simulating 100 deg C) we should get 1 volt output right but the opamp just cant deliver this. Let us plot the graph for the above arrangement.

The blue curve represent the input 3.73 volt. The green curve the output which should be 1 volt but here it is merely 100mV.
So we need a dual power supply (talk more during the power supply design stage)
Let us modify the ckt for dual supply +5V and -5V
Now let us simulate again for 100 deg C we should get 1 volt
The green plot the input is at 3.73 volt now the output does swing to 1 volt. 
So the solution is to use dual power supply for our opamp.

Implementing in strip board

Although here I am using two 9volt batteries with a common centre tap to generate positive and negative supply in the actual design we will be using switched mode supplies which will use flying capacitor voltage inverter.

In the next design phase we will be concentrating on the implementation of a temperature independent 2.73 volt precision voltage reference.

to be continued...

Smart digital thermometer - from conception to design

Smart Digital Thermometer

Ok before we start let me say this - this is going to be a multiple blog entry and it will be an ongoing project as I develop and modify the design criteria of the Smart Digital Thermometer.

So with that let us begin. Let me give a brief introduction to the project. The idea is to create smart thermometer for logging temperature in digital format. Sounds simple enough but I am going to pack the device with tons of features like a clinical mode with high precision operating between 36 deg C and 45 deg C as well as a normal 0 to 100 deg C. Device will have an internal memory users can create patient profile where the temperature will be logged automatically w.r.t. time. Device will have a real time clock There are also other feature which I will discuss as we go along.

Now one may ask there are tons of digital thermometers like this in the market why is this project special. That is because my soul idea behind this project is to design a high precision sensor with as low cost as possible. I will rarely be using high priced all in one package IC. For all the controlling, detecting and logging stuff  I will be using  of the shelf "jelly bean" stuff but ensuring the high precision is always maintained no compromise there.

The basic temperature sensor is going to be a LM335 IC from Texas Instruments. Initially I will be using a single IC but later upto 4 for averaging the temperature for increased accuracy. For more info please check the data sheet.









Basically it is a Zener diode with breakdown voltage function of temperature as 10mV/deg K. However current flowing through this device should be sufficient enough to cause breakdown but not too much to cause self heating which would interfere with the actual temperature.





















However we can see a problem here we do not work with Kelvin scale generally. So for 0 deg C we will get 2.73V as the output i.e. when we say we are getting 2.73V at the output of the sensor we know the temperature is 0 deg C. Similarly 3.73V at 100 deg C. But we want 0V at 0 deg C and 1V at 100 deg C.

Now we can easily offset this in our software but again although we will be using a 10bit ADC which is more than enough but still we will loose some precision in this conversion so we will offset this in the analog domain and then sense the offset value via the 10bit ADC. So our first problem lies in designing the offset analog circuit. Solution very simple we will be using an op amp based subtractor ckt.

In the next post we will design and simulate this ckt and then implement it on a strip board.

to be continued...