Manufaktur industri
Industri Internet of Things | bahan industri | Pemeliharaan dan Perbaikan Peralatan | Pemrograman industri |
home  MfgRobots >> Manufaktur industri >  >> Manufacturing Technology >> Proses manufaktur

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino

Komponen dan perlengkapan

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino
Arduino UNO
×1
Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino
Arduino Nano R3
×1
Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino
Sensor Gerak PIR (umum)
×1
Relay (umum)
×1
Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino
Kabel jumper (umum)
×1
Kabel Daya PC PSU
×1
Strip LED RGB
×1
Panel Neopixel 8x8
×3

Alat dan mesin yang diperlukan

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino
Pakuin solder (umum)
Stripping Kabel

Tentang proyek ini

Proyek ini menggabungkan 3 matriks LED RGB 8x8 WS2812B dan sensor gerak PIR untuk menyambut pengunjung dengan teks yang mengatakan “Happy Holidays & Happy New Year!” saat mereka cukup dekat dengan pintu dan menampilkan serangkaian efek seperti layar menyala pada monitor saat sensor tidak mendeteksi siapa pun di dekatnya.

Dikontrol oleh Arduino UNO dan diberi daya oleh sumber daya 5v 30a.

Saya menggabungkan atau menggabungkan 3 rangkaian kode.

Yang dari DemoReel100 Contoh Library FastLED untuk Efek Idle/Standby.

Kode Sensor Gerak PIR

Dan kode setup untuk Neopixel, saya pikir. Saya tidak benar-benar yakin lagi, tbh,, karena itu hampir sebulan yang lalu saat saya menggabungkan kode bersama.

Saya juga menggunakan sensor gerak PIR lain yang terhubung ke Relay 5v dengan Chayat LED RGB 12v melalui kabel senggak dan dikontrol oleh Arduino Nano.

String LED, bersama dengan lampu liburan yang juga terhubung ke kabel senggak diaktifkan saat sensor PIR pertama mendeteksi gerakan. Ini terletak di langit-langkat dekat tangga pertama.

Setelah beberapa langkah naik, sensor PIR kedua memberi tahu UNO untuk menampilkan Teks pada matriks ketika seseorang cukup dekat ke pintu.

******************************************************************************

Tautan Media Sosial untuk Diikuti (Saya maksud, jika Anda mau):

Facebook - https://fb.me/HeathenHacks

Twitter - https://twitter.com/HeathenHacks

Instagram - https://instagr.am/HeathenHacks

******************************************************************************

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino

Kode

