Display Temperature on P10 LED Display Module Using Arduino
by sfeelectronics in Circuits > Arduino
11460 Views, 18 Favorites, 0 Comments
Display Temperature on P10 LED Display Module Using Arduino
In the previous tutorial has been told how to display text on Dot Matrix LED Display P10 Module using Arduino and DMD Connector, which you can check here. In this tutorial we will give a simple project tutorial by utilizing P10 module as display media. This time we will give you tutorial about programming temperature sensor using LM35.
Materials You Need
You will need:
- Arduino Uno
- DMD Connector
- LM35 Temperature Sensor
- Bread Board
- Jumper Wires
Connection
For the connection as shown above.
Program
After the installation is complete go to programming, the programming requires additional library files that you can download >> Library DMD & TimeOne.
Examples of programs as follows:
/* Insert file library */
#include <SPI.h> #include <DMD.h> #include <TimerOne.h> #include <SystemFont5x7.h> #define Panjang 1 // Number of length of Display P10 #define Lebar 1 // Number of width of Display P10 #define sensor A5 // Define sensor pin = pin A5DMD dmd(Panjang, Lebar); // Length x Width /* Deklarasi Variable */ float suhu; char chr[5]; void ScanDMD() { dmd.scanDisplayBySPI(); } void setup(void) { // Setup DMD Timer1.initialize( 5000 ); Timer1.attachInterrupt( ScanDMD ); dmd.selectFont(SystemFont5x7); // Font used dmd.clearScreen( true ); Serial.begin(9600); // Activate function of communication serial } void loop(void) { dmd.clearScreen( true ); suhu = 0; suhu = analogRead(sensor); suhu = (5.0 * suhu * 100.0) / 1024.0; Serial.println(suhu); dtostrf(suhu, 4, 2, chr); dmd.drawString( 2, 0, chr, 5, GRAPHICS_NORMAL ); dmd.drawString( 6, 9, "'Cel", 4, GRAPHICS_NORMAL ); delay(5000); }