Notifications
Clear all

RGB Christams tree wiring  

Page 2 / 3
  RSS

robotBuilder
(@robotbuilder)
Honorable Member
Joined: 1 year ago
Posts: 526
2020-10-02 10:32 pm  

@squish

You shouldn't need heat sinks on the MOSFETS.
It is not a complex project so maybe I can buy 8 RGB LEDS today and get your project working.

Do you understand the Arduino c++ programming language?

 

This post was modified 2 months ago 2 times by robotBuilder

Squish liked
ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Workshop Guru Admin
Joined: 1 year ago
Posts: 652
2020-10-02 11:29 pm  
Posted by: @squish

but a burnt house, no thank you.

It's not likely you would burn the house down, but you could have a very hot Arduino.

Posted by: @squish

Are there specific kits on amazon uk, that would have the needed items in it? I had a look and there are so many different types

I saw this one on the UK Amazon- these modules will simplify your wiring (I used similar ones in the video I did on BJTs and MOSFETS).

Posted by: @squish

Where/who are the best UK electronics suppliers that deliver, or the best sources that deliver to the UK?

For most Arduino and Raspberry Pi purchases I really love Pimoroni. Good selection (including lots of Adafruit stuff) and really great people to deal with. Sadly due to the pandemic, I can't order from them, as sometimes their items come to Canada requiring duty and I'd have to go to the Post Office which is not possible (I haven't left the house since Feb 28th and have no intention of going out until this nasty affair is over).

Of course, Malpin is one of the more well-known stores in the UK, although they seem to be gravitating more towards consumer stuff, however, they still have a good selection of Arduino and Raspberry Pi stuff.

Honestly I probably but more stuff from Amazon than anyone else, I used to buy a lot of things on eBay as well but the delivery time from China to Canada is very long.

DigiKey and Mouser are probably the two biggest distributors in North America, not sure how they handle international shipments.

😎

Bill

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


Squish liked
ReplyQuote
byron
(@byron)
Reputable Member
Joined: 1 year ago
Posts: 376
2020-10-02 11:57 pm  
Posted by: @squish

Where/who are the best UK electronics suppliers that deliver

Here is a list of those I've used in the UK for electronic components.

www.rapidonline.com

www.mouser.co.uk

www.digikey.co.uk

www.hobbytronics.co.uk

coolcomponents.co.uk


Squish liked
ReplyQuote
robotBuilder
(@robotbuilder)
Honorable Member
Joined: 1 year ago
Posts: 526
2020-10-03 12:14 am  

@squish

I got to thinking maybe use the 74HC595 shift register no MOSFET required.
After a google search I found this example controlling 16 RGB LEDS.
Now that would make for a cool Christmas tree 🙂

 

This post was modified 2 months ago 3 times by robotBuilder

Squish liked
ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-04 3:00 am  

Thanks everyone, loads of help 😎 .

 

Posted by: @robotbuilder

Do you understand the Arduino c++ programming language?

 

No, I can't code, I copy and paste other peoples, and delete the parts, I don't think I need, very, very hit and miss.

Once the xmas tree is done, I'll be straight back to the lessons, oh, and building my Tumble Self Writing Thingy.

Posted by: @dronebot-workshop

It's not likely you would burn the house down, but you could have a very hot Arduino.

 

Thank you for this Bill, I was a little concerned. Plus that's the same boards I had put on my wishlist yesterday, now I feel clever.

Posted by: @byron

Here is a list of those I've used in the UK for electronic components.

 

Those supplier links are great thanks to you both.

 

Posted by: @robotbuilder

After a google search I found this example controlling 16 RGB LEDS.

That looks great, todays homework.... Of to see if I have a shift register, I think I may, I'm just keeping fingers crossed it's the right one. Then watching the video.

 

@dronebot-workshop

I know what you mean re the virus. I'm glad o hear from someone taking it seriously.

I've been shielding for nearly a decade. My immune system takes serious issue with many modern chemicals, deo, fabric conditioners, perfumes, detergents, and fumes from numerous manufacturing processes' too, the list is endless. I've been wearing a mask,  just to open the door to the postman for ten years. I frequently have to leave items outside to gas off, sometimes for weeks.

 

I'd be lost with-out the www/internet.

 

 

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-08 1:47 am  

 

I have some small blue potentiometers with 10k stamped on them, and some metal with B10k.

Are they OK to use with the 3xMosfet boards? and a 1 metere RGB strip, 60 led 5V WS2812B, with an external 5V supply?

 

Using a FastLED library, setting up for only 15 leds in the code, can I run the first 15 lights without cutting the strip after the 15th light?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-11 10:12 am  

Using this code,

 

 


/* *********************************************************** * RGB_LED sketch - v1.0 *   Uses common cathode RGB LED *   Arduino UNO R3 *    * Inspired by Elegoo Lesoon 4 - RGB LED *   Included with The Most Complete Starter Kit by Elegoo *   Original by - HowToMechatronics.com and Elegoo.com *   Modified by - Ricardo Moreno *   * Description: *   This sketch illustrates a few ways to control the RGB LED *    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * *  History:    *    1/5/2018 - v1.0 initial release *  12/30/2019 - Minor comment and indent revisions to *               improve readability. Moved Function setColor *               to the top of the sketch. Renamed delayTime *               to longDelay. *        * ********************************************************* */ /* *********************************************************** *                      Global Constants                     * *                    Hardware Definitions                   * * ********************************************************* */    /* The Arduino Web site recommends that one uses const     * rather than #define since using #define could have       * unwanted side effects     */    const int    redPin = 6;   // Red LED pin    const int  greenPin = 5;   // Green LED pin    const int   bluePin = 3;   // Blue LED pin    const int maxBright = 70; // Maximum=255 LED brightness /* *********************************************************** *                         Functions                         * * ********************************************************* */ void setColor(int redValue, int greenValue, int blueValue){    analogWrite(redPin, redValue);    analogWrite(greenPin, greenValue);    analogWrite(bluePin, blueValue);    Serial.print("Red: ");    Serial.print(redValue);    Serial.print(" Green: ");    Serial.print(greenValue);    Serial.print(" Blue: ");    Serial.println(blueValue); } /* *********************************************************** *                         Void Setup                        * * ********************************************************* */ void setup(){    Serial.begin(9600);       //Turn On the Serial Port    pinMode(redPin, OUTPUT);    pinMode(greenPin, OUTPUT);    pinMode(bluePin, OUTPUT); } /* *********************************************************** *                         Void Loop                         * * ********************************************************* */ void loop(){    //Local Variables    int longDelay = 1000;   // fading time between colors    int shortDelay = 10;    // short time delay between colors    int redValue;    int greenValue;    int blueValue;    int ledGear;            // For switching LED fading        //I combined various ways to turn on the RGB LED    //Here we manually set the color    Serial.println("Manual Colors");    setColor(maxBright, 0, 0);                  //Red Color    delay(longDelay);    setColor(0, maxBright, 0);                  //Green Color    delay(longDelay);    setColor(maxBright, maxBright, maxBright);  //White Color    delay(longDelay);    setColor(70, 0, maxBright);                //i set to 70 original was 170Purple Color    delay(longDelay);        Serial.println("Fade from Red to Green");    //Fade from Red to Green    delay(longDelay);    redValue = maxBright;    greenValue = 0;    blueValue = 0;    for(int i = 0; i < maxBright+1; i++){        setColor(redValue, greenValue, blueValue);        redValue -= 1;        greenValue += 1;        delay(shortDelay);    }        Serial.println("Fade from Green to Blue");    //Fade from Green to Blue    delay(longDelay);    redValue = 0;    greenValue = maxBright;    blueValue = 0;    for(int i = 0; i < maxBright+1; i++){        setColor(redValue, greenValue, blueValue);        greenValue -= 1;        blueValue += 1;        delay(shortDelay);    }        Serial.println("Fade from Blue to Red");    //Fade from Blue to Red    delay(longDelay);    redValue = 0;    greenValue = 0;    blueValue = maxBright;    for(int i = 0; i < maxBright+1; i++){        setColor(redValue, greenValue, blueValue);        blueValue -= 1;        redValue += 1;        delay(shortDelay);    }        Serial.println("Fade All three colors Red to Green, Green to Blue, Blue to Red");    //Fade All three colors Red to Green, Green to Blue, Blue to Red    delay(longDelay);    redValue = maxBright;    greenValue = 0;    blueValue = 0;    ledGear = 1;    do {        setColor(redValue, greenValue, blueValue);        //First Gear - Fade from Red to Green        if (ledGear == 1) {            redValue -= 1;            greenValue += 1;        }        //Second Gear - Fade from Green to Blue        if (ledGear == 2){            greenValue -= 1;            blueValue += 1;        }        //Third Gear - Fade from Blue to Red        if (ledGear == 3){            blueValue -= 1;            redValue +=1;        }        //Gear Switching        if (greenValue == maxBright) ledGear = 2;        if (blueValue == maxBright) ledGear = 3;        if (redValue == maxBright+1) ledGear = 4;        delay(shortDelay);    } while (ledGear < 4);    delay(longDelay); }

 

23 0201011 073301

 

 

With this setup.

120201011 090132
2 20201011 090213

  

23 0201011 073301
b20201011 071952

I've got it working, no resistors, Maximum Brightness is set in the CODE.

It's running on a Nano using a phone charging battery. The Maximum Volts it's using is 15mV (I think). I haven't worked out how to measure current though.

I'm not completely happy with the pattern atm so will tinker with it. 

If after testing for 48 hours, there are no problems, I'll probably go with it.

I'm working out how to translate the breadboard set-up to actual wiring, to see what impact the  distance will have on brightness.

 

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-15 3:09 am  

I went with this version for the harness.

IMG 20201002 003806

All bulbs are working. I just need to put the tree back together, with the bulbs in the right sockets.

 

Going to try a didgistump ATtiny85 board, on the breadboard version.

 

 

No such thing as too much energy, it's just un-utilised potential.


zezo999 liked
ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-21 10:46 pm  

ATtiny85 board isnt recognised by the PC, but it's intermittent. It seems to be a known problem, and the I don't think the board is being supported anymore, shame, I have 3.

The lights are gorgeous, very slow and peaceful, and not too bright. However I can't get the tree back together.

I haven't quite given up yet, and we may end-up with a few vases off fibre optic fake tree branches.

 

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
ZoolanderMicro
(@zoolandermicro)
Trusted Member
Joined: 2 months ago
Posts: 73
2020-10-22 6:21 pm  

You may need to install the ATtinyCore library (Spence konde (Aka Dr. Azzy)) from the board loader in the Arduino IDE, or from the GitHub repository ( https://github.com/SpenceKonde). If avrdude complains about the device signature, change the device signature entry in the avrdude.conf file. I use a double ## to comment out the current signature. This keeps the original signature for future reference, and it marks the file where you made changes. You may also create a backup of the original file, just in case. 

ZoolanderMicro, where small ideas are a big deal


Squish liked
ReplyQuote
ZoolanderMicro
(@zoolandermicro)
Trusted Member
Joined: 2 months ago
Posts: 73
2020-10-22 6:34 pm  

I have two installations of avrdude on my computer. One in the Arduino IDE, and one in WinAVR. When I use avrdude from the command line, it is using the WinAVR installation. The Arduino IDE also uses avrdude, but it is a separate installation with its own avrdude.conf file. So, I end up working between the two applications and conf files. If you don't have one already, get a copy of the book, Make:AVR Programming (Elliot Williams, Make Community, LLC; 1st Edition (February 25, 2014)ISBN-13: 978-1449355784). 

ZoolanderMicro, where small ideas are a big deal


Squish liked
ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-22 9:16 pm  

@zoolandermicro

will this sort out the intermittent ATtiny85 USB 'not recognised' by windows?

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
ZoolanderMicro
(@zoolandermicro)
Trusted Member
Joined: 2 months ago
Posts: 73
2020-10-22 10:41 pm  

Perhaps I misunderstood the issue. I am not sure what is meant by 'Windows not recognizing' the microcontroller. I was assuming that the target chip signature was not as expected. This is an error that may occur when programming an AVR chip through the Arduino IDE. Is the ATtiny85USB a programmer? I use a USBtinyISP programmer. I believe my programmer does have the ATtiny85 chip. Intermittent errors are hard to discern. Could this be a connection issue? 

ZoolanderMicro, where small ideas are a big deal


Squish liked
ReplyQuote
ZoolanderMicro
(@zoolandermicro)
Trusted Member
Joined: 2 months ago
Posts: 73
2020-10-22 10:53 pm  

You might try my code for common cathode tri-colored LEDs. The colors blend nicely.

#include <avr/io.h>
#include <util/delay.h>
/**
   Scetch ColorBlend_CommonCathode is a color fade/blend routine for a tri-color
   common cathode led connected to Arduino Uno digital pins 9, 10, and 11 as PWM
   outputs. Colors transition from blue through teal, green, yellow, orange, red,
   violet, purple, and back to blue. With common cathode tri-colored leds,
   analogWrite() value of 0 results in a full 'off' state, and analogWrite()   
   value of 255 results in a full 'on' state. This scetch works with common
   anode tri-colored leds, only the color blend runs in the opposite order.
   Written in Arduino C language.
   @author Mike Tonge
   @date 12/03/2019
*/
// Constants
const uint8_t DELAY_TIME = 100; // Delay time (miliseconds)
const uint8_t redLED = 9; // Red on digital pin 9
const uint8_t grnLED = 10; // Green on digital pin 10
const uint8_t bluLED = 11; // Blue on digital pin 11
const uint8_t OFF = 0; // Value used to turn led off
// Variables
uint8_t redVal = 0; // Red value
uint8_t grnVal = 0; // Green value
uint8_t bluVal = 0; // Blue value

void setup() {
  pinMode(redLED, OUTPUT); // Set pin 9 as output
  pinMode(grnLED, OUTPUT); // Set pin 10 as output
  pinMode(bluLED, OUTPUT); // Set pin 11 as output
}

void loop() {
  for (int count = 0; count <= 765; count++) {
    switch (count) {
      // Red is off, Green gets brighter, Blue gets dimmer
      case 0 ... 255:
        redVal = OFF;
        grnVal = count;
        bluVal = 255 - count;
        break;
      // Red gets brighter, Green gets dimmer, Blue is off
      case 256 ... 510:
        redVal = count - 255;
        grnVal = 510 - count;
        bluVal = OFF;
        break;
      // Red gets dimmer, Green is off, Blue gets brighter
      case 511 ... 765:
        redVal = 765 - count;
        grnVal = OFF;
        bluVal = count - 510;
        break;
      default:
        break;
    } // End switch
    analogWrite(redLED, redVal);
    analogWrite(grnLED, grnVal);
    analogWrite(bluLED, bluVal);
    delay(DELAY_TIME);
  }
}
 

ZoolanderMicro, where small ideas are a big deal


Squish liked
ReplyQuote
Squish
(@squish)
Eminent Member
Joined: 4 months ago
Posts: 38
2020-10-26 9:45 pm  

Thanks, @zoolandermicro

 

I'll definitely be trying out your code.

I'm using a Digispark 'fake Rev3' ATtiny85 board, with the, 4 fingered gold strips on a stumpy part of the tiny board as the USB connector.

1st time I installed 1, it worked no problems. I'm not sure if an arduino IDE update caused the probs, but according to google Windows 10 regularly comes back with "Device not recognised". Exact same problem in Windows7 on my laptop too.

 

Wondering if you can help me with this question;

Often in other people Neo-Pixel Code, if find this comment;

// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.

1. It dosent mention which voltage the Cap should have?

2. As I only use an Arduino to power things atm, do I really need one?

3. Am I more likely to need them when I start using 12 and 24 volt power sources?

 

Thanks for your help, especially thanks for the code, really looking forward to playing with it.

 

No such thing as too much energy, it's just un-utilised potential.


ReplyQuote
Page 2 / 3