Christopher Mendez Martinez
Published © GPL3+

DIY 3D Printed LED Poster | W/ Neopixels or RGB LED Strips

A LED Poster to give a lot of style to your workspace

IntermediateFull instructions provided3 days1,847
DIY 3D Printed LED Poster | W/ Neopixels or RGB LED Strips

Things used in this project

Hardware components

JLCPCB Customized PCB
JLCPCB Customized PCB
×1
Anycubic i3 Mega 3D printer
Anycubic i3 Mega 3D printer
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
×1
LED Strip, NeoPixel Digital RGB
LED Strip, NeoPixel Digital RGB
×1

Software apps and online services

Arduino IDE
Arduino IDE
Fusion
Autodesk Fusion

Hand tools and fabrication machines

Mini Side Cutter, 120mm Length with 25mm Jaw Capacity
Mini Side Cutter, 120mm Length with 25mm Jaw Capacity

Story

Read more

Schematics

Neopixel option schematics

Code

MCM-LED-DESK.ino

Processing
/*
   Proyecto: MCM-LED-DESK : Controlador de tira LED Ws2812b para el escritorio controlado por IR y potencimetro
   Autor: Christopher Mndez
   Fecha: 29/11/2020
*/

// ----------Libreras--------------
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Requerido para microcontroladores de 16Mhz
#endif

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>

const uint16_t kRecvPin = 3;  //Pin donde se conecta el sensor IR

IRrecv irrecv(kRecvPin);

decode_results results;

#define PIXEL_PIN    0  // Pin digital donde se conecta la Tira LED

#define PIXEL_COUNT 80  // Nmero de pixeles

// Declaro el objeto que define mi tira LED
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);

int flow = 0; //Variable que almacena el modo de iluminacin
unsigned int dato;  //Variable que almacena el dato que llega por el sensor IR
bool control; //Variable para controlar el flujo del cdigo.
int memo, brillo; //Variables

void setup() {
  Serial.begin(115200);
  irrecv.enableIRIn();  // Iniciar el receptor
  while (!Serial)  // Esperar por una conexin Serial
    delay(50);
  Serial.println();
  Serial.print("Sensor IR conectado en el Pin");
  Serial.println(kRecvPin);
  strip.begin(); // Inicializo la tira LED
  strip.show();  // Inicializo con los LEDs apagados 'off'
}

void loop() {
  memo = brillo;

  brillo = map(analogRead(A0), 0, 1023, 0, 255);  //Leo el potencimetro

  strip.setBrightness(brillo);

  if (memo != brillo) {
    control = 1;
  }

  leer(); //Funcin que lee la info del sensor

  // Estados de iluminacin
  if (control) {
    switch (flow) {          
      case 0:
        colorWipe(strip.Color(  0,   0,   0), 0);    // Black/off
        break;
      case 1:
        colorWipe(strip.Color(255,   50,   0), 0);    // Mamey
        break;
      case 2:
        colorWipe(strip.Color(  236, 0,   146), 0);    // Pink
        break;
      case 3:
        colorWipe(strip.Color(  0,   251, 255), 0);    // Blueish
        break;
      case 4:
        colorWipe(strip.Color(104, 255, 0), 0); // Greenish
        break;
      case 5:
        colorWipe(strip.Color(171,   0,   255), 0); // Morado
        break;
      case 6:
        colorWipe(strip.Color(  255,   255, 0), 0); // Amarillo
        break;
      case 7:
        colorWipe(strip.Color(  0, 255, 0), 0); // Razer Green
        break;
      case 8:
        rainbow(50);
        break;
      case 9:
        theaterChaseRainbow(50);
        break;
    }
    control = 0;
  }

}

//Funcin que llena las tiras de un color fijo
void colorWipe(uint32_t color, int wait) {
  for (int i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, color);         
    strip.show();                          
    delay(wait);                           
  }
}

//Funcin Arcoiriz 
void rainbow(int wait) {
  for (long firstPixelHue = 0; firstPixelHue < 3 * 65536; firstPixelHue += 256) {
    for (int i = 0; i < strip.numPixels(); i++) { 
      leer();
      int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
      strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    }
    strip.show(); 
    delay(wait);  
  }
}

//Funcin que hace parpadear la tira como un teatro
void theaterChaseRainbow(int wait) {
  int firstPixelHue = 0;     
  for (int a = 0; a < 30; a++) { 
    for (int b = 0; b < 3; b++) { 
      strip.clear();         

      for (int c = b; c < strip.numPixels(); c += 3) {
        leer();
        int      hue   = firstPixelHue + c * 65536L / strip.numPixels();
        uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB
        strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
      }
      strip.show();                
      delay(wait);                 
      firstPixelHue += 65536 / 90; 
    }
  }
}

void leer() {
  if (irrecv.decode(&results)) {
    serialPrintUint64(results.value, HEX);
    Serial.println();
    dato = results.value;
    serialPrintUint64(dato);
    Serial.println();
    if (dato == 2442224285) {   //Aqu va el codigo en DEC del boton del control
      control = 1;
      flow++;
      Serial.println(flow);
      if (flow > 9) {
        flow = 0;
      }
    } else {
      Serial.println("No entendi");
    }

    if (dato == 2442216125) {   //Aqu va el codigo en DEC del boton del control
      control = 1;
      flow--;
      Serial.println(flow);
      if (flow < 0) {
        flow = 9;
      }
    } else {
      Serial.println("No entendi");
    }

    Serial.println("");
    irrecv.resume();  // Recibir el siguiente valor
  }
}

Credits

Christopher Mendez Martinez
35 projects • 76 followers
Electronic Engineer and Tech YouTuber who loves automation, programming and sharing his knowledge with everyone.

Comments