Environmental Data Acquisition Using (ENC28J60)

Similar documents
ET-PIC 24 WEB-V1. o Central Processing Unit (CPU) o System. o nanowatt Power Managed Modes. o Analog Features

eip-24/100 Embedded TCP/IP 10/100-BaseT Network Module Features Description Applications

eip-10 Embedded TCP/IP 10-BaseT Network Module Features Description Applications

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

nic424 ENC424J600 10/100-BaseT Network Interface Card Features Description Applications

Health monitoring of an power amplifier using an ethernet controller

PIC Microcontroller and

PIC-P67J60 development board Users Manual

Interfacing Techniques in Embedded Systems

< W3150A+ / W5100 Application Note for SPI >

or between microcontrollers)

Arduino Uno R3 INTRODUCTION

PIC-MAXI-WEB development board Users Manual

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

Mercury System SB310

Bolt 18F2550 System Hardware Manual

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interfacing External Devices using Embedded C Module No: CS/ES/22

Growing Together Globally Serial Communication Design In Embedded System

An SPI Temperature Sensor Interface with the Z8 Encore! SPI Bus

Microcontrollers and Interfacing

CONTENTS. dspicpro4 KEY FEATURES 4 CONNECTING THE SYSTEM 5 INTRODUCTION 6

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Communication Module No: CS/ES/11 Quadrant 1 e-text

Amarjeet Singh. January 30, 2012

AT90SDC10X Summary Datasheet

EXL x240 Graphic LCD Smart Module 3,8 SHORT FORM TECHNICAL SPECIFICATIONS. Via di Corticella, Bologna, Italy

LIN bus board datasheet EB

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

USER'S MANUAL PICEBS2. Hes-so//Valais / ISI / sap - version 1.0 PICEBS2-1/10

BroadR-Reach click PID: MIKROE Weight: 26 g

DATA CONTROL FOR SIGNAL SCAVENGING FOR A PERSONNEL DETECTION SYSTEM. A Thesis. Presented to. The Faculty of the Graduate School

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

PIC Serial Peripheral Interface (SPI) to Digital Pot

Universität Dortmund. IO and Peripheral Interfaces

DoIP Interfacer System: A Low-Cost Alternative to Computer for Basic Network Communication in LAN Environment

SBC44EC. Single board computer for 44 pin PLCC PICs

PRACTICAL DESIGN TECHNIQUES FOR SENSOR SIGNAL CONDITIONING

SBAT90USB162 Atmel. SBAT90USB162 Development Board User s Manual

Pmod modules are powered by the host via the interface s power and ground pins.

Embedded Piano Interfaced with LCD

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Computer Hardware Requirements for Real-Time Applications

Microcontroller & Interfacing

CM5000 DATASHEET v0.1

1. Pin diagram of 8051 and ports

Doc: page 1 of 6

The Atmel ATmega328P Microcontroller

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

MOD-ZIGBEE-PIR sensor development board USER S MANUAL All boards produced by Olimex LTD are ROHS compliant

PIC-32MX development board Users Manual

Linux Kernel Hacking Free Course, 3rd edition. HWMPS: Hardware Monitor & Protection System

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ. Embedded System Design

DEV-1 HamStack Development Board

PCI Host Controller 14a Hardware Reference Release 1.2 (October 16, 2017)

How to create your own peripheral modules for use with the ARC EMSK and embarc

Document: Datasheet Date: 22-Mar-11 Model #: 3679 Product s Page:

Axiom Manufacturing. Users Manual. for PROJECT DEVELOPMENT BOARD AXM xiom anufacturing

Unlocking the Potential of Your Microcontroller

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

PIXI click PID: MIKROE Weight: 28 g

ADM-96S AND ADM-48D HIGH PERFORMANCE DATA ACQUISITION SYSTEMS

PIC Microcontroller Introduction

CCVPX-16AI32SSC1M. 32-Channel, Differential, 16-Bit Simultaneous Sampling; Conduction-Cooled VPX Analog Input Board

EMX Module Specifications

MicroBolt. Microcomputer/Controller Featuring the Philips LPC2106 FEATURES

Microcontrollers and Interfacing week 10 exercises

Microcontroller. BV523 32bit Microcontroller. Product specification. Jun 2011 V0.a. ByVac Page 1 of 8

An Arduino Controlled 1 Hz to 60 MHz Signal Generator

Manual of Board ET-PIC STAMP 18F8722-K22 ET-PIC STAMP 18F8722-K22

keyestudio Keyestudio MEGA 2560 R3 Board

UNIT 3 THE 8051-REAL WORLD INTERFACING

