Help With SMD Led Chaser/Nightrider? For Xbox!

Got a project in mind? Post it in here to get help from the forums. No idea too crazy or mundane!
Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby Almurray42 » Sun Dec 16, 2012 10:32 am

I didn't even think about the resistors haha, well I'll experiment with it, my aim is to get the brightness as equal as possible!

Sent from my Nexus 7 using Tapatalk 2
Image
[MOD IT] [OR BIN IT]

phenoptix
Competent
PostsCOLON 744
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Mon Dec 17, 2012 11:11 pm

Equalising brightness is a task in itself. Measure and perceived brightness differs too. The larger version will have pwm available, not sure how it will work with Charlie plexing but looking forward to having a go getting it working

dec0y7
Competent
PostsCOLON 352
JoinedCOLON Sat May 28, 2011 11:26 am
LocationCOLON Sheffield UK

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby dec0y7 » Mon Dec 17, 2012 11:39 pm

I could put one on my mill as an reference to activity........
tis Better to have tried and failed than never to have tried at all

I blame spelling errors and my writing skills or lack of...... On fred!!!!!! My blood clot (yes I really did name it lol)

Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby Almurray42 » Tue Dec 18, 2012 12:55 am

Yeah true, PWM would be great... But as you say may be quite tricky!

And it would be the coolest status/monitor lights you could get for a mill haha!
Image
[MOD IT] [OR BIN IT]

dynamis_dk
Below Average
PostsCOLON 16
JoinedCOLON Thu May 23, 2013 4:47 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby dynamis_dk » Thu May 23, 2013 4:55 pm

Very glad I've found this as I'm hoping it can be the basis for a little project I'm working on.

As part of a computer case mod I'm looking to create a small (30mm diameter) circle with 8 evenly spaces LEDs which when powered follow around chaser style from (thinking as a clock, 12, 1, 2, 3 etc then when it hits 11 goes to 12, 1, 2 etc).

Using this little project as a basis, is it as simple as modifying the code to remove the bottom section which looks to turn the light on in reverse?

I've no technical knowledge in electronics but I'm fine with soldering some SMD parts, PCT creation etc and I'm an IT tech by day so shouldn't find programming bit too hard to figure out. I managed the effect using an arduino uno but didn't want the arduino to live in a PC mod for the rest of its life so this seems idea (especially due to its size).

Based on having a quick think and a play - I'm I anywhere near ball park with the following (I've stole / reworked a few of the images etc on here to try and help my understanding):

Rough idea of what I need to do to drop it to 8 LED's - No resister on line D as it never has a positive value and only acts to give the others a ground?
Image

Edited this to follow the above image, the references A-D seem to match the quick table in the above image

CodeColon Select all

/*
* TinyCylon.c
*
* Created: 24/04/2012 16:18:00
*  Author: phenoptix
*/
#include <avr/io.h>

#define OUT_A 3
#define OUT_B 2
#define OUT_C 1
#define OUT_D 0

int main(void)
{
   int i;
   while(1){
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(0);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(1);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(2);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(3);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(4);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(5);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(6);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(7);
   }     
   return 0;
}
//DDRB Config for each LED. Here we need to assign the two "active" pins to switch on each LED.
//Setting the others to inputs which gives them a high impedance state.
//This line states that the information will be a constant, the value will be a character, stored in a list called PINS_ACT that is 12 values long (0-11)
const char PINS_ACT[12] = {
( 1<<OUT_A | 1<<OUT_D ),//LED0
( 1<<OUT_A | 1<<OUT_C ),//LED1
( 1<<OUT_A | 1<<OUT_B ),//LED2
( 1<<OUT_B | 1<<OUT_A ),//LED3

( 1<<OUT_B | 1<<OUT_D ),//LED4
( 1<<OUT_B | 1<<OUT_C ),//LED5
( 1<<OUT_C | 1<<OUT_B ),//LED6
( 1<<OUT_C | 1<<OUT_A ),//LED7
};


//PORTB Config for each LED. We've already set the active pins now we set which is high.
const char LED_HIGH[12] = {
(1<<OUT_D),//LED0
(1<<OUT_C),//LED1
(1<<OUT_B),//LED2
(1<<OUT_A),//LED2

(1<<OUT_D),//LED4
(1<<OUT_C),//LED5
(1<<OUT_B),//LED6
(1<<OUT_A),//LED7
};

void LED_ON(char LED) { //LED must be from 0 to 11
   DDRB = PINS_ACT[LED];
   PORTB = LED_HIGH[LED];
}


I'm I anywhere close?? I kind of think I understand what's happening but not exactly why it happens.

I'm I right in thinking the resistor value it based on the imput voltage used and the LED requirements (i.e. 3v input on a 3v LED wouldn't need one? where as a 5v input on a 3v/20mA LED would need 100 ohm)?

phenoptix
Competent
PostsCOLON 744
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Thu May 23, 2013 7:09 pm

I'll try it on a tiny cylon board tomorrow to see if it works ok. My thoughts however would be to use a shift register as you only need 8 LEDs, you could control it with the same chip as this. I'm exploring a few uses for them at the moment so will see what I can come up with too.
Thanks for checking the forums out though, I need to put some time into them!

dynamis_dk
Below Average
PostsCOLON 16
JoinedCOLON Thu May 23, 2013 4:47 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby dynamis_dk » Thu May 23, 2013 7:18 pm

Any solution which means I can actually make it work is fine with me :)

Using the shift register (I've seen these used before but don't really know much on the how they work side), is it possible to control the duration each LED is on (modify the waiting time between shifts)?

Is there an advantage to using a shift register?

phenoptix
Competent
PostsCOLON 744
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Thu May 23, 2013 10:47 pm

It would simplify the wiring a great deal, 8 pins, 8 LEDs. You can have each on or off for as long as you like and even do basic dimming. The coding is easy too as you give the register a byte to turn on or off the LEDs. 10101010 would for example turn on LEDs 1, 3, 5 and 7.

dynamis_dk
Below Average
PostsCOLON 16
JoinedCOLON Thu May 23, 2013 4:47 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby dynamis_dk » Thu May 23, 2013 11:43 pm

Simple wiring is good :)

I'm going to be putting this onto a single sided UV board as part of the mod - take a look over here if you get 5min as you'll see what i'm up to :) http://forums.bit-tech.net/showthread.php?t=220767

I've seen an example where someone has an array of the pattern so it kinda reads like

00000001
00000010
00000100
00001000
etc

Presume that must be based around the same kind of idea.

The effect I'm after is recreating how a Sky+ box has the little spinning blue circle in the middle of the box so ideally I'd like to have it so when each LED moves to the next places (say LED 2 turning on), the last LED (so this would be LED 1) has a 100-200ms dim to off, rather then a straight off. Taking things a step at a time tho lol, initially I'm happy just getting something blue and spinning in there as this was a suggestion from another forum member and I like a challenge to work towards.

Rich
Above Average
PostsCOLON 89
JoinedCOLON Fri May 04, 2012 12:43 am
LocationCOLON Chesterfield
CONTACTCOLON

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby Rich » Fri May 24, 2013 12:19 am



Return to

Who is online

Users browsing this forum: 1 and 0 guests