|
Arduino Nano V3 |
x 1 | |
|
DS3231SNMAXIM
|
x 1 | |
|
BME280 |
x 1 | |
|
MAX7219 8x8 RED LED Dot Matrix Module |
x 7 |
|
Soldering iron |
|
|
Soldering Iron Wire Welding Lead Roll |
|
|
arduino IDEArduino
|
#include SPI.h #include Adafruit_GFX.h #include Max72xxPanel.h #include Adafruit_BME280.h #include RTClib.h RTC_DS1307 rtc; char daysOfTheWeek[7][1
From one of my previous projects (Bluetooth-controlled scrolling text), I have a finished 8x56 LEDs matrix consisting of 7pcs MAX7219 Led matrix modules 8x8, and located in the appropriate box. I used this ready-made matrix to make a scrolling weather station that displays the temperature, air humidity and relative atmospheric pressure, as well as the current time.
For this purpose, I use a BME280 sensor and a DS3231 real-time clock module, so the device works independently of an Internet connection. The BME280 board is placed on the outer side of the case for more accurate readings, and it can also be placed outside with the help of a four-wire cable. Let me mention that these matrix modules are older type, and as you see (in the given picture), contain DIL IC on the front. The new modules are made in smd technology and usually composed of 4 coupled matrices, and they are turned 90 degrees clockwise.
In this project, using the library "Max72xxPanel" the position of the contents of each matrix can be rotated in code with command "matrix.setRotation", so we can use matrices of any type. Also the number of matrices in the array can be changed, and is defined by the command:
int numberOfHorizontalDisplays = 7; //we can simple change this numberaccording to number of matrices we use
As I mentioned before, the device is very simple to build and contains the following components:
- Arduino Nano microcontroller
- 7 pieces 8x8 Led Matrix modules driven by MAX7219 chip
- BME280 sensor module
- And DS3231 real-time clock module
Immediately after switching on, the scrolling text appears in order
- Day of the week
- current time
- Temperature in degrees Celsius
- Air humidity
- and Relative Atmospheric Pressure in hectopascals
Due to the large number of diodes, the device should be powered by an external source that should provide a current of 2 Amps or more.
The intensity of the LEDs, as well as the speed of the scrolling text, can be easily adjusted in code.
int wait = 25; // speed
matrix.setIntensity(3); // Use a value between 0 and 15 for brightness
On the video you can watch a short description of how this device is made.
And finally, the device is built into a suitable housing made of PVC board with a thickness of 3mm and 5mm
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#include <Adafruit_BME280.h>
#include "RTClib.h"
RTC_DS1307 rtc;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
Adafruit_BME280 bme280;
int mm;
int pinCS = 10; // Uno or Duemilanove DIN 11 (MOSI) CLK 13 (SCK)
int numberOfHorizontalDisplays = 7;
int numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
String tape = "";
int wait = 25; // speed
int spacer = 2; // Character spacing (points)
int width = 5 + spacer; // Font width 5 pixels
String utf8rus(String source)
{
int i,k;
String target;
unsigned char n;
char m[2] = { '0', '\0' };
k = source.length(); i = 0;
while (i < k) {
n = source[i]; i++;
if (n >= 0xC0) {
switch (n) {
case 0xD0: {
n = source[i]; i++;
if (n == 0x81) { n = 0xA8; break; }
if (n >= 0x90 && n <= 0xBF) n = n + 0x2F;
break;
}
case 0xD1: {
n = source[i]; i++;
if (n == 0x91) { n = 0xB7; break; }
if (n >= 0x80 && n <= 0x8F) n = n + 0x6F;
break;
}
}
}
m[0] = n; target = target + String(m);
}
return target;
}
String Serial_Read() {
unsigned char c; // variable port for reading series
String Serial_string = ""; // Forming from a character string
while (Serial.available() > 0) { // If there are symbols in the series
c = Serial.read(); // We read a symbol
//Serial.print(c,HEX); Serial.print(" "); Serial.print(c);
if (c == '\n') { //If this is a string of lines
return Serial_string; // We return the line
}
if (c == 0xB8) c = c - 0x01;
if (c >= 0xBF && c <= 0xFF) c = c - 0x01;
Serial_string = Serial_string + String(char(c)); //Add symbol to line
}
return Serial_string;
}
String chas;
String myn;
//String mesyc = "";
void setup() {
Serial.begin(9600);
Serial.println(F("bme280"));
//==================================== hours
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
abort();
}
if (! rtc.isrunning()) {
Serial.println("RTC is NOT running, let's set the time!");
// When time needs to be set on a new device, or after a power loss, the
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
//====================================
while (!bme280.begin(BME280_ADDRESS - 1)) {
Serial.println(F("Could not find a valid bme280 sensor, check wiring!"));
delay(2000);
}
matrix.setIntensity(3); // Use a value between 0 and 15 for brightness
matrix.setRotation(matrix.getRotation()+0); //1 - 90 2 - 180 3 - 270
//a=a+1;
}
void loop() {
DateTime now = rtc.now();
float temperature = bme280.readTemperature();
float pressure = bme280.readPressure()/100.0F;
float altitude = bme280.readAltitude(1013.2);
float humidity = bme280.readHumidity();
pressure = pressure + 78.5 ; //Relative pressure for 700m above sea level, comment this row for relative atmospheric pressure
//======================================= correction digit time zero before the number
chas ="";
myn = "";
if (now.hour() < 10) {
chas = '0';
}
if (now.minute() < 10) {
myn = ('0');
}
//=======================================
tape = utf8rus((String)+daysOfTheWeek[now.dayOfTheWeek()]+" Time "+chas +now.hour()+":"+myn+now.minute()+" h Temperature = "+temperature +" degree C Humidity = " + humidity + " % Pressure = "+ pressure +" Hpa");
if (Serial.available()){
tape=Serial_Read();
}
for ( int i = 0 ; i < width * tape.length() + matrix.width() - 1 - spacer; i++ )
{
matrix.fillScreen(LOW);
int letter = i / width; // number of symbols displayed on a matrix
int y = (matrix.width() - 1) - i % width;
int x = (matrix.height() - 8) / 2;
while ( y + width - spacer >= 0 && letter >= 0 ) {
if ( letter < tape.length() ) {
matrix.drawChar(y, x, tape[letter], HIGH, LOW,1);
}
letter--;
y -= width;
}
matrix.write(); // Send a picture for display
delay(wait);
}
}
#include SPI.h #include Adafruit_GFX.h #include Max72xxPanel.h #include Adafruit_BME280.h #include RTClib.h RTC_DS1307 rtc; char daysOfTheWeek[7][1
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Mirko Pavleski
- Arduino FFT Audio Spectrum analyzer on 8x32 color matrix WS2812B The spectrum analyzer displays the amplitude of signals as a function of frequency, allowing engine...
- Unusual Led Ring Arduino Clock, Temperature, and Humidity meter There are many arduino clock projects with temperature and humidity readings where the results are ...
- How to make simple portable PEMF Magnetic Pulser PEMF (Pulsed Electromagnetic Field Therapy), which is also known as magnetic pulse therapy uses ele...
- Single Mosfet Mini SSTC Tesla coil with 10 + cm Spark A Solid State Tesla Coil (SSTC) is a type of Tesla coil that uses solid-state components such as tr...
- How to Make EM84 (6E2) Vacuum Tube Stereo VU Meter A VU meter, also known as a Volume Unit meter, is a device used to display the audio signal level ...
- Universal Arduino Staccato controller for SSTC and VTCC Tesla Coils The VTTC Staccato Controller was developed in the attempt to create longer sparks from VTTCs while ...
- DIY extremly Sensitive and cheap Arduino Seismometer A seismometer, is an instrument used to detect and record ground motion caused by seismic waves, su...
- DIY Extremly Sensitive and cheap Geophone sensor for Earthquakes detecting A geophone is a device used in geophysics to detect ground movement. It is specifically designed to...
- Arduino FFT Spectrum analyzer on VFD display GP1287 An audio spectrum analyzer is a device that visualizes the frequency content of an audio signal. It...
- DIY simple Spark Gap Tesla Coil Tesla coil is a type of resonant transformer circuit invented by Nikola Tesla around 1891. It is a ...
- DIY PC controlled high power PEMF Therapy Device PEMF or Pulsed Electromagnetic Field therapy is a type of therapy that uses electromagnetic fields ...
- DIY Precise Arduino Miliohmmeter In practice, we very often need to measure low resistances. Measuring low-value resistances, especi...
- The simplest way to determine the quality of lighting in your home - bulb flickering meter Light flickering can be a common issue and may occur with various types of bulbs, including incande...
- Classic Style Arduino Weather Station with three Oled Displays So far I have made several weather stations that display local values as well as internet data, whic...
- How to build simple cheap Hulda Clark Syncrometer Hulda Clark's Syncrometer was a device she claimed could detect the presence of various substances ...
- DIY simplest small CRT Oscilloscope An oscilloscope is a measuring instrument used to visualize and analyze electronic signals. It is c...
- Arduino Door Lock with Smartphone Flashlight Login (Li-Fi project) There are many different arduino door lock projects, where the access method is using a keyboard, R...
- Arduino Bar graph Stereo VU meter on VFD display GP1287 A VU meter, also known as a Volume Unit meter, is a device used to display the audio signal level i...
-
Open Source Very Large Stick - Freejoy & MMjoy2 breakout board
353 0 0 -
RF Control training board for students based on ESP32 C3
470 0 2 -
Aquarius+ Computer, Standard PCB
667 0 3 -
KINETIC COASTERS with a TWIST! Laser or 3D Print some DIY Magic
484 0 1 -
RPI - 8 IO PLC With ATTiny85 Watch Dog
422 0 0 -
Nintendo Famicom HVC-001 Controller Shells
521 0 1 -
COMMODORE 128 DIAGNOSTIC REV.785260 KEYBOARD DONGLE
498 0 4 -
COMMODORE 128 15KHz DISPLAY ADAPTER (C128 80 COLUMN ADAPTER)
637 1 4 -