Luc Paquin
Published © CC BY

Project #15: Environment - Arduino UNO R4 WiFi - Mk34

Project #15: Environment - Arduino UNO R4 WiFi - Mk34

BeginnerFull instructions provided1 hour4
Project #15: Environment - Arduino UNO R4 WiFi - Mk34

Things used in this project

Hardware components

UNO R4 WiFi
Arduino UNO R4 WiFi
×1
Adafruit SHARP Memory Display Breakout - 1.3" 168x144 Monochrome
×1
Gravity: DHT11 Temperature Humidity Sensor For Arduino
DFRobot Gravity: DHT11 Temperature Humidity Sensor For Arduino
×1
USB Battery Pack
×1
DFRobot USB 3.1 Cable A to C
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Fritzing

Code

DL2508Mk03p.ino

Arduino
/****** Don Luc Electronics © *****Software Version Information
Project #15: Environment - Arduino UNO R4 WiFi - Mk34
15-34
DL2509Mk03.ino
DL2509Mk03
1 x Arduino UNO R4 WiFi
1 x Adafruit SHARP Memory Display Breakout - 1.3" 168x144 Monochrome
1 x Gravity: DHT11 Temperature & Humidity Sensor
1 x USB Battery Pack
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// DHT11
#include <DHT11.h>
// SHARP Memory Display
#include <Adafruit_SharpMem.h>
#include <Adafruit_GFX.h>

// DHT11
#define DHT11PIN 2
DHT11 dht11(DHT11PIN);
int temperature = 0;
int humidity = 0;

// SHARP Memory Display
// any pins can be used
#define SHARP_SCK  13
#define SHARP_MOSI 11
#define SHARP_SS   10
// Set the size of the display here, e.g. 144x168!
Adafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168);
// The currently-available SHARP Memory Display (144x168 pixels)
// requires > 4K of microcontroller RAM; it WILL NOT WORK on Arduino Uno
// or other <4K "classic" devices!  The original display (96x96 pixels)
// does work there, but is no longer produced.
#define BLACK 0
#define WHITE 1

// Software Version Information
String sver = "15-34";

void loop() {

  // DHT11
  isDHT11();

  // isDT11 Display
  isDisplayDHT();

  // Delay 1 Second
  delay( 1000 );

}

getDHT.ino

Arduino
// DHT11
// isDHT11
void isDHT11(){

  // Attempt to read the temperature and humidity values from the DHT11 sensor.
  int result = dht11.readTemperatureHumidity(temperature, humidity);

}

getDisplay.ino

Arduino
// Adafruit SHARP Memory Display
// Adafruit SHARP Memory Display - UID
void isDisplayUID(){

  // text display
  display.setRotation(4);
  display.setTextSize(3);
  display.setTextColor(BLACK);
  display.setCursor(0,2);
  display.println( "Don Luc" );
  //display.setTextSize(2);
  display.setTextColor(BLACK);
  display.setCursor(0,35);
  display.println( sver );
  display.refresh();
  delay( 100 );

}
// isDHT11 Display
void isDisplayDHT(){

  // text display Date and Time
  display.clearDisplay();
  display.setRotation(4);
  display.setTextSize(3);
  display.setTextColor(BLACK);
  display.setCursor(0,0);
  display.println( "Temp (C)" );
  display.setCursor(0,35);
  display.print( temperature );
  display.setCursor(45,35);
  display.println( "C" );
  //display.setTextSize(3);
  //display.setTextColor(BLACK);
  display.setCursor(0,65);
  display.println( "Hum (%)" );
  display.setCursor(0,95);
  display.print( humidity );
  display.setCursor(45,95);
  display.println( "%" );
  display.refresh();
  delay( 100 );
  
}

setup.ino

Arduino
// Setup
void setup()
{
  
  // Delay
  delay(100);
  
  // SHARP Display start & clear the display
  display.begin();
  display.clearDisplay();

  // Delay
  delay( 100 );

  // Display - UID
  // Don Luc Electronics
  // Version
  isDisplayUID();

  // Delay 5 Second
  delay( 5000 );

}

Credits

Luc Paquin
43 projects • 4 followers
Teacher, Instructor, E-Mentor, R&D and Consulting -Programming Language -Microcontrollers -IoT -Robotics -Machine Learning -AI -Sensors

Comments