You are on page 1of 32

ENS 491/ENS 492

Carbon Fiber Deicer


Senior Engineering Design Project

Andrew Wosciechowski
5/27/2013



1

Table of Contents
Abstract ..................................................................................................................................................... 3
Object/ Introduction - Apparatus/Materials ............................................................................................. 4
Theory .................................................................................................................................................... 5-6
Design ................................................................................................................................................... 7-11
Simulation .......................................................................................................................................... 12-15
Experimental Setup/Procedure ......................................................................................................... 16-21
Discussion/Conclusion ....................................................................................................................... 22-27
Appendix .....................................................................................................................................................

2

Table of Figures
Figure 1: The front panel of the simulation ............................................................................................ 12
Figure 2: Block diagram of the simulation .............................................................................................. 13
Figure 3: Graph of the simulated results ................................................................................................ 14
Figure 4: Circuit diagram in Multisim ...................................................................................................... 15
Figure 5: Pin configuration of the DS18B20 ............................................................................................ 17
Figure 6: Testing the carbon-fiber strip in the lab .................................................................................. 20
Figure 7: Graph of the experimental results ........................................................................................... 20
Figure 8: Block diagram for the system .................................................................................................. 21
Figure 9: Fritzing model of the system .................................................................................................... 21
Figure 10: Concept image of the final system......................................................................................... 23






3

Abstract:
The goal was to design a system capable of melting snow/ice with the use of joule heating by
applying voltage/current to a conductor in order to generate heat. The material chosen was carbon
fiber. This was due to its rigidity, durability, conductive properties and its light weight. Weve opted to
control the system based on temperature. Once the ambient (environmental) temperature went below
a certain level, chosen to be the freezing point (32F) then the system would trigger thus melting the ice.
If the ambient temperature goes above this certain level then the system would turn off.
To control the system weve used the Arduino microcontroller coupled with two temperature
sensors, an N-Channel MOSFET, a power supply and the heating element (carbon-fiber). The Arduino
was to provide control and feedback for the system. The two temperature sensors are to read the
ambient temperature and the temperature of the heating element. The MOSFET was chosen to act as a
switch even though it has many uses in electronics. The Arduino will control the MOSFET when the
temperature reaches below/above the programmed threshold. Connected to the MOSFET is also our
carbon-fiber heating element which is also connected to the power supply. Current is constantly flowing
through the heating element from the power supply thus causing it to increase in temperature. When
the temperature goes below a certain programmed level this current will be allowed to flow through the
element and MOSFET. When the temperature is above this programmed threshold then the MOSFET
will prevent the current from flowing through the heating element thus causing the system to cool
down.
Before doing the programming and connecting the system we have tested the carbon strip with
certain amounts of voltage/current and to see what temperatures are produced. We went from 0V to
10V and recorded the temperatures accordingly. At 5V/0.20A weve generated a temperature of
approximately 90F. At the maximum of 10V/0.45A weve achieved a temperature of 137F. We felt that
at the maximum temperature this was a bit of a waste of electricity for the system so weve opted to
use around 5-7V DC.
After testing the strip weve done the necessary programming and tested it in steps to ensure
everything was working. First we programmed the LCD to display text and the information such as the
ambient and system temperatures. Once weve seen that was working we then implemented the
control structure to regulate the MOSFET as a switch. Once the ambient temperature goes below the
threshold then the current from the power supply would be allowed to pass through the heating
element. When the ambient temperature goes above the threshold then the MOSFET is closed and
the current is not allowed to pass, allowing the system to return back to room temperature.
Upon completing the program weve connected everything and observed the working design.
From here we were able to add a second strip to create a baseline for scalability. Two strips were placed
approximately 10cm apart. This value was chosen because its a simple even number. Also if the strips
are too close then the system would be inefficient, too far apart then the heat generated would not be
concentrated enough to melt ice. Using the sizes of the carbon strips and the spacing along with the
rating (60V/30A) for the MOSFET we could find that the maximum amount of area to be covered with
our prototype was 9.660m
2
using 130 strips of carbon fiber.
By scaling up the prototype we were able to determine how many strips, how many MOSFETs
and how large of a power supply is needed to cover the area. As an example we chose a driveway of
approximately 35m
2
and have found that a 600W power supply along with 4 MOSFETs and 437 strips
were needed to generate the necessary temperature of 95F as done in the prototype. Upon scaling up
we have also attributed the cost to be around $3214.00 for the materials.

4

Objective/Introduction:

The project stemmed from the problem of trying to prevent snow/ice accumulation on surfaces
outdoors when the environment is cold. The idea was to have a portable system to properly melt snow
and ice that anyone could use. Currently there are systems implemented in large office buildings,
hospitals and up-scale residential neighborhoods. This system is not portable, requires a lot of effort to
install and can be quite expensive to operate and install. We were looking to create the total opposite of
this system. Good portability, minimal effort to implement at any location and ease of use. Weve set to
design the system based on these factors.
Instead of a system that is permanently installed underneath concrete and asphalt like some
existing systems weve chose to create an aboveground system. This would provide for easier
maintenance and better usability since it can be taken anywhere. Such a system would require less
installation than an in-ground system. Current in-ground systems require extensive construction such as
ripping up of concrete/asphalt, lying of the heating element, the wiring and repaving the ground. This
can be quite costly and time consuming. Also such a system can only be marketed toward large
companies and the well-to-do. This system design was targeted toward an average person with
average/slightly above average income.

Apparatus/Materials:

1. (1) Arduino Mega 2560 R3 Microcontroller.
2. (1) Mini breadboard.
3. Wire jumpers.
4. (1)DFRobot LCD Keypad Shield.
5. (2) One-Wire Digital Temperature Sensor DS18B20.
6. (1) Fairchild Semiconductor N-Channel MOSFET (60V 30A).
7. (1) Clear Blue 5mm LED.
8. (1) Labvolt Variable Power Supply.
9. (10) Banana plug to alligator leads.
10. (1) Carbon-Fiber Strip (67cm x 1cm x 0.2cm).
5

Theory:

The premise of this project was to generate heat electrically through a heating element in order
to the melt ice. This process is referred to as Joule heating. Joule heating can be commonly seen in
soldering irons, electric stoves and toaster ovens. We pass an electrical current through a highly
conductive material and the conductor releases heat. Joule heating is dependent on the type of current
used whether AC or DC. For the sake of the experiment we will be using DC.

For DC current we know that total power is represented by the equation:

=
Where:
P = Power measured in Watts (W)
V = Voltage measured in Volts (V)
I = Current measured in Amps (A)

This equation is used to determine the power across our heating element. The heating element
(conductor) has an electrical resistance. Electrical resistance is the blocking of electrical current and is
given by the equation:

=


