SlideShare una empresa de Scribd logo
1 de 15
Arduino Final Project

By: Mhmoud Salama.
    Hussam Hamdy.
Main Project
• To make a temperature sensor that outputs the reading
  as a scrolling message on a LED matrix.
• We used a LED matrix which is a common anode 8x8
  display.
• Wired on breadboards.
Main Concept
• Use of two shift registers (2x 74HC595) to pass the
  encoded-charachter data serially from the arduino as a
  parallel output to the rows and Columns of an 8x8 LED
  matrix.

• The arduino handles the scrolling of the message and the
  periodic time-multiplexing of rows and columns (refresh
  rate = 100Hz), using a periodic interrupt, to which the
  function “screenUpdate” is attached.

• So , we calibrated the sensor using a potentiometer
  through the serial monitor window.
• then the complete circuit is connected.
Wiring Diagram
74HC595-Shift Registers




-- An 8-bit shift register with
Serial to parallel capability.
-- We use two of them, Each
one controlling eight
rows/columns.
LM335-Temperature Sensor
• Calibration:

 -- We connect the calibration circuit , and
 connected it’s output as an analogue input to
 the arduino.

 -- With a potentiometer, and a small code...
 we used the serial monitor of arduino to
  fine-tune the sensor to give an acceptable
 reading (28 C for average room temperature).
CODE
•   #include <TimerOne.h>
•   #include <charEncodings.h>           // Each charachter and it’s (8x8 LED matrix)-mapped code.

•   // BASIC PIN CONFIGURATION
•   // AND DECLARATIONS

•   //Pin connected to Pin 12 of 74HC595 (Latch)
•   int latchPin = 8;
•   //Pin connected to Pin 11 of 74HC595 (Clock)
•   int clockPin = 12;
•   //Pin connected to Pin 14 of 74HC595 (Data)
•   int dataPin = 11;

•   // pin for the potentiometer to control the scrolling speed
•   int potPin = 5;

•   // pin for reading the temperature
•   int tempPin = 4;

•   // this is the gobal array that represents what the matrix
•   // is currently displaying
•   uint8_t led[8];
CODE
• void setup()
• {
    //set pins to output
•     pinMode(latchPin, OUTPUT);
•     pinMode(clockPin, OUTPUT);
•     pinMode(dataPin, OUTPUT);
•     pinMode(potPin, INPUT);
•     pinMode(tempPin, INPUT);
•     analogReference(INTERNAL);

•     // attach the screenUpdate function to the interrupt timer
•   // Period=10,000micro-second /refresh rate =100Hz
•   Timer1.initialize(10000);
•   Timer1.attachInterrupt(screenUpdate);
•   }
CODE
• //Continuous LOOP
• void loop()
• {
• long counter1 = 0;
• long counter2 = 0;
• char reading[10];
• char buffer[18];

•     if (counter1++ >=100000) {
•       counter2++;
•     }
•     if (counter2 >= 10000) {
•       counter1 = 0;
•       counter2 = 0;
•     }

    getTemp(reading);
    displayScrolledText(reading);
}
The (displayScrolledText ) Function

•   void displayScrolledText(char* textToDisplay)
•   {

•    int textLen = strlen(textToDisplay);
•    char charLeft, charRight;

•    // scan through entire string one column at a time and call
•    // function to display 8 columns to the right
•    for (int col = 1; col <= textLen*8; col++)
•   {
•
•       // if (col-1) is exact multiple of 8 then only one character
•       // involved, so just display that one

•       if ((col-1) % 8 == 0 )
•   {
•           char charToDisplay = textToDisplay[(col-1)/8];
•
•   for (int j=0; j<8; j++)
•      {
•        led[j] = charBitmaps[charToDisplay][j];
•      }

•       }

•           else
•       {
•           int charLeftIndex = (col-1)/8;
•           int charRightIndex = (col-1)/8+1;

•           charLeft = textToDisplay[charLeftIndex];
• // check we are not off the end of the string
•     if (charRightIndex <= textLen)
•     {
•       charRight = textToDisplay[charRightIndex];
•     }
•     else
•     {
•       charRight = ' ';
•     }
•     setMatrixFromPosition(charLeft, charRight, (col-1) % 8);
•   }

•       int delayTime = analogRead(potPin);

•       delay (delayTime);
•   }
•}
•   void shiftIt(byte dataOut) {
•    // Shift out 8 bits LSB first,
•    // on rising edge of clock

•    boolean pinState;

•    //clear shift register read for sending data
•    digitalWrite(dataPin, LOW);

•    // for each bit in dataOut send out a bit
•    for (int i=0; i<=7; i++) {
•     //set clockPin to LOW prior to sending bit
•     digitalWrite(clockPin, LOW);

•        // if the value of DataOut and (logical AND) a bitmask
•        // are true, set pinState to 1 (HIGH)
•        if ( dataOut & (1<<i) ) {
•          pinState = HIGH;
•        }
•        else {
•          pinState = LOW;
•        }

•        //sets dataPin to HIGH or LOW depending on pinState
•        digitalWrite(dataPin, pinState);
•        //send bit out on rising edge of clock
•        digitalWrite(clockPin, HIGH);
•        digitalWrite(dataPin, LOW);
•    }
• //stop shifting
• digitalWrite(clockPin, LOW);
• }

• boolean isKeyboardInput() {

• // returns true is there is any characters in the keyboard buffer
• return (Serial.available() > 0);
• }

• }

• // terminate the string
• readString[index] = '0';
• }
•   void setMatrixFromPosition(char charLeft, char charRight, int col) {

•       // take col left most columns from left character and bitwise OR with 8-col from
•       // the right character
•       for (int j=0; j<8; j++) {
•         led[j] = charBitmaps[charLeft][j] << col | charBitmaps[charRight][j] >> 8-col;
•       }
•   }


•   void screenUpdate() {

•       uint8_t col = B00000001;

•       for (byte k = 0; k < 8; k++) {
•        digitalWrite(latchPin, LOW); // Open up the latch ready to receive data

•        shiftIt(~led[7-k]);
•        shiftIt(col);

•        digitalWrite(latchPin, HIGH); // Close the latch, sending the registers data to the matrix
•        col = col << 1;
•       }
•       digitalWrite(latchPin, LOW);
•       shiftIt(~0 );
•       shiftIt(255);
•       digitalWrite(latchPin, HIGH);
•   }
•   void getTemp(char* reading) {

•       int span = 20;
•       int aRead = 0;
•       long temp;
•       char tmpStr[10];

•       // average out several readings
•       for (int i = 0; i < span; i++) {
•         aRead = aRead+analogRead(tempPin);
•       }

•       aRead = aRead / span;

•       temp = ((100*1.1*aRead)/1024)*10;

•       reading[0] = '0';

•       itoa(temp/10, tmpStr, 10);
•       strcat(reading,tmpStr);
•       strcat(reading, ".");
•       itoa(temp % 10, tmpStr, 10);
•       strcat(reading, tmpStr);
•       strcat(reading, "C");

•   }

Más contenido relacionado

La actualidad más candente

Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontrollerRobo India
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IOT Academy
 
14827 shift registers
14827 shift registers14827 shift registers
14827 shift registersSandeep Kumar
 
Digital logic design DLD Logic gates
Digital logic design DLD Logic gatesDigital logic design DLD Logic gates
Digital logic design DLD Logic gatesSalman Khan
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processorDhaval Kaneria
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersCorrado Santoro
 
Digital logic design lecture 04
Digital logic design   lecture 04 Digital logic design   lecture 04
Digital logic design lecture 04 FarhatUllah27
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentationarushi bhatnagar
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Ron Liu
 
EASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic CircuitEASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic Circuitsoulstalker
 

La actualidad más candente (20)

Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontroller
 
Unix signals
Unix signalsUnix signals
Unix signals
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Alu description[1]
Alu description[1]Alu description[1]
Alu description[1]
 
14827 shift registers
14827 shift registers14827 shift registers
14827 shift registers
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
 
Digital logic design DLD Logic gates
Digital logic design DLD Logic gatesDigital logic design DLD Logic gates
Digital logic design DLD Logic gates
 
Registers siso, sipo
Registers siso, sipoRegisters siso, sipo
Registers siso, sipo
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
 
FPGA Tutorial - LCD Interface
FPGA Tutorial - LCD InterfaceFPGA Tutorial - LCD Interface
FPGA Tutorial - LCD Interface
 
Uart
UartUart
Uart
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F Microcontrollers
 
Digital logic design lecture 04
Digital logic design   lecture 04 Digital logic design   lecture 04
Digital logic design lecture 04
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
Logic gate
Logic gateLogic gate
Logic gate
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現
 
Shift register
Shift registerShift register
Shift register
 
EASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic CircuitEASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic Circuit
 
Shift registers
Shift registersShift registers
Shift registers
 

Destacado

Temperature Sensor
Temperature SensorTemperature Sensor
Temperature SensorEnricVentosa
 
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNO
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNOCONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNO
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNOSusanti Arianto
 
A 64-by-8 Scrolling Led Matrix Display System
A 64-by-8 Scrolling Led Matrix Display SystemA 64-by-8 Scrolling Led Matrix Display System
A 64-by-8 Scrolling Led Matrix Display SystemSamson Kayode
 
5x7 matrix led display
5x7 matrix led display 5x7 matrix led display
5x7 matrix led display Vatsal N Shah
 
Automatic DC Fan using LM35 (english version)
Automatic DC Fan using LM35 (english version)Automatic DC Fan using LM35 (english version)
Automatic DC Fan using LM35 (english version)Nurlatifa Haulaini
 
Moving message display
Moving message displayMoving message display
Moving message displayviraj1989
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
Temperature Controller with Atmega16
Temperature Controller with Atmega16Temperature Controller with Atmega16
Temperature Controller with Atmega16Siddhant Jaiswal
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
 
Control Fan AC With LM-35 Sensor Based Arduino
Control Fan AC With LM-35 Sensor Based Arduino Control Fan AC With LM-35 Sensor Based Arduino
Control Fan AC With LM-35 Sensor Based Arduino Anjar setiawan
 
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24Jigyasa Singh
 
Digital Notice Board
Digital Notice BoardDigital Notice Board
Digital Notice BoardRaaki Gadde
 

Destacado (20)

Temperature Sensor
Temperature SensorTemperature Sensor
Temperature Sensor
 
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNO
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNOCONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNO
CONTROL FAN AC USING TEMPERATURE SENSOR LM35 BASED ON ARDUINO UNO
 
A 64-by-8 Scrolling Led Matrix Display System
A 64-by-8 Scrolling Led Matrix Display SystemA 64-by-8 Scrolling Led Matrix Display System
A 64-by-8 Scrolling Led Matrix Display System
 
5x7 matrix led display
5x7 matrix led display 5x7 matrix led display
5x7 matrix led display
 
Automatic DC Fan using LM35 (english version)
Automatic DC Fan using LM35 (english version)Automatic DC Fan using LM35 (english version)
Automatic DC Fan using LM35 (english version)
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Catalogo unitronics 2012_intrave
Catalogo unitronics 2012_intraveCatalogo unitronics 2012_intrave
Catalogo unitronics 2012_intrave
 
8x8 dot matrix(project)
8x8 dot matrix(project)8x8 dot matrix(project)
8x8 dot matrix(project)
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Temperature Controller with Atmega16
Temperature Controller with Atmega16Temperature Controller with Atmega16
Temperature Controller with Atmega16
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontroller
 
Home automation
Home automationHome automation
Home automation
 
Lm35
Lm35Lm35
Lm35
 
Control Fan AC With LM-35 Sensor Based Arduino
Control Fan AC With LM-35 Sensor Based Arduino Control Fan AC With LM-35 Sensor Based Arduino
Control Fan AC With LM-35 Sensor Based Arduino
 
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
 
Lm 35
Lm 35Lm 35
Lm 35
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Lm35
Lm35Lm35
Lm35
 
Digital Notice Board
Digital Notice BoardDigital Notice Board
Digital Notice Board
 

Similar a Temperature sensor with a led matrix display (arduino controlled)

Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduinoSravanthi Sinha
 
Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhDIVYA SINGH
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp fullVõ Hòa
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engineDuoyi Wu
 
GPIO In Arm cortex-m4 tiva-c
GPIO In Arm cortex-m4 tiva-cGPIO In Arm cortex-m4 tiva-c
GPIO In Arm cortex-m4 tiva-cZakaria Gomaa
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide showMax Kleiner
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321Teddy Hsiung
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecturePallaviBR4UB20EI021
 
Arduino and Robotics
Arduino and RoboticsArduino and Robotics
Arduino and RoboticsMebin P M
 
Micro_Controllers_lab1_Intro_to_Arduino.pptx
Micro_Controllers_lab1_Intro_to_Arduino.pptxMicro_Controllers_lab1_Intro_to_Arduino.pptx
Micro_Controllers_lab1_Intro_to_Arduino.pptxGaser4
 
The Ring programming language version 1.5.1 book - Part 84 of 180
The Ring programming language version 1.5.1 book - Part 84 of 180The Ring programming language version 1.5.1 book - Part 84 of 180
The Ring programming language version 1.5.1 book - Part 84 of 180Mahmoud Samir Fayed
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Yulia Tsisyk
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net PerformanceCUSTIS
 

Similar a Temperature sensor with a led matrix display (arduino controlled) (20)

Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
 
Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singh
 
Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp full
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engine
 
GPIO In Arm cortex-m4 tiva-c
GPIO In Arm cortex-m4 tiva-cGPIO In Arm cortex-m4 tiva-c
GPIO In Arm cortex-m4 tiva-c
 
Appsec obfuscator reloaded
Appsec obfuscator reloadedAppsec obfuscator reloaded
Appsec obfuscator reloaded
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
8051 MC.pptx
8051 MC.pptx8051 MC.pptx
8051 MC.pptx
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide show
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture
 
Lec06
Lec06Lec06
Lec06
 
Parameters
ParametersParameters
Parameters
 
Arduino and Robotics
Arduino and RoboticsArduino and Robotics
Arduino and Robotics
 
Micro_Controllers_lab1_Intro_to_Arduino.pptx
Micro_Controllers_lab1_Intro_to_Arduino.pptxMicro_Controllers_lab1_Intro_to_Arduino.pptx
Micro_Controllers_lab1_Intro_to_Arduino.pptx
 
Lec 2.pptx
Lec 2.pptxLec 2.pptx
Lec 2.pptx
 
