element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Recycle & Retrofit
  • Challenges & Projects
  • Project14
  • Recycle & Retrofit
  • More
  • Cancel
Recycle & Retrofit
Blog An Upcycled LED Decoration
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Recycle & Retrofit requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: dubbie
Date Created: 21 Dec 2020 6:54 PM
Views: 193
Likes: 9
Comments: 2
  • rgb led
  • lipo battery
  • attiny85
  • recycleretrofitch
Related
Recommended

An Upcycled LED Decoration

dubbie
dubbie
21 Dec 2020

Recycle & Retrofit

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage
Project14 Home
Monthly Themes
Monthly Theme Poll

 

I hadn't planned to submit an entry for the Recycling & Retrofitting challenge as I just didn't have any good ideas. However, the extended deadline and the recent lockdown meant that I had today spare so I thought - why not try something!

 

I had in mind to improve a small solar powered LED light that I have had in my garden for several years now that has ceased to function, due to battery failure. I wanted to replace the low powered battery with something bigger to create more light as well as microprocessor control to achieve a more satisfying LED flashing and illumination. So that is what I have done. Below is a video illustrating the original solar powered LED display thingy.

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

The video below shows the disassembled parts of the original solar powered LED display.

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

My aim with this upcycle was to replace the 1.2V Ni-MH battery with a 3.7V LiPo battery and charger. The solar cell only produces about 2V maximum so it couldn't be used to charge the LiP, hence the need for a USB charger. If I ever get a suitable solar cell of 5V or so that it may be possible to wire this into the LiPo charger. The LiPo battery is then used to power a DigiSpark ATtiny85 PCB to control a three colour LED as well as providing the potential for low power operation. The system diagram is illustrated below. The LED has a common Anode so when connection to ATtiny85 outputs the output needs to be low to turn on the LED. With a three colour LED it is possible to create most colours in addition to the main RED, BLUE and GREEN. I have only selected an additional WHITE (all the LEDs on) as colour mixing the LEDs is somewhat of a challenge and I didn't have the time.

 

 

The video below illustrates the new system before it is installed into the case. It is relatively simple and straight-forward. Sadly, due to the use of DuPont connectors it is a bit too large to fit into the original case, which is a shame. But, with more time and some rewiring I think it would be possible. Something for the future.

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

At this point I started to run out of time so the software is relatively simple. The main fragment is listed below:

 

while (1)

  {

 

 

// LEDs on

 

 

  pinMode(RED, OUTPUT);

  pinMode(BLUE, OUTPUT);

  pinMode(GREEN, OUTPUT);

  REDfadeinout();

  BLUEfadeinout();

  GREENfadeinout();

  WHITEfadeinout();

 

  digitalWrite(RED, OFF);

  digitalWrite(BLUE, OFF);

  digitalWrite(GREEN, OFF);

  pinMode(RED, INPUT);

  pinMode(BLUE, INPUT);

  pinMode(GREEN, INPUT);

  rnumb = random(4000);

  delay(rnumb);

  // CPU sleeping LEDs off

 

  LEDsoffSleeping();

 

  } /* while */

 

I have created four functions to control the three LEDs, one for RED, one for BLUE, one for GREEN and one for WHITE (all the LEDs on). I have used for loops to create a fade in and a fade out and used random numbers to determine the amount of fade in and the amount of fade out, plus a random delay between sequences. The RED LED Function is listed below.

 

void REDfadeinout(void)

 

{

 

long randnumb;

int redindex;

int cindex;

 

  randnumb = 0;

  redindex = 0;

  cindex = 0;

 

  digitalWrite(BLUE, OFF);

  digitalWrite(GREEN, OFF);

   

// Fade in the RED LED

  randnumb = random(REDmaxfadein);

  for (redindex = 1; redindex < randnumb; redindex++)

    {

      for (cindex = 0; cindex < 5; cindex++) // Repeat 10 ties

        {

          digitalWrite(RED, ON);

          delayMicroseconds(redindex);

          digitalWrite(RED, OFF);

          delayMicroseconds(randnumb - (redindex - 1));

        } /*  for */

    } /* for */

 

// Fade out the LED

  randnumb = random(REDmaxfadeout);

  for (redindex = randnumb; redindex > 0; redindex--)

    {

      for (cindex = 0; cindex < 5; cindex++) // Repeat 10 ties

        {

          digitalWrite(RED, ON);

          delayMicroseconds(redindex);

          digitalWrite(RED, OFF);

          delayMicroseconds(randnumb - (redindex - 1));

        } /*  for */

    } /* for */

 

} /* REDfadeinout */

 

 

The LED sequence is always the same: RED - BLUE - GREEN - WHITE, just due to the lack of time but it would be easy to create a random sequencing of colours as well.

 

Sadly, due to the use of DuPont connectors it is a bit too large to fit into the original case, which is a shame. But, with more time and some rewiring I think it would be possible. Something for the future. So I used the top off a starch spray can as the new base and the final working system is shown in the following video. It all works although it is not quite as low power as I wanted, but with some additional programming it will be possible to significantly reduce the current requirement, thereby extending the battery life before it needs recharging.

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

The LEDs are on for a period of approximately 4 seconds with an average current of about 15 mA. This is followed by a sleep period of 8 seconds which takes a current of 0.7 mA. This averages out to

 

((4 x 15) = (8 x 0.7))/12 = 5.5 mA

 

So a 1000 mAhr LiPo battery should last 1000/5.5 = 182 hours, or 7.6 days and should last until after Christmas Day.

 

So, there we are, a mostly fully working multi-colour battery powered upcycled LED display. In reality I have only reused the glass glow used to disperse the light, but with a bit of reworking it would be possible to use the bottom case as well But it looks OK and I'm going to add it to my Christmas decorations. It should last for three or four days before the battery needs recharging.

 

Dubbie

Anonymous

Top Comments

  • DAB
    DAB over 1 year ago +1

    Nice build.

     

    DAB

  • dubbie
    dubbie over 1 year ago in reply to DAB +1

    DAB,

     

    Thanks. I am slowly inching myself along the learning curve for the ATtiny85 (as well as LiPo batteries) towards my ultimate goal of a very low power system. I have just ordered some ATtiny85V which…

  • dubbie
    dubbie over 1 year ago in reply to DAB

    DAB,

     

    Thanks. I am slowly inching myself along the learning curve for the ATtiny85 (as well as LiPo batteries) towards my ultimate goal of a very low power system. I have just ordered some ATtiny85V which will operate down to 1.8V and should now work well from a CR2032 battery unlike the DigiSpark ATtiny85 which really needs greater than 2.8V.

     

    Dubbie

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • DAB
    DAB over 1 year ago

    Nice build.

     

    DAB

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube