Topic outline

  • General

    Hack your LED Strip

    nnn

  • Topic 1

    Introduction

    Trigger : the ability to have the lights turn on when needed and off again after a period of inactivity, so I decided to try my hand at hacking the LED strip to do just that.

    Aim : is to be able to add a microcontroller that can control the power to the LED strip (turn it on and off as needed), without losing the ability to control the color and pattern with the remote control.
    Analysis : A quick look at the LED controller circuit board shows that there are two black ICs.
    The upper IC in the pictures is the brains of the controller. It changes the LED color, does pulse-width modulation (PWM), and controls the light patterns. (ATTINY85)
    I'm guessing that the lower IC is a MOSFET (fast switching transistor) , which turns power on and off to each of the LED power lines (I could be wrong about this, however).
    There's also a ground plane (highlighted red in the third picture), a +12 volt power rail, and a +4.7 volt power rail (highlighted in blue).
    There are several potential solder points (highlighted in yellow).


    • Topic 2

      The ATtiny85

      Atmel’s itty-bitty ATtiny85 8-Bit Processor are small, cheap ($2-3) microcontrollers that are convenient for running simple programs.   
       Atmel’s itty-bitty ATtiny85 8-Bit Processor.
      • 8 legs
      • 8K of program space, 
      • 6 I/O lines, and 
      • 4-channel 10 bit ADC. 
      • Runs up to 20MHz with external crystal.
       The ATtiny85 package can be programmed in circuit is a great option for running simple Arduino programs 
      Getting the attiny to work


      Installing ATtiny support in Arduino 1.6.4

      • Open the preferences dialog in the Arduino software.
      • Find the “Additional Boards Manager URLs” field near the bottom of the dialog.
      • Paste the following URL into the field (use a comma to separate it from any URLs you’ve already added):
        • https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
      • Click the OK button to save your updated preferences.
      • Open the boards manager in the “Tools > Board” menu.
      • Scroll to the bottom of the list; you should see an entry for “ATtiny”.
      • Click on the ATtiny entry. An install button should appear. Click the install button.
      • The word “installed” should now appear next to the title of the ATtiny entry.


      Hints
      1. the dot on ATtiny is pin 1 (reset)
      2. PWM means pulse width modulation
      3. capacitors have long leg +ve
      4. Burn a bootloader first
      5. Select Arduino Uno when loading Arduino ISP
      6. Select ATtiny when burning bootloader
      7. 8 MHz internal

      To program the attiny, you need construct a usb AVR SPI programmer

      Instructions

      •  ATtinyPin 1 : Pin 10
      • ATtinyPin 2 : Free
      • ATtinyPin 3 : LED
      • ATtinyPin 4 : Ground
      • ATtinyPin 5 : Pin 11
      • ATtinyPin 6 : Pin 12
      • ATtinyPin 7 : Pin 13
      • ATtinyPin 8 : VCC


      Programming the ATtinny

      • Topic 3

        Traps for young players

        Beware when you download into your Arduino. Make sure

        You know which one you are using (Tiny or Uno)
        ATTiny uses Arduino as ISP programmer, Uno AVRISP mk 2
        ATtiny should have had the bootloader burnt to 8MHz

        • Topic 4

          ATtiny

          /*
          Test
          */

          // the setup function runs once when you press reset or power the board
          void setup() {
            // initialize digital pins as output.
            pinMode(0, OUTPUT);
            pinMode(1, OUTPUT);
            pinMode(2, OUTPUT);
            pinMode(3, OUTPUT);
            pinMode(4, OUTPUT);
             pinMode(5, OUTPUT);
          }

          // the loop function runs over and over again forever
          void loop() {
            digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(100); // wait for a second
            digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
            delay(100);
            // wait for a second
            digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(300); // wait for a second
            digitalWrite(1, LOW); // turn the LED off by making the voltage LOW
            delay(100);
            digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(500); // wait for a second
            digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
            delay(100);
            digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(700); // wait for a second
            digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
            delay(100);
            digitalWrite(4, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(900); // wait for a second
            digitalWrite(4, LOW); // turn the LED off by making the voltage LOW
            delay(100);
            digitalWrite(5, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(1100); // wait for a second
            digitalWrite(5, LOW); // turn the LED off by making the voltage LOW
            delay(100);
              digitalWrite(6, HIGH); // turn the LED on (HIGH is the voltage level)
            delay(1100); // wait for a second
            digitalWrite(6, LOW); // turn the LED off by making the voltage LOW
            delay(100);
          }

          Related image
          • Topic 5

            Passive infrared detector (PIR) : RCW-0506

            // Uses a PIR sensor to detect movement, buzzes a buzzer

            // more info here: http://blog.makezine.com/projects/pir-sensor-arduino-alarm/

            // email me, John Park, at jp@jpixl.net

            // based upon:

            // PIR sensor tester by Limor Fried of Adafruit

            // tone code by michael@thegrebs.com



            int ledPin = 13;                // choose the pin for the LED

            int inputPin = 2;               // choose the input pin (for PIR sensor)

            int pirState = LOW;             // we start, assuming no motion detected

            int val = 0;                    // variable for reading the pin status

            int pinSpeaker = 10;           //Set up a speaker on a PWM pin (digital 9, 10, or 11)


            void setup() {

              pinMode(ledPin, OUTPUT);      // declare LED as output

              pinMode(inputPin, INPUT);     // declare sensor as input

              pinMode(pinSpeaker, OUTPUT);

              Serial.begin(9600);

              Serial.println("I have started");

            }


            void loop() {


              val = digitalRead(inputPin);  // read input value

              if (val == HIGH) {            // check if the input is HIGH

                digitalWrite(ledPin, HIGH);  // turn LED ON


                if (pirState == LOW) {

                  // we have just turned on

                  Serial.println("Motion detected!");

                  // We only want to print on the output change, not state

                  pirState = HIGH;

                }

              } else {

                digitalWrite(ledPin, LOW); // turn LED OFF      playTone(0, 0);

                delay(300);

                if (pirState == HIGH) {

                  // we have just turned of

                  Serial.println("Motion ended!");

                  // We only want to print on the output change, not state

                  pirState = LOW;

                }

              }

            }


            All about PIR
            • Topic 6

              Voltage regulators

              If i have a 12 volt input. what is the quickest way to convert it to 5 volts? Use a voltage regulator.

              while expensive equipment may have a series of capacitors to smooth out the flow of voltage drops, for our purposes a simple IC is enough
              L7805cv data sheet

              Image result for l7805cv
              • Topic 7

                nnn

                • Topic 8

                  nnn

                  • Topic 9

                    nnn

                    • Topic 10

                      nnn