64-Channel, 16-Bit Simultaneous Sampling PMC Analog Input Board

Dwarf Boards. DN001 : introduction, overview and reference

PXA270 EPIC Computer with Power Over Ethernet & Six Serial Protocols SBC4670

CPCI-HPDI32ALT High-speed 64 Bit Parallel Digital I/O PCI Board 100 to 400 Mbytes/s Cable I/O with PCI-DMA engine

PIC-LCD-3310 development board Users Manual

2016, IJournals All Rights Reserved Page 121

AT90SO72 Summary Datasheet

Serial Buses in Industrial and Automotive Applications

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

PmodJSTK2 Reference Manual. Overview. 1 Functional Descriptions. Revised July 19, 2016 This manual applies to the PmodJSTK2 rev. C

The Atmel ATmega168A Microcontroller

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Module 1. Introduction. Version 2 EE IIT, Kharagpur 1

Various power connectors. 3.3V regulator. 64K Flash (Internal) 2K EEPROM (Internal) 4K SRAM (Internal) JA Mem Adr/ Data. Doc: page 1 of 9

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

Microcontroller basics

ATHENA32 PIC32 Evaluation Board ATHENA32. Product Datasheet. Francesco Ficili Date 13/01/2019. Pag. 1

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

Card Reader Board EB037-00

UART TO SPI SPECIFICATION

AT90SO36 Summary Datasheet

ACU6. Technical Reference Manual. Specifications Interfacing Dimensions. Document topics. ANSARI Controller Unit Type 6 technical reference manual

XMC-16AI32SSC1M. 32-Channel, Differential, 16-Bit Simultaneous Sampling XMC Analog Input Board

ARDUINO YÚN MINI Code: A000108

3 PHASE FAULT ANALYSIS WITH AUTO RESET FOR TEMPORARY FAULT AND TRIP FOR PREMANENT

Transcription:

