Sensor De Temperatura Lm35 Con Lcd Simulado En Proteus.odt

  • Uploaded by: Henry Elvis Inga Ccenncho
  • 0
  • 0
  • August 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Sensor De Temperatura Lm35 Con Lcd Simulado En Proteus.odt as PDF for free.

More details

  • Words: 618
  • Pages: 7
Sensor De Temperatura LM35 Con LCD Simulado En Proteus Escrito Por: adminPublicado En: ArduinoFecha de Creación: 2016-07-21visitas: 2256 Sensor de temperatura LM35 con LCD Sensor de temperatura LM35 con LCD Objetivo: Medir temperatura y mostrarla en un lcd, usando un LM35 y un Arduino Uno Material: LM35 Arduino uno Desarrollo: Diagrama de conexión:

Codigo

#include //

BS E D4 D5 D6 D7

int analog_pin = A0; float tempC; float tempF; int tempdigital; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { lcd.begin(16, 2); } void loop() { tempdigital = analogRead(analog_pin); // lectura digital tempC = (tempdigital * 5.0)*100.0/ 1024.0; //lectura analogica tempF = tempC * 9.0 / 5.0 + 32.0; // temperatura en grados F // lcd.clear();

lcd.setCursor(0, 0); lcd.print("Temp"); lcd.setCursor(6, 0); lcd.print(tempC); delay(10); }

Menggunakan I2C dan LCD 16 x 2 pada Arduino di Proteus Arduino Proteus Langsung saja penggunaan I2C di proteus menggunakan library PCF8574, salah satu fungsi penggunaan I2C dimana bisa menghemat pin - pin pada Arduino. Daftar Library yang digunakan di Proteus : Arduino - PCF8574 "untuk alamat I2C "PCF8574" di Proteus adalah 0x20"

Uno LM106L

kemudian buka software Arduino IDE lakukan Compile file hex untuk dimasukan kedalam Virtual Board Arduino di Proteus. berikut ini merupakan sketch di Arduino IDE : #include <Wire.h> #include LiquidCrystal_I2C lcd(0x20 ,2,1,0,4,5,6,7,3, POSITIVE); //0x20 adalah alamat i2c PCF8574 di proteus void { lcd.begin(16, lcd.backlight(); lcd.print("Berbage } void { }

setup() 2);

Selanjutnya susun skema di proteus seperti gambar berikut :

Ilmu"); loop()

Untuk pengujian load file hex yang sudah di compile di Arduino IDE dan masukan ke dalam virtual Arduino di Proteus. Semoga bermanfaat ��

Writting and reading an EEPROM memory via I2C bus with Arduino mayo 29, 2014 oscarsg89 Deja un comentario In this exercise I will show how to write and read an EEPROM memory by I2C interface with an Arduino Uno and simulating with Proteus.

First I had to download the Arduino Uno library for Proteus from the Arduino’s web site (arduino.cc). Now you can start simulating Arduino with Proteus. In Proteus I’ve built the next scheme with the 24LC256 EEPROM memory of Microchip, the Arduino Uno and a LCD display to see the data stored in the memory:

Here is the source code I’ve compiled with the Arduino software to load in the microcontroller: #include #include <Wire.h> LiquidCrystal lcd(6, 7, 8, 9, 10, 11); void i2c_eeprom_write_page( int deviceaddress, unsigned int eeaddresspage, byte *data, byte length ) { Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddresspage >> 8)); // MSB Wire.write((int)(eeaddresspage & 0xFF)); // LSB byte c; for ( c = 0; c < length; c++) Wire.write(data[c]); Wire.endTransmission(); } byte i2c_eeprom_read_byte( int deviceaddress, unsigned int eeaddress ) { byte rdata = 0xFF; Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddress >> 8)); // MSB Wire.write((int)(eeaddress & 0xFF)); // LSB Wire.endTransmission(); Wire.requestFrom(deviceaddress,1); if (Wire.available()) rdata = Wire.read(); return rdata; }

void setup() { char somedata[] = “Hola CIFPN1”; //cadena a escribir Wire.begin(); //es obligatorio inicializar la conexion Serial.begin(9600); i2c_eeprom_write_page(0x50, 0, (byte *)somedata, sizeof(somedata)); //escribir la cadena al principio de la EEPROM; comentar esta linea para probar que la memoria es no volatil delay(10); //pequeña pausa despues de escribir en la memoria lcd.begin(16, 2); lcd.print(somedata); } void loop() { int addr=0; //direccion a leer byte b = i2c_eeprom_read_byte(0x50, 0); //acceso a la primera posicion de memoria while (b!=0) { Serial.print((char)b); //enviar al ordenador addr++; //siguiente direccion b = i2c_eeprom_read_byte(0x50, addr); //acceso a posicion de memoria } Serial.println(); delay(500); } And there are some pics of the result of the simulation with Proteus. First I show you the empty memory:

And then you can see the memory have loaded the data and those data are shown in the LCD and in the virtual terminal.

You can download all the files of this exercise clicking here: https://mega.co.nz/#!zsICyC7Y! HekaH682jvVyeagJRkTSqHLSveKhMdabPSfDrVePfj

Related Documents


More Documents from "Sandeep"

August 2019 8
August 2019 10
John Lennon.docx
December 2019 32