SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
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");

•   }

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 

Kürzlich hochgeladen (20)

activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 

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"); • }