Environmental Data Acquisition Using (ENC28J60) Joshi Vaibhav Abstract -- Ethernet is a local area technology, which is used for reliable and efficient transfer and access of information across the devices connected to the network. Once a device is attached to the network, it will have the ability to communicate with any other attached device. This allows the network to expand to accommodate new devices without requiring any modification to those devices already on the network. I. INTRODUCTION In an industry there are many locations in which we need exact amount of environmental parameters such as temperature, humidity, CO 2 gas etc. To get type of system which is capable of continuously monitor and control such parameters of an environment we need embedded field. In case of embedded applications, the lightweight protocols like SPI, I2C and UART would not add the capability of controlling your standalone device from any remote place. That is when the need for adding an Ethernet interface to your embedded device is felt. To facilitate this need you would need some additional hardware which would include an Ethernet PHY and a networking protocol stack. Along with the industry in many of the cases such as hospital, research centers we need to have such a system utility. The major part of the system goes to the Ethernet controller ENC28J60, which is used for remote monitoring of environmental data through the internet. II. SYSTEM DEVELOPMENT A. General Description Many of the physical quantities in environment are analog in the nature. However the microcontroller based design requires the data to present in digital format. As a preliminary test of a system we will just measure the room temperature and display the current room temperature on to the LCD connected to the PIC16F877A microcontroller. The same readings are to be transmitted to the internet via the SPI (Serial Peripheral Interface) pins (i.e. SDI, SDO, SCK, CS) of microcontroller device, which are connected to the SPI pins of a suitable Ethernet Controller (in this case we use ENC28J60 Ethernet Controller) which then converts the data acquired by MCU into the Ethernet packets for transmission over the internet. The generalized block diagram of a system is as shown in the figure below: Figure 1. General block diagram of a system B. CO 2 gas sensor module The CO2 Gas Sensor Module is designed to allow a microcontroller to determine when a preset Carbon Dioxide gas level has been reached or exceeded. Interfacing with this sensor is done through a 4-pin SIP header and requires two I/O pins from the host microcontroller. The sensor module is intended to provide a means of comparing gas sources and being able to set an alarm limit when the source becomes excessive. Features: Easy SIP header interface Compatible with most microcontrollers Low-power standby mode Key Specifications: Power requirements: 6.5 12 VDC @ ~165 ma (heater on) / ~1.2 ma (heater off) Interface: 1 TTL compatible input (CNTL), 1 TTL compatible output (ALR) Operating temperature: 32 F to 158 F (0 C to 70 C) Dimensions: 1.50 x 1.00 x 1.00 (38.1 mm x 25.4 mm x 25.4 mm) (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 35

Application Ideas: Gas level over-limit alarm Stand-alone/background sensing device Environmental monitoring equipment microcontroller is used to convert the analogue output of the sensor into its equivalent digital value. The internal ADC of the microcontroller has eight channels of analogue input and gives 10-bit digital output. In this project, the r e f e r e n c e voltage to the ADC is the same as the supply voltage to the microcontroller, i.e., 5V. Figure 2. Top view of CO 2 gas sensor C. Microcontroller Unit (MCU) PIC16F877A Figure 4. Pin diagram of PIC16F877A IC PIC16F877A is an 8-bit microcontroller with 8k 14-bit flash program memory, 368 bytes of RAM and many other extra peripherals like ADC, universal synchronous asynchronous receiver transmitter, master synchronous serial port, timers, compare capture and pulse-width modulation modules, and analogue comparators. It is based on the reduced instruction set computer (RISC) architecture. Figure 3. PIC16F877A in PDIP and QFP The microcontroller processes the sensor output to compute the temperature in degree Celsius. The internal ADC of the Figure 5. Pin diagram of PIC16F877A (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 36

The resolution of the ADC can be calculated as follows: Resolution = Vref / (1024-1) (as it is a 10-bit ADC) = 5/1023 = 4.887 mv (1) It means that for 4.887mV change in the analogue input, the ADC output changes by binary 1 with a reference voltage of 5V. Analogue output of the sensor at its pin 2 is connected to Port A at RA0 for conversion into digital equivalent. D. LCD (Liquid Cristal Display) Controller HD44780 A 16 2 LCD based on HD44780 controller is used for displaying the temperature. The control lines EN, R/W and RS of the LCD module are connected to pins RA1, RA2 and RA3 of Port A of the microcontroller, respectively. The commands and the data to be displayed are sent to the LCD module in the nibble mode from Port D of the microcontroller. The higher four bits of the LCD (D4 through D7) are connected to the lower nibble of Port D (RD0 through RD3). PIC16F877A is used here to display message on the Hitachi HD44780-based character LCD module. Figure 6. LCD used in 4-bit mode Here PIC16F877A microcontroller is connected to HD44780 LCD in 4-bit interface data, only four bus lines (DB4 to DB7) are used for data transfer. Bus lines DB0 to DB3 are having no connection with microcontroller. The data transfer between the HD44780U and the PIC16F877A is completed after the 4-bit data has been transferred twice. As for the order of data transfer, the four high order bits (for 8-bit operation, DB4 to DB7) are transferred before the four low order bits (for 8-bit operation, DB0 todb3).any character on HD44780 LCD is displayed by sending its respective ASCII code. Hence to display 1 on LCD microcontroller has to send 31h as data. When RS pin =0 instruction register is selected and information on data bus is taken as commands. E. Ethernet Controller IC ENC28J60: Ethernet controller ENC28J60 from Microchip forms the building block for our Ethernet Interface add-on Board. It s an SPI based add-on chip which has Ethernet PHY and MAC to equip any embedded controller with SPI interface with network capability. Through this interface our controller can communicate with other devices connected on the network including PCs. It provides easy connection to any microcontroller with only few ports via SPI which makes it perfect for adding Ethernet connectivity to embedded applications. General Description: The Microchip Technology Inc. ENC28J60 is a standalone Ethernet controller with an industry standard Serial Peripheral Interface (SPI ). It is designed to serve as an Ethernet network interface for any microcontroller equipped with SPI. The ENC28J60 meets all of the specifications for IEEE 802.3. It incorporates a number of packet filtering schemes to limit incoming packets. It also provides internal DMA for fast data throughput and support for hardware assisted IP checksum calculation. Communication with the microcontroller is implemented via SPI, with data rates up to 10 Mbit/s. Dedicated pins are used for LED link and activity indication and for transmit and receive interrupts. Features of ENC28J60 : IEEE 802.3 Compatible Ethernet Controller Integrated MAC and 10BASE-T PHY 8-Kbyte Transmit/Receive Packet Dual Port Buffer SRAM Receiver and Collision Squelch Circuit Supports one 10BASE-T Port with Automatic Polarity Detection and Correction Programmable Automatic Retransmit on Collision Programmable Padding and CRC Generation Programmable Automatic Rejection of Erroneous 10 Mbit/s SPI Interface Block Diagram of ENC28J60: Figure 7. Block diagram of ENC28J60 controller I (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 37

Pin Diagram: Features: Figure 10. Ethernet Interface Board Figure 8. 28-pin SSOP, SOIC and SPDIP Ethernet Controller Microchip s ENC28J60 with SPI interface Supports Data Transfer up to 10 Mb/s LINK/STATUS LEDs for indication/debugging Figure 11. Ethernet Interface Board with power connector F. Ethernet Interface Board Figure 9. 28-pin QFN package It contains the Ethernet Controller ENC28J60 with SPI support and Ethernet Jack MAG Jack (RJ45). The Ethernet Interface Board v1.0 helps to connect a particular embedded device to the network. If a particular embedded device is connected to the network, command or data for that particular embedded device can be provided from any of the devices connected to that network. The Ethernet Interface Board can be connected to the uniboard (which will be the heart of that particular device) and by using SPI pins of the Ethernet controller (ENC28J60) the Ethernet Interface Board communicates with the uniboard. Setting up the Connection: Connect the pins of the Ethernet Interface board with the Development Board (uniboard) accordingly. Figure 12. Interfacing of ENC28J60 with PIC16F877A (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 38

MOSI < - > MOSI MISO < - > MISO SCK < - > SCK CS < - > SS WOL < - > NC (LAN interrupt o/p pin) INT < - > NC (Interrupt o/p pin) CLK0 < - > NC(Programmable clock o/p pin) RST < - > PB7 (in case of uniboard) GND < - > GND 3V3 < - > VCC (in case of uniboard Figure 15. Connecting uniboard directly to the network Figure 13. Ethernet Interface Board interfaced with uniboard III. CIRCUIT DIAGRAM OF A SYSTEM Configurations: There are two different configurations that you can have with the board as shown below of which the first configuration can be used for testing and development purposes while the second one would be used for application purposes. Connecting uniboard directly to the PC: Figure 14. Connecting uniboard directly to PC Connection between the uniboard and Ethernet Interface Board is done as described above and PC is interfaced with the Ethernet Interface Board using the network cable. Figure 16. Circuit diagram of a system IV. SOFTWARE DESCRIPTION Connecting uniboard directly on to the Network: Connection between the uniboard and Ethernet Interface Board is done as described above and Ethernet Interface Board is connected to the network directly. Figure 17. Programming the PIC16F877A (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 39

The software code is written in C language and compiled using Hi-tech C cross compiler in MPLAB IDE. The software performs the following operations in an infinite loop: 1. Initiate analogue-to-digital conversion and obtain the result 2. Calculate the equivalent voltage value from the ADC result 3. Calculate the temperature in degree Celsius from the voltage value 4. Display the temperature on the LCD The voltage output (in volts) of the sensor is: = (ADC result 5)/1023 (2) The temperature in degree Celsius is: = (Sensor output 1000)/10 = Sensor output 100 (3) MPLAB IDE and Hitech C compiler: MPLAB IDE is a very powerful software development tool for Microchip products (microcontrollers). It is available for download at www.microchip.com free of cost. It consists of tools like text editor, cross-assembler, cross-compiler and simulator. Hitech C cross compiler is meant for Microchip PIC10/12/16 series of microcontrollers. Its Lite edition comes free with newer versions of MPLAB IDE like MPLAB v8.2 and v8.3. It can also be downloaded for free from www.htsoft.com. V. CONCLUSION Any microcontroller based system can be connected with the Ethernet interface card and the whole system can be connected to the internet by which we can communicate with the system. The heart of the entire system is the Ethernet controller ENC28J60 which communicates with the MCU through its SPI interface. So MCU only need to have the SPI. This Ethernet Interface can be used to develop different applications like embedded web server, Ethernet based Data acquisition system, internet controlled robot (Telepresence robot) etc. If your embedded device is a robot and you want to control that from a remote place you just need a PC which is connected to the network. From the PC you can send commands to the robot though your Ethernet network. ACKNOWLEDGMENT I gratefully acknowledge all the people who assisted me during this work. It is a pleaser to thank to all the members who encouraged me for this paper presentation, whose words are great encouragement to me. I enjoyed and learnt many more things from this event. Finally, I will welcome all the suggestions from anybody which will definitely nice one. If you found any mistake or error please suggest for the same. Finally, I gratefully acknowledge to all Institute members because of them I got inspiration to write and present this paper in this event. [1] http://thinklabs.in REFERENCES [2] http:// www.datasheetcatalog.com [3] http://www.microchip.com [4] http://www.embeddedmarket.com [5] http://www.robotics.com [6] The 8051 Microcontrollers and Embedded Systems Using Assembly and C, Second Edition, Muhammad Ali Mazidi, Janice Gillispie, Rolin D. McKinlay. [7] PIC Microcontrollers and Embedded Systems Using Assembly and C for PIC18, Pearson International Edition, Muhammad Ali Mazidi, Rolin D. McKinlay, Danny Causey. (NCETCSIT-2011) BAPURAO DESHMUKH COLLEGE OF ENGINEERING, SEVAGRAM Page 40