btp midsem

42
Abhimanyu Sanghi (02/EC/05) Ankur Verma (15/EC/05) Ashish Bhandari (20/EC/05) Kshitij Gupta (41/EC/05) Mentors Prof. Subrat Kar Astt. Prof. S.P. Singh

Upload: abhimanyu-sanghi

Post on 24-Jul-2015

2.047 views

Category:

Business


6 download

TRANSCRIPT

Page 1: Btp Midsem

Abhimanyu Sanghi (02/EC/05)

Ankur Verma (15/EC/05)

Ashish Bhandari (20/EC/05)

Kshitij Gupta (41/EC/05)

Mentors

Prof. Subrat Kar

Astt. Prof. S.P. Singh

Page 2: Btp Midsem

A quick summaryA quick summary

This presentation discusses a Distributed Climate Control System (DCCS).

Page 3: Btp Midsem
Page 4: Btp Midsem

Motivation behind DCCSMotivation behind DCCS Climate encompasses:

Temperature Humidity

Atmospheric Gases e.g. CO2, CO …..

Ideal climatic conditions and parameter values vary. Climate control essential for:

Manufacturing, processing, packaging, transport or storage of various sensitive goods

To prevent damage, deterioration or contamination of sensitive goods.

Thus, we propose to devise a system to control climate parameters.

Page 5: Btp Midsem

What is Distributed Control Climate What is Distributed Control Climate System (DCCS) ?System (DCCS) ?

Slave Nodes measure parameters

Master logs and responds to changes

Page 6: Btp Midsem
Page 7: Btp Midsem

System Specifications

Cost of each node < Rs. 500. Choice of microcontrollers-> ARM / MSP430 /

AVR / PIC. Interfacing with temperature (LM35), humidity and

carbon dioxide sensors. Interfacing with fan, mister and memory card–

requires Serial Peripheral Interface and Analog to Digital Converter Channels.

Choice of communication networks CAN / RF / RS485 / RS232.

Page 8: Btp Midsem

Choice of Components

1. eZ430-RF2500 Development board.2. MSP430F169.3. AT90CAN32.4. ATmega16.

ATmega16 is selected which meets system requirements

Selection of Microcontroller:

Page 9: Btp Midsem

Choice of Components (Contd.)

1. RS232.2. RS485.3. Zigbee.4. CAN.

CAN Network is selected for our system.

Selection of Communication Network:

Page 10: Btp Midsem

Choice of Components (Contd.)

1. CAN CONTROLLER :MCP2515, Microchip Technology2. CAN TRANSCEIVER :MCP2551, Microchip Technology3. TEMP. SENSOR :LM354. IC-MAX232, General Purpose Board, Resistors, Capacitors,

Switches, LEDs etc.

Total Expenditure per node ~ Rs. 500Total Expenditure per node ~ Rs. 500

Selection of Other Components:

Page 11: Btp Midsem

Block Diagram of SystemBlock Diagram of System

Page 12: Btp Midsem

SPI CAN SPI SPI

Working of SystemWorking of System

Page 13: Btp Midsem

SPI CAN SPI

Working of SystemWorking of System

Page 14: Btp Midsem
Page 15: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

BLOCK DIAGRAM

Page 16: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

LM35 temperature sensor is used in the initial prototype of the system.

The figures have been made using Eagle

Page 17: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

Features of LM35

Output Voltage is proportional to Celsius Temperature.Outputs 10mv for each degree centigrade temperature.Requires no external calibration.Rated for full -55° to +150°C range.

Operates from 4 to 30 volts.

Suitable for remote applications. LM 35

Page 18: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

ADC Registers

ADC Multiplexer Selection Register – ADMUX : For selecting the reference voltage and the input channel.

Page 19: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

ADC Registers Cond….

ADC Control and Status Register A – ADCSRA : It has the status of ADC and is also use for controlling it.

The ADC Data Register – ADCL and ADCH : The final result of conversion is here.

Page 20: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

USART Registers

UDR - USART Data Register : When we read it you will get the data stored in receive buffer and when we write data it goes into the transmitters buffer.

AVR USART registers

Page 21: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

USART Registers Contd.

UCSRA - USART Control and status Register A : It is used to configure the USART and it also stores some status about the USART. There are two more of this kind the UCSRB and UCSRC. UBRRH and UBRRH : This is the USART Baud rate register, it is 16BIT wide so UBRRH is the High Byte and UBRRL is Low byte.

Page 22: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

PORT settings of Hyper terminal

Page 23: Btp Midsem

Interfacing Temperature Sensor Interfacing Temperature Sensor with ATMega16with ATMega16

The result was displayed on Hyper terminal on the computer and verified.

Page 24: Btp Midsem
Page 25: Btp Midsem

Introduction to Controller Area Network (CAN) Bus Standard allows

microcontrollers and devices to communicate with each other without a host computer.

Message based protocol Bit rates up to 1 Mbps

Page 26: Btp Midsem

Introduction to CAN (contd.)

Data transmitted through dominant bits (0) and recessive bits (1).

All devices read bus value while transmitting.

Protocol implements Physical Layer and Data Link Layer of OSI Model.

Page 27: Btp Midsem

Requirements of a Node for CAN Communication

Host processor ATmega16 CAN Controller

MCP2515 CAN

Transceiver MCP2551

Page 28: Btp Midsem

The Master Node - Schematic

Page 29: Btp Midsem

The Slave Node - Schematic

Page 30: Btp Midsem
Page 31: Btp Midsem

Device Driver for CAN ControllerDevice Driver for CAN ControllerFunctions to read from and write to the controller

Page 32: Btp Midsem

Thus, SPI has:Thus, SPI has:

4 interface pinsMOSI, MISO,SCK, SS or CS

3 registersSPDR data, SPSR status , SPSC control

Writing SPDR -> Initiates Data Transfer

All data movement is coordinated by SCK.

SPI Data Register (SPDR)

Page 33: Btp Midsem

Thus, SPI has:Thus, SPI has:

4 interface pinsMOSI, MISO,SCK, SS or CS

3 registersSPCR control , SPSR status , SPDR data

Interrupt flagSet when serial transfer is complete

SPI Status Register (SPSR)

Page 34: Btp Midsem

Thus, SPI has:Thus, SPI has:

4 interface pinsMOSI, MISO,SCK, SS or CS

3 registersSPCR control , SPSR status , SPDR data

Interrupt flagif set, interrupt occurs!

SPI Control Register (SPCR)

SPI enableif set, SPI interface enabled

Clock Polarity and RateIdle mode SCK and Rate

Page 35: Btp Midsem

Code Snippets for CAN Device Code Snippets for CAN Device DriverDriver

Page 36: Btp Midsem

Configuration of CAN ControllerConfiguration of CAN Controller

Resets the CAN Controller

How to transmit data bytes

Page 37: Btp Midsem
Page 38: Btp Midsem

Next Steps….Next Steps….

1.Communication between Master and Slave Node

2.Interfacing of Humidity and Carbon Dioxide Sensors

3.Implementation of Discrete PID Controller

4.Interfacing of Memory Card

Page 39: Btp Midsem
Page 40: Btp Midsem

SummarySummary Average cost of slave node is ~ Rs. 500. Interfacing temp. sensor with

microcontroller. Design and Development of Test board that

includes a master node and a slave node, interfaced with CAN controllers and transceivers.

Implementation of device driver for the CAN Controller

We propose the use of this system as either a stand-alone system in the industry or workplace or as an integrated device with climate modifying appliances such as an air conditioner or a heater.

Page 41: Btp Midsem

ReferencesReferences

For more information refer:

[1] Application Note: AVR 221: Discrete PID Controller for 8-bit AVR microcontrollers

[2] Development Tool User’s Guide for eZ430-RF2500, TI[3] Datasheet: MSP430X16X, Texas Instruments.[4] Datasheet summary: AT90CAN32, Atmel Corporation.[5] Datasheet: ATmega16, Atmel Corporation.[6] David Porter, Steve Gilson, “Data Acquisition System With Controller Area

Network and SD Card”, Cornell Univ.

Page 42: Btp Midsem