Arduino HolidayArduino
#include <FastLED.h> FASTLED_USING_NAMESPACE #include <Adafruit_GFX.h> #include <Adafruit_NeoMatrix.h> #include <Adafruit_NeoPixel.h> #ifndef PSTR #define PSTR // Make Arduino Due happy #endif #define PIN 6 //#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) //#warning "Requires FastLED 3.1 or later; check github for latest code." //#endif #define DATA_PIN 6 #define LED_TYPE WS2811 #define COLOR_ORDER GRB #define NUM_LEDS 192 CRGB leds[NUM_LEDS]; const uint8_t kMatrixWidth = 24; const uint8_t kMatrixHeight = 8; const bool kMatrixSerpentineLayout = true; #define NUM_LEDS (kMatrixWidth * kMatrixHeight) #define MAX_DIMENSION ((kMatrixWidth>kMatrixHeight) ? kMatrixWidth : kMatrixHeight) #define BRIGHTNESS 50 #define FRAMES_PER_SECOND 120 // The 16 bit version of our coordinates static uint16_t x; static uint16_t y; static uint16_t z; Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(24, 8, PIN, NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE, NEO_GRB + NEO_KHZ800); const uint16_t colors[] = { matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255), matrix.Color(0, 255, 255), matrix.Color(255, 0, 255), matrix.Color(255, 255, 0), matrix.Color(255, 255, 255)}; uint16_t speed = 20; // speed is set dynamically once we've started up uint16_t scale = 30; // scale is set dynamically once we've started uint8_t noise[MAX_DIMENSION][MAX_DIMENSION]; CRGBPalette16 currentPalette( PartyColors_p ); uint8_t colorLoop = 1; int pirSensorPin = 5; // choose the input pin (for PIR sensor) int pirState = true; // we start, assuming no motion detected int val = 0; // variable for reading the pin status int minimummSecsLowForInactive = 5000; // If the sensor reports low for // more than this time, then assume no activity long unsigned int timeLow; boolean takeLowTime; //the time we give the sensor to calibrate (10-60 secs according to the datasheet) int calibrationTime = 30; void setup() { delay(3000); // 3 second delay for recovery // tell FastLED about the LED strip configuration FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip); //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip); // set master brightness control FastLED.setBrightness(BRIGHTNESS); matrix.setTextWrap(false); matrix.setBrightness(40); matrix.setTextColor(colors[0]); pinMode(pirSensorPin, INPUT); // declare sensor as input LEDS.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS); x = random16(); y = random16(); z = random16(); } int a = matrix.width(); int pass = 0; // List of patterns to cycle through. Each is defined as a separate function below. typedef void (*SimplePatternList[])(); SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm, cylon}; uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current uint8_t gHue = 0; // rotating "base color" used by many of the patterns void fadeall() { for (int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } } void loop() { val = digitalRead(pirSensorPin); // read input value if (val == HIGH) { // check if the input is HIGH matrix.fillScreen(1); matrix.setCursor(a, 0); matrix.print(F("Happy Holidays & Happy New Year!")); if (--a < -200) { a = matrix.width(); if (++pass >= 6) pass = 0; matrix.setTextColor(colors[pass]); } matrix.show(); delay(100); if (pirState) { // we have just turned on pirState = false; } takeLowTime = true; } else { // Call the current pattern function once, updating the 'leds' array gPatterns[gCurrentPatternNumber](); // send the 'leds' array out to the actual LED strip FastLED.show(); // insert a delay to keep the framerate modest FastLED.delay(1000 / FRAMES_PER_SECOND); // do some periodic updates EVERY_N_MILLISECONDS( 20 ) { gHue++; // slowly cycle the "base color" through the rainbow } EVERY_N_SECONDS( 10 ) { nextPattern(); // change patterns periodically } } } #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0])) void nextPattern() { // add one to the current pattern number, and wrap around at the end gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns); } void rainbow() { // FastLED's built-in rainbow generator fill_rainbow( leds, NUM_LEDS, gHue, 7); } void rainbowWithGlitter() { // built-in FastLED rainbow, plus some random sparkly glitter rainbow(); addGlitter(80); } void addGlitter( fract8 chanceOfGlitter) { if ( random8() < chanceOfGlitter) { leds[ random16(NUM_LEDS) ] += CRGB::White; } } void confetti() { // random colored speckles that blink in and fade smoothly fadeToBlackBy( leds, NUM_LEDS, 10); int pos = random16(NUM_LEDS); leds[pos] += CHSV( gHue + random8(64), 200, 255); } void sinelon() { // a colored dot sweeping back and forth, with fading trails fadeToBlackBy( leds, NUM_LEDS, 20); int pos = beatsin16( 13, 0, NUM_LEDS - 1 ); leds[pos] += CHSV( gHue, 255, 192); } void bpm() { // colored stripes pulsing at a defined Beats-Per-Minute (BPM) uint8_t BeatsPerMinute = 62; CRGBPalette16 palette = PartyColors_p; uint8_t beat = beatsin8( BeatsPerMinute, 64, 255); for ( int i = 0; i < NUM_LEDS; i++) { //9948 leds[i] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10)); } } void juggle() { // eight colored dots, weaving in and out of sync with each other fadeToBlackBy( leds, NUM_LEDS, 20); byte dothue = 0; for ( int i = 0; i < 8; i++) { leds[beatsin16( i + 7, 0, NUM_LEDS - 1 )] |= CHSV(dothue, 200, 255); dothue += 32; } } void cylon() { static uint8_t hue = 0; // First slide the led in one direction for(int i = 0; i < NUM_LEDS; i++) { // Set the i'th led to red leds[i] = CHSV(hue++, 255, 255); // Show the leds FastLED.show(); // now that we've shown the leds, reset the i'th led to black // leds[i] = CRGB::Black; fadeall(); // Wait a little bit before we loop around and do it again delay(10); } // Now go in the other direction. for(int i = (NUM_LEDS)-1; i >= 0; i--) { // Set the i'th led to red leds[i] = CHSV(hue++, 255, 255); // Show the leds FastLED.show(); // now that we've shown the leds, reset the i'th led to black // leds[i] = CRGB::Black; fadeall(); // Wait a little bit before we loop around and do it again delay(10); } } 

Skematik

Tampilan Pintu Matriks LED Interaktif dengan Sensor Gerak PIR – Ucapan Liburan Arduino

Proses manufaktur

  1. Buat LUMAZOID Sendiri: Visualisasi Musik Arduino DIY
  2. Proyek Sensor Suhu & Kelembaban DHT11 dengan Indikator LED dan Speaker Piezo
  3. Pemantau Kesehatan Sungai: Sistem Kualitas Air Berbasis Arduino
  4. Bangun Sensor Halangan Sederhana dengan Arduino – Tutorial Mudah LED IR & Fotodioda
  5. Find Me: Pelacak Item Cerdas dengan Arduino dan Bluetooth
  6. Membuat Robot Quadruped Arduino Cerdas: Panduan Langkah demi Langkah
  7. Senapan Air Cerdas Tergerak Gerakan dengan Arduino Nano
  8. Pengukuran Jarak Real-Time dengan Sonar Arduino & Visualisasi Processing
  9. Osiloskop DIY Arduino Nano (10 Hz–50 kHz) dengan LCD 128×64
  10. Jam Flip Arduino dengan Matriks LED 8×8 – Proyek Jam Waktu Nyata DIY