Arduino “having11” Guy
Published © GPL3+

How to Hand-Solder SMD Components

By using 4 WS2812s LEDs and an ATtiny85, create a figure stand that adapts to the light levels around it and customize the light patterns.

IntermediateFull instructions provided3 hours1,032
How to Hand-Solder SMD Components

Things used in this project

Hardware components

WS2812b RGB LEDs
Not the strip, just the individual ones
×4
ATtiny85
Microchip Technology ATtiny85
×1
0805 10k ohm resistor
×1
LDR through-hole
×1

Software apps and online services

EagleCAD
Fusion 360
Autodesk Fusion 360
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Digital Microscope with Display

Story

Read more

Custom parts and enclosures

Base Lower

Base Upper

Schematics

Board Schematic

Board Layout

Code

ATTiny85 Code

C/C++
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            1
#define ADCPIN 3

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      4

unsigned long int lastTime=0;

#define CK_DELAY 20000 //20 seconds

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

//const int32_t colors[] = {pixels.Color(0,150,0),pixels.Color(150,0,0),pixels.Color(0,0,150),pixels.Color(150,30,0)};

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  // End of trinket special code

  pixels.begin(); // This initializes the NeoPixel library.
  pixels.setBrightness(60);
}

void loop() {
  int adc_reading;
  if(millis()-lastTime>CK_DELAY){
    adc_reading = analogRead(ADCPIN);
    pixels.setBrightness(map(adc_reading,0,1023,55,100));
  }
  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
  
    for(int j=0;j<=150;j++){
      for(int i=0;i<NUMPIXELS;i++){
      pixels.setPixelColor(i, pixels.Color(j+10,0,150-j));
      pixels.show();
      delay(20);
      }
    }
    for(int j=150;j>=0;j--){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    for(int i=0;i<NUMPIXELS;i++){
    pixels.setPixelColor(i, pixels.Color(j+10,0,150-j)); // Moderately bright green color.
    pixels.show();
    delay(20);
      }
    }


}

Credits

Arduino “having11” Guy

Arduino “having11” Guy

81 projects • 538 followers
18 year-old IoT and embedded systems enthusiast. Also an intern at Hackster.io who loves working on projects and sharing knowledge.

Comments