The Ring programming language version 1.5.1 book - Part 84 of 180
The Ring programming language version 1.5.1 book - Part 84 of 180The Ring programming language version 1.5.1 book - Part 84 of 180
The Ring programming language version 1.5.1 book - Part 84 of 180
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net Performance
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Temperature sensor with a led matrix display (arduino controlled)

  • 1. Arduino Final Project By: Mhmoud Salama. Hussam Hamdy.
  • 2. Main Project • To make a temperature sensor that outputs the reading as a scrolling message on a LED matrix. • We used a LED matrix which is a common anode 8x8 display. • Wired on breadboards.
  • 3. Main Concept • Use of two shift registers (2x 74HC595) to pass the encoded-charachter data serially from the arduino as a parallel output to the rows and Columns of an 8x8 LED matrix. • The arduino handles the scrolling of the message and the periodic time-multiplexing of rows and columns (refresh rate = 100Hz), using a periodic interrupt, to which the function “screenUpdate” is attached. • So , we calibrated the sensor using a potentiometer through the serial monitor window. • then the complete circuit is connected.
  • 5. 74HC595-Shift Registers -- An 8-bit shift register with Serial to parallel capability. -- We use two of them, Each one controlling eight rows/columns.
  • 6. LM335-Temperature Sensor • Calibration: -- We connect the calibration circuit , and connected it’s output as an analogue input to the arduino. -- With a potentiometer, and a small code... we used the serial monitor of arduino to fine-tune the sensor to give an acceptable reading (28 C for average room temperature).
  • 7. CODE • #include <TimerOne.h> • #include <charEncodings.h> // Each charachter and it’s (8x8 LED matrix)-mapped code. • // BASIC PIN CONFIGURATION • // AND DECLARATIONS • //Pin connected to Pin 12 of 74HC595 (Latch) • int latchPin = 8; • //Pin connected to Pin 11 of 74HC595 (Clock) • int clockPin = 12; • //Pin connected to Pin 14 of 74HC595 (Data) • int dataPin = 11; • // pin for the potentiometer to control the scrolling speed • int potPin = 5; • // pin for reading the temperature • int tempPin = 4; • // this is the gobal array that represents what the matrix • // is currently displaying • uint8_t led[8];
  • 8. CODE • void setup() • { //set pins to output • pinMode(latchPin, OUTPUT); • pinMode(clockPin, OUTPUT); • pinMode(dataPin, OUTPUT); • pinMode(potPin, INPUT); • pinMode(tempPin, INPUT); • analogReference(INTERNAL); • // attach the screenUpdate function to the interrupt timer • // Period=10,000micro-second /refresh rate =100Hz • Timer1.initialize(10000); • Timer1.attachInterrupt(screenUpdate); • }
  • 9. CODE • //Continuous LOOP • void loop() • { • long counter1 = 0; • long counter2 = 0; • char reading[10]; • char buffer[18]; • if (counter1++ >=100000) { • counter2++; • } • if (counter2 >= 10000) { • counter1 = 0; • counter2 = 0; • } getTemp(reading); displayScrolledText(reading); }
  • 10. The (displayScrolledText ) Function • void displayScrolledText(char* textToDisplay) • { • int textLen = strlen(textToDisplay); • char charLeft, charRight; • // scan through entire string one column at a time and call • // function to display 8 columns to the right • for (int col = 1; col <= textLen*8; col++) • { • • // if (col-1) is exact multiple of 8 then only one character • // involved, so just display that one • if ((col-1) % 8 == 0 ) • { • char charToDisplay = textToDisplay[(col-1)/8]; • • for (int j=0; j<8; j++) • { • led[j] = charBitmaps[charToDisplay][j]; • } • } • else • { • int charLeftIndex = (col-1)/8; • int charRightIndex = (col-1)/8+1; • charLeft = textToDisplay[charLeftIndex];
  • 11. • // check we are not off the end of the string • if (charRightIndex <= textLen) • { • charRight = textToDisplay[charRightIndex]; • } • else • { • charRight = ' '; • } • setMatrixFromPosition(charLeft, charRight, (col-1) % 8); • } • int delayTime = analogRead(potPin); • delay (delayTime); • } •}
  • 12. void shiftIt(byte dataOut) { • // Shift out 8 bits LSB first, • // on rising edge of clock • boolean pinState; • //clear shift register read for sending data • digitalWrite(dataPin, LOW); • // for each bit in dataOut send out a bit • for (int i=0; i<=7; i++) { • //set clockPin to LOW prior to sending bit • digitalWrite(clockPin, LOW); • // if the value of DataOut and (logical AND) a bitmask • // are true, set pinState to 1 (HIGH) • if ( dataOut & (1<<i) ) { • pinState = HIGH; • } • else { • pinState = LOW; • } • //sets dataPin to HIGH or LOW depending on pinState • digitalWrite(dataPin, pinState); • //send bit out on rising edge of clock • digitalWrite(clockPin, HIGH); • digitalWrite(dataPin, LOW); • }
  • 13. • //stop shifting • digitalWrite(clockPin, LOW); • } • boolean isKeyboardInput() { • // returns true is there is any characters in the keyboard buffer • return (Serial.available() > 0); • } • } • // terminate the string • readString[index] = '0'; • }
  • 14. void setMatrixFromPosition(char charLeft, char charRight, int col) { • // take col left most columns from left character and bitwise OR with 8-col from • // the right character • for (int j=0; j<8; j++) { • led[j] = charBitmaps[charLeft][j] << col | charBitmaps[charRight][j] >> 8-col; • } • } • void screenUpdate() { • uint8_t col = B00000001; • for (byte k = 0; k < 8; k++) { • digitalWrite(latchPin, LOW); // Open up the latch ready to receive data • shiftIt(~led[7-k]); • shiftIt(col); • digitalWrite(latchPin, HIGH); // Close the latch, sending the registers data to the matrix • col = col << 1; • } • digitalWrite(latchPin, LOW); • shiftIt(~0 ); • shiftIt(255); • digitalWrite(latchPin, HIGH); • }
  • 15. void getTemp(char* reading) { • int span = 20; • int aRead = 0; • long temp; • char tmpStr[10]; • // average out several readings • for (int i = 0; i < span; i++) { • aRead = aRead+analogRead(tempPin); • } • aRead = aRead / span; • temp = ((100*1.1*aRead)/1024)*10; • reading[0] = '0'; • itoa(temp/10, tmpStr, 10); • strcat(reading,tmpStr); • strcat(reading, "."); • itoa(temp % 10, tmpStr, 10); • strcat(reading, tmpStr); • strcat(reading, "C"); • }