Where:
R = Resistance measured in Ohms ()
V = Voltage measured in Volts(V)
I = Current measured in Amps(A)

This equation is referred to as Ohms Law and can be written also as:

=

=



By using these simple equations we can determine the voltage by having the value for the current and
resistance or we can determine the voltage by knowing the value for the voltage and resistance. These
will be very helpful in the design.

Joule heating is based upon Joules First Law
1
:


2

Where:
Q = Heat measured in Joules (J).
I = Current measured in Amps(A).
R = Resistance measured in Ohms ().

1
http://en.wikipedia.org/wiki/Joule_heating
6


The heat is proportional to the amount of current (squared) multiplied by the resistance of the heating
element.
From the aforementioned equations we can see how current/voltage, combined with the
resistance of a heating element can produce heat. This is the main premise behind many electrical
heating systems used residentially and commercially. Therefore, by applying the voltage and current
through the heating element (resistor) we can generate heat. The heat will then be used to melt ice and
prevent snow accumulation in cold environments.
Referring to heat (Q) brings up another important part of the system. We have said that applied
voltage/current (power) to a resistive heating element generates heat. Once the heat is generated it will
eventually be emitted to the environment. This process is known as Convection. This is given by the
equation
2
:

= (

)

Where:
Q
c
= The thermal energy in Joules (J).
h = Heat transfer coefficient (W/m
2
K).
A = Surface area (m
2
).
T
b
= Temperature of the surface area.
T
f
= Temperature of the environment.

This equation is known as Newtons Law of Cooling.

As the current/voltage is applied to the heating element (resistor) this will generate heat. The surface
area of the heating element matters along with the environmental temperature and temperature of the
resistor.



2
Fundamentals of Engineering Thermodynamics, Moran, Shapiro, Boettner, Baily, 2011, p. 57
7

Design:

We have identified the properties of the design as:

1. Simple installation by the user.
2. Portable.
3. Durable.
4. Economical compared to current systems.
With these properties we were able to make proper decisions of what materials to use and how they
will be implemented. However before proceeding with these ideas we must take into account the
constraints:
1. Economic consideration.
2. Environmental consideration.
3. Social considerations.
4. Manufacturability considerations.
5. Sustainability.
6. Ethical considerations.
7. Health and Safety.
8. Political consideration.
Economical Consideration:

As we have examined preliminarily in the report most systems currently being used arent very
economically feasible. Existing systems require the establishment to do demolition of the ground to lay
in the heating element. Then after the heating element is laid in reconstruction of the ground must be
done. This process alone can be very expensive due to the amount of labor and equipment is needed to
complete the job. Along with these factors comes the cost of the system itself. Our system hopes to
alleviate these extravagant costs to something more possible. At this point the current systems being
used are more of a luxury item that not many establishments can have.

According to the parts list we have gathered the approximate cost of building this prototype is:

1. (1) Arduino Mega 2560 R3 Microcontroller $35.00
2. (1) Mini breadboard. $5.00
3. Wire jumpers. $5.00
4. (1)DFRobot LCD Keypad Shield. $11.00
5. (2) One-Wire Digital Temperature Sensor DS18B20. $9.90
6. (1) Fairchild Semiconductor N-Channel MOSFET (60V 30A). $1.95
7. (1) Clear Blue 5mm LED. $0.05
8. (1) Labvolt Variable Power Supply. $100.00
9. (10) Banana plug to alligator leads. $15.00
10. (4) Carbon-Fiber Strips (67cm x 1cm x 0.2cm). $19.80
Estimated Total: $202.70
8

So far the system being build is more economically feasible than most available systems. Since
this is only a prototype, weve had to buy the parts at retail cost. If the parts were to be purchased in
mass quantities (i.e. bulk) then we would certainly be able to build a lot more of these devices at a
cheaper price. In order to bring the price down to a respectable level; we would most likely have to
charge customers by the area (sq. ft.) of which they are trying to de-ice.
Certainly if the system were to be mass-produced and sold at reasonable prices I think there
would be a fair number of customers to purchase this product. The low price and easy-implementation
is a viable selling point compared to other systems currently on the market. Of course the right exposure
of the product is also necessary. Television ads, displays in popular stores and online marketing would
certainly be of great benefit. Current systems are so esoteric that they really arent advertised on a large
scale. This could be due to the fact that they are very expensive and very difficult to implement.

Environmental Consideration:

The system is being used outdoors so therefore there will be a large interaction with the
outdoor surroundings. As we have discussed, the system, when triggered heats up to a certain level and
proceed to melt the snow and ice. Therefore we see a possible risk of fire when using this device. For
example, there could be some dry, leaves/grass near the system and they could possibly catch fire on a
day where its dry but cold. We would have to keep the heating element of the system enclosed in a
thermally conductive but fireproof material.
There is also a risk of electricity shock. We are applying 120V
RMS
into
the DC power supply that provides the voltage/current to our system. If
there is a voltage/current running through the carbon then when exposed
the carbon could pose an electrical shock. Once again we would need to seal
the heating element and wiring off from the outside as much as possible.
We could definitely manufacture the system with these safety
precautions. In the product documentation, as well as on the product itself
we will note that there is a possible risk of burn and electrical shock if the
device is opened or used improperly.

Social Consideration:

Upon examination there are really no social impacts of the device. It does use electricity as its
main source of operation so some religions and lifestyles that forbid the use of electricity may be
affected.


9

Manufacturability Considerations:

The proposed system can certainly be manufactured using existing technology. Weve selected
the components to be as durable and effective as possible while still being reasonably simple to
manufacture and produce in large quantities. If the system were to be manufactured in large quantities
then the price per unit would certainly decrease.
For manufacturing we could buy raw carbon fiber in bulk and cut it down to the proper sizes
needed for each unit. Raw carbon fiber is certainly cheaper than the treated, polished versions out on
the market. Each of the microcontrollers could be bought and pre-programmed by the manufacturer
and implemented into the package. As far as service there would be a warranty.
The prototype is fairly reliable and straight forward. Scaling the prototype up would simply require using
larger components. The quality of the components however would still remain the same. If something
were to go wrong with a unit we could offer a warranty which would cover the parts and labor.

Future Improvement:

A few considerations to make the system more useable:

1. A moisture sensor to detect when snow/ice forms on the system thus turning the system on
based on temperature and moisture.
2. Manual access to turn the system on and off with wireless capability. For example turning the
system on with any wireless device such as a cellphone or laptop.
3. Display how long the system has been on over a certain period of time (hours, days, weeks).
4. How much power the system has consumed over an amount of time (kWh).
5. Recording this data for future reference.

Sustainability:

The proposed system can certainly meet the needs of the consumer in the short term as well as
the long term. Our system is meant to be used during the winter months in the temperate environments
and longer in the colder climates. In the short term the system certainly meets the needs of the
consumers. If we were to include the above improvements to the prototype then it would certainly
provide more than what is needed by the consumer in the short term with a lot of functionality. The
proposed improvements would make the system more useable thus has greater sustainability without
making it too complicated.
The proposed system is flexible enough to meet the changing needs of the environmental,
economic and social considerations. From these three it seems that the environmental factors are the
most crucial since we are designing a system for outdoor use. Therefore we must manufacture the
device to withstand the elements outdoors. Granted the system in portable and can be taken in during
the warmer months however it must be able to endure cold temperatures when it is used.
Upon reviewing the overall design so far we see the system being able to meet the changing
needs of consumers for the foreseeable future. After all weve designed it around these principles. We
wanted a system thats easy to use, easy to implement and relatively economical to acquire and
operate.

10

Ethical Considerations:

We will certainly note the proper operating conditions for the system as well as the inherit
health risks to the system. All data shown in this report will be available in the final products manual. All
of the data shall not be altered.

Health and Safety:

As we have discussed the possible risks to the public include electrical shock and burn hazards.
We must display warning labels and explain that these factors can be very dangerous if the system is
used improperly or mistreated. To protect the consumer from these risks we have to design the system
to be safe while being just as effective. All electrical components must be sealed off along with the
heating element. The heating element will be warm and also have electrical power running through it.
This is the most crucial item that cannot be exposed to the public.
In order for the system to be operated safely one must not have any exposed electrical wires or
components. Therefore the system shall not be opened under any circumstances. This includes the
heating element (carbon fiber), the power supply and the wires conducting the electricity to the system.
Possible injuries include electrical shock.
While the system is on the heating element can be a possible burn risk. Therefore while in
operation the heating element shall not be touched with bare skin. In order for safe operation the
heating element shall be left in the thermally conductive material that prevents accidental exposure.
If the system must be serviced then be sure that all electronic components are unplugged from
the source and the system has been unplugged for quite some time. If the system was hot and recently
unplugged then it could still provide a possible burn risk.

Political Consideration:

There doesnt seem to be any political considerations to be observed at this time.


11

We have designed the system using the aforementioned constraints. We would like it to be as
safe, reliable, economic and user-friendly as possible. With these constraints in mind we have made the
following choices for the system.

Carbon-Fiber:

This is our heating element or thermally conductive material. When voltage/current (power) is
applied then the material will heat up. Weve opted for this specific material over others because it is
extremely light in weight, rigid, durable and in large quantities relatively cheap. Obviously its not the
most economically feasible material but the attributes mentioned make up for the price. If this material
is implemented in a lot more systems today then it will be more economically feasible. In fact, its
already starting to be more feasible. Ten to twenty years ago such a material would have been a lot
more expensive. Today we were able to build a prototype that was relatively inexpensive.
We are only going to be designing the system with one carbon-fiber strip for simplicity. We want
to investigate how well it responds to our simulation and experimental results. If the results are
successful then we will consider it in the final system. We would just have to scale the number of strips
and power consumption up based on our results.

Electronic Components:

The main electronics components we have selected are the Arduino Mega 2560 R3, (2) One-
Wire Digital Temperature Sensor DS18B20, (1) Fairchild Semiconductor N-Channel MOSFET (60V
30A), (1)DFRobot LCD Keypad Shield, (1) 5mm clear blue LED and all of the necessary components to
connect these together.
The Arduino microcontroller is a versatile microcontroller with large exposure over many
people/countries. Since it has a large following there is a large selection of components for it at cheap
prices. Weve chosen an LCD shield to go with the microcontroller. A shield is simply a module that plugs
directly into the Arduino board to make it more useable. The LCD shield will be activated through
programming and will display the ambient temperature and system temperature.
The temperature sensors we have chosen were seemed to be of high quality for our needs. They
have an operating temperature of (-55C to +125C) and the resolution (accuracy of each temperature
measurement) can be selected from 9-bits to 12-bits with the correct programming. More information
on these sensors can be found in the appendix.
Most importantly we have opted for an N-Channel Enhancement Mode MOSFET. This is another
critical portion in the design. It serves as a switch to our system to turn it on when the ambient
temperature reaches below a certain level (threshold) and to turn it off when the ambient temperature
reaches above a certain level. The MOSFET was chosen because it was much cheaper than other
solutions such as a relay (actual switch) and there are no moving parts to it. This means theres less
chance of failure than that of a relay which has moving parts.

12

Simulation:

Weve opted to use National Instruments LabVIEW as a simulation program. We have needed to
simulate temperature with respect to current and resistance in the heating element. In order to do this
we need to examine the equation as stated in the theory portion of this experiment.


2
t
The amount of heat is proportional to the current squared times the resistance of the heating
element. We wanted to model this in the program and see how the system would respond to certain
amounts of current at a fixed resistance. We are currently testing the system with only one carbon-fiber
strip. Before we can start the simulation we must take a preliminary measurement of the resistance of
the carbon strip to simulate in LabVIEW. We have measured the resistance of the strip to be
approximately 22. We record this value and note it for use in the simulation.
We want to simulate the voltage/current running through the resistive heating material.
Therefore we want to see how various values for the power correspond to temperature of the carbon
fiber. We start by creating a front panel in the LabVIEW program to accommodate our needs. The front
panel serves to control our values and display the information needed. 4 numeric indicators are placed
onto the front panel. These will display our Voltage (V), Current (I), Heat (Q) and Temperature (F). We
place a numeric control knob onto the front panel which will serve as our voltage control. The final front
panel can be seen in figure 1.
Please note that the values shown
are the default values at the start
of the simulation and does not
reflect the actual results that we
have obtained.
The front panel is just one
of two portions of the LabVIEW
simulation. We must also create a
block diagram to compute the
data for the given input on the
voltage control.

Figure 1 - The front panel of the simulation.
13


Please note a larger version of the block diagram can be found in the appendix.

Starting from left to right of the block diagram we have the voltage control input at point 1 as
noted. That voltage is displayed onto the numeric indicator at point 2. We know that current is
equivalent to the voltage divided by the resistance. Therefore voltage is divided by the resistance at
point 3 to obtain the current. The current is displayed on the numeric indicator at point 4.
We have stated that the heat(Q) is proportional to the amount of current squared multiplied by
the resistance. Therefore at point 5 we take the current and square it and multiply it by the resistance at
point 6. Heat is also a function of time so we add in time at point 7. We take the time and multiply it by
the current squared and resistance at point 8. The result is the amount of heat (Q) at point 9.
The next step is to convert the heat (Q) to temperature. We multiply the heat by a constant of
600 at point 10. We then take this value and divide it by 1.0x10
11
at point 11 to obtain proper values for
the Celsius temperature. At points 12, 13 and 14 we use the formula:

=
9
5
+32

This is to convert our Celsius temperature to Fahrenheit. At point 15 we display the Fahrenheit
temperature. We also display the temperature (F) on a visual thermometer at point 16.

Now that we have created a function block diagram we can begin to run the simulation and take note of
values for the voltage/current and temperature. For simplicity we will increase the voltage in 0.5 step
increments and record the value for the temperature, current and voltage.


Figure 2 - Block diagram of the simulation.
14

Upon running the simulation we record the following data:




Voltage
(V)
Current
(A)
Temperature
(F)
0.5 0.022 37.59
1 0.045 43.59
1.5 0.068 48.78
2 0.090 54.38
2.5 0.114 59.98
3 0.136 65.57
3.5 0.159 71.17
4 0.182 76.76
4.5 0.205 82.36
5 0.227 87.96
5.5 0.250 93.56
6 0.273 99.15
6.5 0.295 104.75
7 0.318 110.36
7.5 0.341 115.96
8 0.364 121.56
8.5 0.386 127.16
9 0.409 132.76
9.5 0.432 138.36
10 0.455 143.96
Figure 3 - Graph of the simulated results. Temperature (F) vs. Current(A)
15

From the graphical results in figure 3 we can see that as current increases then temperature
increases linearly. From the simulated results we note that a desirable temperature for the system (to
melt ice/snow) would be above 100F. Therefore we take note of this value and find that the minimum
voltage/current needed is around 6.5V/0.295A 7V/0.318A. This will produce a system temperature
around 104.75F 110.36F.

Another part of the simulation is to create the proposed circuit using circuit simulation software. The
program were accustomed to using is National Instruments Multisim.

We want to control the current running through the carbon fiber strip. When the ambient
temperature reaches below the threshold we want to allow the current to flow through the carbon-
strip. When the ambient temperature is above the threshold we want to block the current from flowing
through the resistor. This is where the use of the N-Channel MOSFET comes in. We technically want to
use it as a switch.
The MOSFET will be controlled via the Arduino. The Arduino gives off 5V from each pin and the
portion of the MOSFET that allows us control is the gate. We connect an Arduino pin to the gate of the
MOSFET. This is represented by the 5V on the circuit diagram. We also connect a 10k resistor in series.
The use of this resistor is referred to as a pull-down resistor. It keeps the gate in an off or low state
when the Arduino doesnt send a signal. The gate of the MOSFET can be thought of as a door.
The drain of the MOSFET is connected to one end of our carbon-fiber strip, represented with the
22 resistor, R2 in figure 4. The other end of the carbon-fiber strip is connected in series to our main DC
power supply.
The source of the MOSFET is connected to the ground and to the negative of the DC power
supply. From the diagram we can see how current can freely flow through the N-Channel MOSFET when
activated which means the temperature will increase in the carbon-strip. However when non-activated
the current loop is blocked and there will be no voltage/current running through the carbon strip,
meaning there will be no temperature.
When the Arduino pin is activated the current will be allowed to flow through the carbon-fiber
thus heating it up. When the Arduino pin is deactivated then the current is blocked allowing the carbon-
fiber to cool down. In order to accomplish this task we must program the Arduino controller during the
experiment.

Figure 4 - Circuit diagram in Multisim.
16

Experimental Setup/Procedure:

Now that we have our components and what is to be done we can start the experiment. We
begin by connecting the components to the microcontroller and writing a program. Please note that the
full program written can be found in the appendix. First we visualize what we want the LCD to display to
us. We make a decision that the current ambient temperature and system temperature are an ideal
approach. The ambient temperature will give us information on what threshold temperature to
program. The system temperature will help us compare our simulated results and see how well carbon
fiber strip heats up.

An example of the format for the LCD is as follows:

Amb.Temp: 81.60F
Sys.Temp: 104.43F

We will read from both temperature sensors. One sensor will be the ambient temperature and
the other will be the system temperature. Now that we have the format we will begin trying to
implement it onto the microcontroller by programming it. Before we setup the temperature sensors we
begin with writing the basics for the program. Therefore we start with the basic structure of an Arduino
program. We use the blink program from the Arduino site to get ourselves acclimated with the
structure. The basic structure of an Arduino program or sketch as they refer to it
3
and the test
program can be found in the appendix (1-1). This example program is taken directly from the Arduino
website. Its usually to give individuals of how the overall structure of an Arduino sketch works.
With that being said, we declare our variables before the void setup() structure. Since we want to use an
LCD to display our data we must include the header file #include <LiquidCrystal.h>. The header file
allows us to easily read/write to any LCD based on the Hitatchi HD44780 (or compatible) chipset
4
. Our
LCD is based on this chip set and the information for our specific display can be found in the Appendix.
The next step is to actually define the pins that the LCD is using. These pins will be where we
control the LCDs hardware (i.e. the backlight and power), transmit data and receive data. To do this we
take note of where the LCD is plugged into the board. We also double check which pins to activate by
referring to the manufacturers website
5
. We find that the pins we need to declare are 8,9,4,5,6,7.
Therefore the code is: LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
We do a bit of testing to see if the LCD is transmitting and receiving data. We write a hello
world sketch to test it out by using the above commands. This code can be found in the appendix (1-2).

We upload the above code to the board and confirm that its working. Now we can begin to get our
format for the LCD to suit our project. As stated, we would like to display ambient temperature and
system temperature. With testing and trial an error we were able to get the text into the proper area of
the display. We are finally able to get the format needed by using the code weve written

3
http://arduino.cc/en/Tutorial/blink
4
http://arduino.cc/en/Reference/LiquidCrystal
5
http://www.dfrobot.com/index.php?route=product/product&product_id=51#.UYPNQsr9dGg
17

At this point in the project, we must display the temperature from the two digital temperature
sensors. The temperature sensors are called the DS18B20, 1-Wire temperature sensor. They are
referred to as 1-Wire because it only requires on pin from the Arduino to run multiple sensors. This
means we can take two different measurements (using two sensors) all on one single pin. Before we can
begin to take measurements we must install the libraries given by the manufacturer. The libraries
contain much needed information to actually read/write information to the Arduino.
We must connect the digital temperature sensors together. We have
already connected a jumper wire from digital pin 52 to the breadboard. Pin 1 of the
temperature sensor is connected to the ground. The jumper wire going from pin 52
is connected to pin 2 of the temperature sensor. This is the information being sent
and received. Pin 3 of the temperature sensor is connected to one of the Arduinos
dedicated 5V voltage ports.
In order to connect the other temperature sensor (for the system) we run
wire from pins 1, 2 and 3 respectively. Essentially we are connecting both
temperature sensors in series. We use jumper wires and connect them to a
different point on the breadboard. An long jumper wire is connected from this
point to the temperature sensor to read the value of the temperature on the
carbon-fiber strip.
Now that the temperature sensors have been connected, we must add in
the N-Channel MOSFET. This will serve as the switch for our system. The MOSFET
is placed onto a point on the breadboard whereas not to interfere with the
temperature sensors. We first run a jumper wire from pin 53 to the breadboard.
From this point of the breadboard to the gate of the MOSFET, we connect a 10k
resistor as shown in figure 4 of the circuit diagram on page 14. We then connect a
wire from the drain and tie the source to ground and leave another wire available.
These extra wires will be connected to the carbon fiber strip later on.
As an added feature we add an LED light onto the breadboard. Pin 22 from
the Arduino to the LED is connected and a 1k resistor is used to prevent the LED
from receiving too much current and shorting out. This LED will serve as an
indicator of when the system is currently active and when the system is inactive.
When the system is active the LED will be on or HIGH and when the system is inactive the LED will be off
or LOW.
All electronic components for the Arduino have been connected. This concludes the hardware
portion of the microcontroller. Now we must program the Arduino to correspond with all of the newly
added hardware. This includes reading/writing from the temperature sensors to the LCD, activating the
MOSFET when necessary and activating the LED indicator to show us the status of the system.


Figure 5 - Pin
configuration of
the DS18B20
temperature
sensor. (From
Manufacturer
Datasheet).
18


To read/write information from the temperature sensors we will need two libraries called
DallasTemperature.h and OneWire.h. Once these libraries are properly put into the right directory of our
Arduino folder on our computer we can begin to write the program needed. For the first part of the
program we include the Liquid Crystal library as before. Now we add the OneWire library and
DallasTemperature library. After the header files we must declare which pins we are going to use for
the temperature sensors. Since these are digital temperature sensors, we select a digital port on the
Arduino Mega 2560 board. The one we choose is pin 52. Since we have chosen pin 52, we connect a
wire from pin 52 to the breadboard.
The next step is to write the program to accommodate the digital temperature sensors. We
write the code just after the header files and before the void setup() routine as shown in the appendix
(1-4). Now that we have the proper definitions for the sensors to be used on the same pin we must find
which address (location) each sensor sends/receives information from on the board. To do this an
Arduino sketch called OneWire Address Finder is used. The full program can be found in the appendix.
We run it and take note of the addresses found. We take these addresses and insert them into our
sketch and give them names amb and sys.
At this point in the program we have define all of the necessary variables to read/write the
temperatures onto the LCD display. The next step is to do some fine tuning and make sure the program
outputs what information we need. Under the void setup() routine we define the resolution of the
temperature sensors to be 12-bit. This means that they will be more accurate in each of the
measurements taken. This part of the code can be seen in the appendix (1-4).
These commands are proprietary with the use of the DallasTemperature.h library. If we didnt have the
library installed then we could not use these commands. Another command we must also include is to
initialize the sensors to start taking measurements once the board is powered on.
The original formatting for the LCD is remained in-tact under the void setup() routine as done
previously. The next step is to constantly read and write the temperatures and display them. This has to
be done under the void loop() routine. This section of the program runs over and over again. It never
stops until the board is turned off or reset. First we use the command sensors.requestTemperatures();
to activate each sensor within the loop. This retrieves the temperature measurement from the sensor.
We then position the text to be between Amb.Temp: (number value here) F.
The command sensors.getTempCByIndex(sensor) is the command to display the temperature .
The default value is in Celsius. Therefore we must use this command along with the formula for
converting from Celsius to Fahrenheit to get the proper value for the ambient temperature as shown in
appendix 1-4. The temperature is then put into the variable ftemp1 and finally we add a delay of
100ms to properly space each measurement. This is so we dont have rapidly fluctuating temperatures
being displayed on the screen and were able to read what is being displayed.
We write similar code for the system temperature sensor. The only difference is that we set the
cursor for the second line of text, change the value for the sensor to 0 in the
sensors.getTempCByIndex(sensor) command and the value is stored into ftemp2.



19

The sketch is uploaded to the board and we observe the output on the LCD. We currently read
the ambient temperature with the sensor on the breadboard and the system temperature with the
sensor thats connected to the extra-long jumper wire thats also connected to the other point on the
breadboard. We place our hand on each sensor separately and observe the temperature increasing.
Now that we can read/write values for the temperature; the program must be adjusted to regulate the
MOSFET based on temperature and turn the LED on and off. To do this we must first define the pins
weve connected the MOSFET and LED to before the void setup() in the program by defining pins 22 and
53, respectively. We initialize pins 22 and 53 and give them the names ledPin and relayPin
respectively. Despite the fact we are not using a relay we call it relayPin because of its relay-like action.
Once the pins have been declared we must make sure these two pins are set as outputs. If not
then we will not be able to use them for our purposes. Under the void setup() structure of the sketch we
place the following code while retaining the rest as shown in appendix 1-4.
The pins weve needed have been setup as outputs. The final step is to add the code to the void loop()
structure to activate the LED and MOSFET when the ambient temperature reaches a certain level which
is the goal.
If you recall the ambient temperature sensor is ftemp1. In this case we have set the threshold
temperature to be 82 degrees which was the room temperature at time of testing. If the ambient
temperature is less than 82 degrees than the ledPin (connected to the LED) is set to high indicating the
system is on. Also the relayPin (connected to the MOSFETs gate) is set to high. When this occurs the
gate opens allowing current for our DC power supple to flow through.
If the ambient temperature is above the threshold programmed (82) then the LED pin will be set
to LOW and the LED will turn off. Likewise the pin connected to the MOSFETs gate will close thus
preventing current from flowing through the loop of our system. This concludes the programming
portion of the microcontroller. The full code can be found in the appendix.

20

Testing:

Now that microcontroller has been programmed to meet our needs and weve obtained all parts
we must connect all components and run the experiment. The power supply we will be using is an
adjustable Labvolt AC/DC power
supply. However before we connect
the microcontroller to the system we
want to see how the carbon-fiber
responds to the voltage/current
running through it. We want to
measure the temperature and note
the values at each value for the
voltage and see if they correspond to
the simulated results. We will only be
using the microcontroller at this
point the measure the temperature
of the carbon fiber strip.
Recall in the simulation that
the beginning temperature was 32F.
In the actual experiment this is not
true since we are starting at room
temperature. Therefore we will start
at 4.5V and go up to 10V to alleviate any discrepancies. Once again we have measured the resistance of
the carbon-fiber strip which was found to be approximately 22. Next, we apply voltage/current to the
strip at 4.5V and wait for approximately 1-2 minutes for it to reach maximum temperature as we
observe on the LCD display. We do this for each of the voltages in 0.5V increments and note the values
in the table below:





Voltage
(V)
Current
(A)
Temperature
(F)
4.5 0.205 85.52
5 0.227 90.47
5.5 0.250 94.42
6 0.273 98.34
6.5 0.295 101.16
7 0.318 104.89
7.5 0.341 110.13
8 0.364 115.58
8.5 0.386 121.60
9 0.409 126.74
9.5 0.432 131.21
10 0.455 136.95
Figure 6 - Testing the carbon-fiber strip in the lab.
Figure 7 - Graph of the experimental results.
21

Upon examining the data from the experiment and comparing it to the simulation, we can see
they are strikingly similar. On each measurement for the voltage there is only about a +3F difference.
From the data as well as physical contact with the system weve found any voltage above 7V to be too
hot and unstable. By unstable we mean the connectors going from the power supply to the carbon-strip
were getting too hot and would was becoming a fire hazard.
Now that we have successfully tested the carbon-fiber strip with the proper voltages we can
begin to connect the entire system together. To do that we must first visualize how everything will be
connected. We start by creating a block diagram for the system as shown in figure 7.













From this block diagram we can also create another model using a program called Fritizing. Fritzing is
used to make a visual representation of an Arduino project.


Figure 8 - Block diagram for the system.
Figure 9 - Fritzing model of the system.
22

Discussion/Conclusion:

Following these diagrams, we are able to connect the working system, test it extensively and
demonstrate it in front of the class. Further testing included taking some crushed ice and placing it onto
the carbon-fiber strip. It took approximately 3-minutes to melt the ice. Unfortunately this project was
complete around the middle of April when the snow had ceased in the region where the system was
being tested.
From testing we have successfully created what we have intended. An electric deicing system
with carbon-fiber has the heating element. Its automatically regulated based on environmental
(ambient) temperature. This is just the basic system. There is much more room for several
improvements. For example, we could add a moisture sensor to detect when snow/ice forms on the
system thus activating it. Also we thought that there could be monitoring of the system, wirelessly from
a device that is compatible, such as a cell phone or laptop.
If this device were to be used in a residential setting then provisions would have to be made in
order to make it safe to use with the public. For example the strips would have to be planted into a
material we have selected to be SBR (Styrene-Butadiene Rubber).

Some Properties of SBR
6
:

Durometer or Hardness Range
30 95 Shore A
Tensile Strength Range
500 3,000 PSI
Elongation (Range %)
450 % 600 %
Abrasion Resistance
Excellent
Adhesion to Metal
Excellent
Adhesion to Rigid Materials
Excellent
Compression Set
Good to Excellent
Flex Cracking Resistance
Good
Impact Resistance
Excellent
Resilience / Rebound
Good
Tear Resistance
Fair to Excellent
Vibration Dampening
Fair to Good

Another important factor of this rubber are the thermal properties.


6
http://www.robinsonrubber.com/pdfs/StyreneButadieneRubber.pdf
23

Thermal Properties:

Low Temperature Range: - 60 F to -
30 F
Minimum for Continuous Use (Static):
- -60 F
Brittle Point: - -80 F
High Temperature Range: + 210 F to
+ 250 F
Maximum for Continuous Use
(Static): + 225 F



From these properties we see that its an ideal material to be used for the finished product.
Another factor to consider is that the more area covered would mean more power consumed. If there is
a large area such as a driveway then the carbon strips would certainly need to be longer. That would
mean a need for a larger power supply.
Primarily, we were using 7V/0.3A for the experiment. This equates to approximately 2.1W.
Using this information we can do an analysis of the power for the system weve built:

2.1W/s for 1 min. = 126W to operate for 1 min.
2.1W/s for 1 hour = 7.560kW to operate for 1 hour.
2.1 W/s for 1 day = 18.1kW to operate for 1 day.

This is just for one strip. If we were to scale the system up and use even more strips then the average
amount of kilowatts used would dramatically increase. For one strip we are already at the equivalent
kWh usage for an electric stove.
7
That doesnt seem very efficient considering the size of the carbon-
fiber strip. Most likely such a system wouldnt be marketable even though it seems to surpass current
systems in terms of execution and feasibility.



7
http://www.efficiencyvermont.com/for_my_home/ways-to-save-and-
rebates/appliances/refrigerators/general_info/electric_usage_chart.aspx
Figure 10 - Concept image of the final system.
24

Scalability:

We are interested in seeing if the system weve built can be scaled up easily. By scaled up we
mean the total area we can cover with our prototype system. For scalability we want to use the same
size strips and see how large of an area we can cover with this unit size. We have tried expanding the
setup using two strips in parallel spaced evenly apart. From the prototype weve had the strips spaced
approximately 10cm (~3.93in.) apart. The reason for this amount of spacing is the even number, 10 can
be calculated easily with any number of strips. Also the amount of heat generated remains in a small
area allowing for greater ice dissipation. If the strips were to be farther apart (as tested) the heat will
not be concentrated enough and thus not efficient. If theyre too close then we will need a lot more
strips thus driving up the cost of the prototype and the amount of energy used.
From previous measurements we know that each strip is 0.67m x 0.01m x 0.002m. Therefore we
can calculate the total area covered by the prototype. Were using two strips spaced 10cm apart. So the
area covered is calculated to be:

=

= 0.67
= 2 (0.01) +0.1 = 0.12

= (0.67)(0.12) = 0.0804

All lengths are in meters to alleviate confusion in calculation. The total area covered from our prototype
is 0.0804m
2
. We would like to see how much more area can be covered using this prototype before we
need to expand the number of components such as the microcontroller, MOSFET, etc.
The components arent ideal as with anything applied to a realistic scenario. Theoretically we
can use single components to control an infinite number of systems. However when we actually build
the circuit, its limited. The primary component that controls the system (beside the microcontroller) is
the N-Channel MOSFET. The MOSFET is a logic gate and the number of inputs to a realistic logic gate is
limited. This is referred to as fan-out. A perfect logic gate would have infinite input impedance and
zero output impedance, allowing a gate output to drive any number of gate inputs. However, since real-
world fabrication technologies exhibit less than perfect characteristics, a limit will be reached where a
gate output cannot drive any more current into subsequent gate inputs - attempting to do so causes the
voltage to fall below the level defined for the logic level on that wire, causing errors.
8

That being said, we must find the maximum number of inputs to our N-Channel MOSFET for
scalability. We certainly cannot connect any number of strips we need to the current prototype with the
idea of fan-out. The current MOSFET were using is rated at 60V/30A which is the maximum load.
Therefore our current prototype can be scaled up to use 60V/30A using one MOSFET and the proper
number of strips.
To test the prototype with two strips weve used our own 5V/12A power supply. Two strips
were connected in parallel to the power supply and to the MOSFET as in the original design. We find
that the amount of current running through each strip is approximately 0.23A. The MOSFET is rated at
60V/30A. Therefore we take the total current that the MOSFET is rated at and divide it by the amount of
current in each strip:
30
0.23
= 130.43 130

8
https://en.wikipedia.org/wiki/Fanout
25

We calculate the number of strips supported by our MOSFET to be 130. This is the absolute
maximum number of strips we can use at this voltage before it begins to fail. To calculate the amount of
area covered by 130 strips of our size we do the same as with two strips. However we can expedite the
process by deriving an equation for the vertical height using the number of strips, number of spaces,
height of each strip and the vertical spacing of each strip:

[( ) +( 1) ()]
Where:

n = Number of strips
H = height of each strip (m)
n-1 = Number of spaces
y = vertical spacing of each strip (m)
L = Length of each strip

For our specific MOSFET we have calculated the number of strips (n) to be 130. The height of each strip
is 0.01. The number of spaces is simply 1 less than the number of strips and the vertical spacing of each
strip was selected to be 0.1m apart. So, we plug these numbers into the above function and obtain:

[(130 0.01) +(129) (0.1)] 0.67

This is equivalent to 9.66m
2
. This is the maximum amount of area that can be covered with one N-
Channel Enhancement mode MOSFET rated at 60V/30A. However the power supply used to test the
system only has a maximum current draw of 12A.

=
1

1
22

1
=
1

1
22

50
1
0.44

=

=
5
0.44
11.36

With the 5V/12A power supply we would only be able to use approximately 50 strips. 50 strips would
only cover an area of 3.618m
2
using the above equation for area. Therefore we would need a bigger
power supply rated at 30A or above to cover the area of 9.66m
2
with 130 strips. We would like to get
the maximum use out of each component as possible.











26

Scalability Example:

We would like to cover a driveway of approximately 34.82m
2
. Obviously we cannot use the
same exact prototype that we have built. We must add more to it to accommodate this larger size. We
have calculated the maximum area to be 9.66m
2
using the prototype system coupled with a 5V/30A (or
more amperage) power supply. Therefore we will need nearly 4 times as much from the prototype to
cover this driveway.
To figure out exactly what is needed the proper calculations using the above equation must be
done:

A (Area to be covered) (m
2
) = 34.82.
H = height of each strip (m) = 0.01
y = vertical spacing of each strip (m) = 0.1
L = length of each strip (m) = 0.67

34.82 = [( 0.01) +( 1) (0.1)] 0.67

34.82 = 0.0737( 0.909091)

Upon solving for n:

n = 437.365 437 strips.
So, for this size of area we would be approximately 437 strips. From the prototype we know that the
maximum number of strips supported by one MOSFET is 132. The amount of MOSFETS we need for the
driveway is:

437
132
= 3.31 4

The microcontroller and its 52 digital ports are certainly capable of switching 4 N-Channel MOSFETS.
Also the increased number of MOSFETs is not a problem seeing as how theyre only $0.95 each at the
consumer level. However the number of carbon-strips can be quite costly. The strips purchased for the
prototype are $4.95 each. 437 strips at $4.95 equates to $2163.15. This already is an extravagant price
for the average homeowner looking for a deicing solution to a small area.
Aside from the amount of strips needed to cover the area we must consider the power
consumption to cover the driveway. For the prototype we only used 5V/0.4A which is equivalent to
2.0W. For the driveway we have 437 strips (22) in parallel so we must calculate the total resistance to
find the amount of amperage needed. To find this, we use the formula:

=
1

1
22

1
=
1

1
22

437
1
0.050

Where n is the number of strips.

Then we take the number for the resistance and input it into Ohms Law combined with the power
supply voltage:

27

=

=
5
0.050
= 100

Therefore we have a requirement of a 5V/100A power supply. To generate this amount of power is not a
problem. There are many power supplies currently available to deliver this much voltage and current
and even more if needed.
9
The average computer power supply is around 400-600W. So in terms of
power usage this system could be seen as the equivalent to a desktop computer.
However we would like be smart about using all of this power. Having the system on all of the
time would be a complete waste. Also, what if certain areas have ice/snow and others did not? Keep in
mind for the driveway we are using 4 MOSFETs each being regulated by one microcontroller. That
means the total system for the driveway is broken up into four parts. Each of these parts can have a
moisture sensor. Now granted our original prototype did not have this however this can be noted under
the improvements. If there is moisture (snow/ice) in one section then the system can be triggered thus
causing the snow/ice to melt while leaving the others sections alone. This seems more sensible instead
of regulating the system as a whole based on temperature. Breaking up the entire system into sections
and having each regulated by moisture and

Based on the cost of the electronics, carbon-strips and power usage the prototype scaled up doesnt
seem that cost-effective. To build this drive way prototype we would nearly have to spend in excess of
$3,000. Approximating the costs:
1. $2,200.00 437 Carbon strips
2. $200.00 5V/100A Power Supply
3. $700.00 SBR Rubber.
4. $4.00 4 N-Channel MOSFET
5. $50.00 Arduino Microcontroller
6. $20.00 Wire
7. $40.00 Miscellaneous electronic parts
Total: $3214.00.

This amount of money combined with the electrical usage and complexity doesnt really seem
economically feasible for the average citizen when compared to shoveling snow manually. However it
depends solely on the individual and their financial situation. At this price range the system can be seen
as a luxury device such as a big screen 3D television or a hot tub. Both are complex, cost a lot to operate
and have initially high purchase prices. We think that the target market would be residents of upscale
neighborhoods rather than an average income neighborhood.
Since there are more average income users than above-average income users in many places we
dont think it would be ideal to build such a device. For such an expensive/extravagant system there
doesnt seem to be a large enough target market to defray the cost of manufacturing. That being said I
would personally not recommend building such a system.




9

http://www.ebay.com/sch/i.html?_trksid=p4069.m570.l1313.TR0.TRC0&_nkw=5V%2F120A+power+supply&_saca
t=0&_from=R40



APPENDIX

1

1-1
/ /
Bl i nk
Tur ns on an LED on f or one second, t hen of f f or one second, r epeat edl y.
Thi s exampl e code i s i n t he publ i c domai n.
/ /

/ / Pi n 13 has an LED connect ed on most Ar dui no boar ds.
/ / gi ve i t a name:
i nt l ed = 13;

/ / t he set up r out i ne r uns once when you pr ess r eset :
voi d set up( ) {
/ / i ni t i al i ze t he di gi t al pi n as an out put .
pi nMode( l ed, OUTPUT) ;
}

/ / t he l oop r out i ne r uns over and over agai n f or ever :
voi d l oop( ) {
di gi t al Wr i t e( l ed, HI GH) ; / / t ur n t he LED on ( HI GH i s t he vol t age l evel )
del ay( 1000) ; / / wai t f or a second
di gi t al Wr i t e( l ed, LOW) ; / / t ur n t he LED of f by maki ng t he vol t age LOW
del ay( 1000) ; / / wai t f or a second
}


1-2


#i ncl ude <Li qui dCr yst al . h>
Li qui dCr yst al l cd( 8, 9, 4, 5, 6, 7)

voi d set up( )
{
Lcd. begi n( 16, 2) ; / / posi t i on of LCD t ext i n t he pr oper ar ea
l cd. pr i nt ( Hel l o Wor l d) ; / / pr i nt t ext t o t he LCD
}

voi d l oop( )
{
/ / not hi ng goes her e yet
}
1-3

#i ncl ude <Li qui dCr yst al . h> / / i ncl ude t he LCD Li br ar y
Li qui dCr yst al l cd( 8, 9, 4, 5, 6, 7)

voi d set up( )
{
l cd. begi n( 16, 2) ; / / Posi t i on of LCD t ext i n t he pr oper ar ea
l cd. pr i nt ( " Amb. Temp: " ) ; / / Pr i nt t he f i r st measur ement ' s desi gnat i on
l cd. set Cur sor ( 14, 0) ; / / Posi t i on t he cur sor
l cd. pr i nt ( " F" ) ; / / Temper at ur e uni t desi gnat i on
l cd. set Cur sor ( 0, 1) ; / / Posi t i on t he second l i ne of t ext
l cd. pr i nt ( " Sys. Temp: " ) ; / / Pr i nt t he second measur ement ' s desi gnat i on
l cd. set Cur sor ( 14, 1) ; / / Posi t i on t he cur sor
l cd. pr i nt ( " F" ) ; / / Temper ar t ur e uni t desi gnat i on
}

voi d l oop( )
{
/ / not hi ng goes her e yet
}
2

1-4
#i ncl ude <OneWi r e. h> / / The Temper at ur e Sensor Li br ar y
#i ncl ude <Dal l asTemper at ur e. h> / / The Temper at ur e Sensor Li bar y ( Fr omManuf act ur er )
#i ncl ude <Li qui dCr yst al . h> / / The Li qui d Cr yst al Li br ar y

/ / I ni t i al i zat i ons
#def i ne ONE_WI RE_BUS 52 / / Set s t he t emp sensor s t o r ead f r ompi n 52
Li qui dCr yst al l cd( 8, 9, 4, 5, 6, 7) ;
OneWi r e oneWi r e( ONE_WI RE_BUS) ;
Dal l asTemper at ur e sensor s( &oneWi r e) ;
doubl e f t emp1;
doubl e f t emp2;
i nt l edPi n = 22; / / I ni t i al i ze t he di gi t al por t usi ng t he LED
i nt r el ayPi n = 53; / / I ni t i al i ze t he vol t age por t

Devi ceAddr ess amb = { 0x28, 0xE3, 0xEA, 0x51, 0x04, 0x00, 0x00, 0xC0 }; / / Def i ne
Addr ess of Ambi ent Temper at ur e Sensor
Devi ceAddr ess sys = { 0x28, 0x1D, 0xF3, 0x52, 0x04, 0x00, 0x00, 0xA6 }; / / Def i ne
Addr ess of Syst emTemper at ur e Sensor

/ / Set up
voi d set up( )
{
Ser i al . begi n( 9600) ; / / St ar t t he ser i al moni t or

sensor s. set Resol ut i on( amb, 12) ; / / Ambi ent Sensor has 12- Bi t Resol ut i on
sensor s. set Resol ut i on( sys, 12) ; / / Syst emSensor has 12- Bi t Resol ut i on

/ / Temp Sensor
sensor s. begi n( ) ; / / Read f r omt he sensor l i br ar y

/ / Pi ns
pi nMode ( 22, OUTPUT) ; / / Tur ns of f 33k pul l up r esi st or
pi nMode ( 53, OUTPUT) ; / / Tur ns of f 33k pul l up r esi st or

/ / LCD Set t i ngs
l cd. begi n( 16, 2) ; / / Posi t i on of LCD t ext i n t he pr oper ar ea
l cd. pr i nt ( " Amb. Temp: " ) ; / / Pr i nt t he f i r st measur ement ' s desi gnat i on
l cd. set Cur sor ( 14, 0) ; / / Posi t i on t he cur sor
l cd. pr i nt ( " F" ) ; / / Temper at ur e uni t desi gnat i on
l cd. set Cur sor ( 0, 1) ; / / Posi t i on t he second l i ne of t ext
l cd. pr i nt ( " Sys. Temp: " ) ; / / Pr i nt t he second measur ement ' s desi gnat i on
l cd. set Cur sor ( 14, 1) ; / / Posi t i on t he cur sor
l cd. pr i nt ( " F" ) ; / / Temper ar t ur e uni t desi gnat i on


}/ / Set up Cl osur e

/ / Loop
voi d l oop( ) {

/ / Ambi ent Temp Sensor Readi ng/ Wr i t i ng
sensor s. r equest Temper at ur es( ) ; / / Send t he command t o get t emper at ur es
l cd. set Cur sor ( 10, 0) ;
f t emp1 = ( ( sensor s. get TempCByI ndex( 1) * 1. 8) + 32. 0) ; / / Conver t s t he t emp r eadi ng F
l cd. pr i nt ( f t emp1) ; / / pr i nt t he f i r st r eadi ng f r omt he f i r st sensor
del ay( 100) ;

/ / Syst emTemp Sensor Readi ng/ Wr i t i ng
sensor s. r equest Temper at ur es( ) ; / / Send t he command t o get t emper at ur es
3

l cd. set Cur sor ( 10, 1) ; / / posi t i on t he l cd t ext
f t emp2 = ( ( sensor s. get TempCByI ndex( 0) * 1. 8) + 32. 0) ; / / Conver t s t he t emp r eadi ng F
l cd. pr i nt ( f t emp2) ; / / pr i nt t he second r eadi ng f r omt he second sensor
del ay( 100) ;

/ / Cont r ol St r uct ur e - LED I ndi cat or
i f ( f t emp1 < 82) / / Tur ns t he syst emon l ess/ equal t o t hi s val ue
{
di gi t al Wr i t e( l edPi n, HI GH) ; / / set s t he LED t o 1 ( syst emon i ndi cat or )
di gi t al Wr i t e( r el ayPi n, HI GH) ; / / Set s t he V1 pi n t o hi gh
}
el se i f ( f t emp1 > 82)
{
di gi t al Wr i t e( l edPi n, LOW) ; / / Tur ns t he syst emof f i f above condi t i on i s not met
di gi t al Wr i t e( r el ayPi n, LOW) ; / / Set s V1 pi n t o l ow
}


}/ / Loop Cl osur e

You might also like