Author Topic: PIC Led Fade Help!!!  (Read 7678 times)

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
PIC Led Fade Help!!!
« on: January 11, 2011, 11:09:19 AM »
Hey everyone! I need some help with something, I'm sure someone will be able to let me know if this is possible or not.
Well I had a board that had three 5mm leds hooked up to it, red green and blue. The once power was supplied, each led would fade brighter and dimmer, with the other leds, making different colors. Then it would fade backwards, then flash, etc. I'm thinking that it was on demo mode, because there were two more solder points that were labeled SW and SW- that had no switch attatched to them, so I'm sure that you could switch through the modes.

I dug through my whole closet looking for it, found it, and hooked everything up. I had desoldered everything except the power wires, so I soldered all the leds back and hooked it up to a 3.6v power source. And nothing happened. Absolutely nothing. If you solder to gnd on the board, and to a resistor you get power, but after that, you get nothing. So I'm guessing it's broken. Unfortunately, the board was very small, small enough to fit in a PSP, and I had some big plans with it.

So now I am wondering if it is possible to acheive this effect again. I was browsing the forum and I came across this:https://www.acidmods.com/forum/index.php/topic,33689.0.html

This is a set of codes for a 12F683 that make LEDs fade, and the output is on pins 5,6,7. I was wondering if you could time all of these to fade in a pattern, for example 5 fades on, then when it is fading off 6 starts to fade on, then when 6 starts to fade off, 7 starts to fade on, and then it starts all over. And then maybe 5 and 6, then 6 and 7, then 5 and 7, and finally all three fade on. This would allow for a full rgb cycle, something that I just can't seem to do with out taking a PCB from something or 7 color fading 3mm leds, which are too big for my project.

If this could not be done, is It possible to make a code where just pin 5 outputs a steady voltage, and then hooking it up to a switch could change to pin 6, and so on. It looks like there is no way to switch modes ATM, i just see voltage input, gnd input, and then the three output pins, but I'm not sure if you can program this, or if the PIC does not allow it.

I have no idea how PIC's work guys, and about programming hex and the like, so please excuse my stupidity if nothing above even makes sense. But I would love to learn more! So hopefully someone with a bit more knowledge can help me out! Thanks guys!

-Val

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #1 on: January 11, 2011, 11:43:41 AM »
Quote
5 fades on, then when it is fading off 6 starts to fade on, then when 6 starts to fade off, 7 starts to fade on, and then it starts all over.

isnt this what the code you posted does?

if not use this
http://www.instructables.com/id/Fun-with-IKEA-lamp/
its not my worked but i used it a while ago to make a present for my mum :P

Offline Rodent

  • XBOX,XBOX360,PS3,WII
  • Acidmods Alumni
  • Around the block
  • *
  • Posts: 2983
  • Post quality +75/-5
  • Gender: Male
  • MODDER, REPAIR, CUSTOM IDEAS.
Re: PIC Led Fade Help!!!
« Reply #2 on: January 11, 2011, 11:52:59 AM »
Use Tops led fader it will change from color to color if thats what your looking to do. thats what i just used in my controller mod and may use it in my case mod, works great, use bread board to set it up and work with it the way you want to with multiple leds  before you build it makes it easier :)

 Tracey: I cant believe Rodent of all people made my damn day
3D0: snacks cartoons and naps  lol sounds like rodents typcial day :rofl:
Rodent consoles mods

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #3 on: January 11, 2011, 11:55:05 AM »
isnt this what the code you posted does?

if not use this
http://www.instructables.com/id/Fun-with-IKEA-lamp/
its not my worked but i used it a while ago to make a present for my mum :P
well I have no idea! I don't know how these work, and I've never tested any of the codes on the PIC, that's where i was hoping you guys could help me out, if it does work like that, sorry for the long rant!
And hyper i checked out the link, could you help me more with how you did it, I see resistors and capacitors and a whole bunch of other junk, can i just flash the code to the IC and make my own schematic, or does it have to be like his, i've done plenty of led mods before, i'm good with soldering, but when it comes to electricity i'm still a n00b. But I want to learn! Thanks hyper.

Post Merge: January 11, 2011, 11:56:54 AM
Use Tops led fader it will change from color to color if thats what your looking to do. thats what i just used in my controller mod and may use it in my case mod, works great, use bread board to set it up and work with it the way you want to with multiple leds  before you build it makes it easier :)
Yeah rodent thats what I was talking about! So if i put one color led on each pin, it will fade from the color on that pin to the color on the next pin? that's what i'm wondering. And if I can fit the thing the hyper showed me into a PSP I'm probably gonna use that, it has different modes you can switch, which is something I'm also looking for. Thanks guys!
« Last Edit: January 11, 2011, 11:56:54 AM by VaLoRkEy »

Offline Rodent

  • XBOX,XBOX360,PS3,WII
  • Acidmods Alumni
  • Around the block
  • *
  • Posts: 2983
  • Post quality +75/-5
  • Gender: Male
  • MODDER, REPAIR, CUSTOM IDEAS.
Re: PIC Led Fade Help!!!
« Reply #4 on: January 11, 2011, 01:02:55 PM »
when i was testing it out i used like 6 different leds and if you follow the intsrustions on wiring it will go from one color to the next. I have a controller mod i just did on here, used 4 white leds for the buttons and 2 blue ones for the center, worked the way i wanted it to, should do what you want it to do .

when i first set it up it went from red to blue to green when i wired it up when i was testing it out. when i added it to the controller it wasn't bright enough so i went with a bright white led worked better , just needs to be brighter . I used the LEDFADER, 1st one on the list. should do what you wanted.
Rodent

 Tracey: I cant believe Rodent of all people made my damn day
3D0: snacks cartoons and naps  lol sounds like rodents typcial day :rofl:
Rodent consoles mods

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #5 on: January 11, 2011, 01:07:27 PM »
for the one i posted a schematic and hex file are below the picture here,
http://www.instructables.com/id/Fun-with-IKEA-lamp/step6/Engine/
it looks like it works exactly the same as t0p's code however what t0p's diagram does not show is that if you want to use more than one led per pin a transistor should be used

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #6 on: January 11, 2011, 01:16:21 PM »
for the one i posted a schematic and hex file are below the picture here,
http://www.instructables.com/id/Fun-with-IKEA-lamp/step6/Engine/
it looks like it works exactly the same as t0p's code however what t0p's diagram does not show is that if you want to use more than one led per pin a transistor should be used
I didn't see the download's, just made an account and downloaded the zip, makes more sense now! Accept that diagram is a little over my head, I'll probably be PM'ing you later for help Hyper.
And Rodent thanks for the description, this does sound like it will work for what I'm going to do, I'm going to try both, see which one I like better. Thanks for all your help guys, this is why I love this site!
-VaL

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #7 on: January 11, 2011, 01:19:44 PM »
what and how many leds are you planning on using?

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #8 on: January 11, 2011, 01:36:45 PM »
what and how many leds are you planning on using?
Probably 4 for each color, I can get away with using only 1 though, and they will be surface mount leds.

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #9 on: January 11, 2011, 01:44:28 PM »
well ok you can use as many as you want but if you are using more than one of each you will probably need to use transistors

if youve got the leds and a 12f683 try it uot on your breadboard and lets us know how it goes
« Last Edit: January 11, 2011, 01:48:10 PM by hyper999 »

Offline Rodent

  • XBOX,XBOX360,PS3,WII
  • Acidmods Alumni
  • Around the block
  • *
  • Posts: 2983
  • Post quality +75/-5
  • Gender: Male
  • MODDER, REPAIR, CUSTOM IDEAS.
Re: PIC Led Fade Help!!!
« Reply #10 on: January 11, 2011, 02:15:05 PM »
well ok you can use as many as you want but if you are using more than one of each you will probably need to use transistors

if youve got the leds and a 12f683 try it uot on your breadboard and lets us know how it goes

I am new at this how would i go about using transisters ? using like 16 leds with Tops led fader  code? using 3mm or 5mm leds.
« Last Edit: January 11, 2011, 02:15:58 PM by Rodent »

 Tracey: I cant believe Rodent of all people made my damn day
3D0: snacks cartoons and naps  lol sounds like rodents typcial day :rofl:
Rodent consoles mods

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #11 on: January 11, 2011, 02:19:15 PM »
well ok you can use as many as you want but if you are using more than one of each you will probably need to use transistors

if youve got the leds and a 12f683 try it uot on your breadboard and lets us know how it goes
I'm going to order the PIC tomorrow, and like rodent I've never really understood the function of transistors, do they amplify voltage? I'm guessing since multiple leds would dim the brightness, the transistor would provide the same amount of voltage for each led, or something like that lol and also what transistor would be applicable for this PIC? I'm not sure which one(s) to get.

Offline Famas

  • Granny Spanker
  • *
  • Posts: 403
  • Post quality +1/-8
  • Acidmods User
Re: PIC Led Fade Help!!!
« Reply #12 on: January 11, 2011, 02:34:08 PM »
hi ive been using tops fader code and let me tell you wow make sure you have em all different colours as it adds to the effect

Offline frenulem - No.5417

  • Ultimate Badass
  • Blogs & Media Team
  • Acid Modder
  • *
  • Posts: 633
  • Post quality +23/-0
  • Gender: Male
  • Learning Pascal Cuz i'm dumb and 'Ting
Re: PIC Led Fade Help!!!
« Reply #13 on: January 11, 2011, 02:38:36 PM »
I've never really understood the function of transistors, do they amplify voltage? I'm guessing since multiple leds would dim the brightness, the transistor would provide the same amount of voltage for each led, or something like that lol and also what transistor would be applicable for this PIC? I'm not sure which one(s) to get.
they have two functions, they act as an electronic switch and to amplify current, 2N222 is a good general transistor, can't go wrong with it

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #14 on: January 11, 2011, 02:42:29 PM »
fookz maybe able to explain this better but here we go

a transistor is an electronic switch, it allows a small current to switch a larger current

it has a base, emitter and a collector. when the base pin of an NPN transistor is connected to positive, current is allowed to flow between the collector(+) and the emitter(-)

so why do we use a transistor for more leds?
well the pic can only supply 25ma per pin which is about enough to power one led, so we use transistors to switch the leds on and off when the pic tells them to.

EDIT: damn you fren beating me to it! :P
and here is some more info http://www.kpsec.freeuk.com/trancirc.htm

« Last Edit: January 11, 2011, 02:43:12 PM by hyper999 »

Offline frenulem - No.5417

  • Ultimate Badass
  • Blogs & Media Team
  • Acid Modder
  • *
  • Posts: 633
  • Post quality +23/-0
  • Gender: Male
  • Learning Pascal Cuz i'm dumb and 'Ting
Re: PIC Led Fade Help!!!
« Reply #15 on: January 11, 2011, 02:45:55 PM »
Mwhahahaha.

but you explained better, also i forgot to mention that you can only get an amplifier OR a switching, unless you get a "Darlington Pair" Transistor which first switches then amplifies

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #16 on: January 11, 2011, 02:52:28 PM »
but that is fine as we only need switching for this ;)

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #17 on: January 11, 2011, 03:06:52 PM »
Ahh I understand i tad bit better now :tup: :tup: so i should go wit 2n222 correct, i've heard of it before, just never knew when it would be applicable to use. And will I need three, one for each pin, or just one?

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #18 on: January 11, 2011, 03:10:16 PM »
Atleast one for each pin depending on how many LEDs you use but one for each pin should be fine

Offline Famas

  • Granny Spanker
  • *
  • Posts: 403
  • Post quality +1/-8
  • Acidmods User
Re: PIC Led Fade Help!!!
« Reply #19 on: January 11, 2011, 03:11:24 PM »
3 for a pound phenoptix ebay :)

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #20 on: January 11, 2011, 03:15:37 PM »
Atleast one for each pin depending on how many LEDs you use but one for each pin should be fine
Kk thanks, I can forget about this in a psp unless I scrap UMD, I was actually thinking about fitting it into a psp go, but if I need three transistors and an IC i don't think it's all gonna fit
Random Fact:
2 blue and 2 purple leds in a umd door turn out quite nicely when both illuminated at teh same time. :3
« Last Edit: January 11, 2011, 03:17:22 PM by VaLoRkEy »

Offline hyper999

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1158
  • Post quality +544/-3
  • Research and Development
Re: PIC Led Fade Help!!!
« Reply #21 on: January 12, 2011, 05:06:45 AM »
im sure you could cram it in  a psp :P you could use smd parts? or just one rgb led or just use the ones that change color themselves

Offline nEoVaLoR

  • Local Moderator
  • Acid Modder
  • *
  • Posts: 734
  • Post quality +36/-26
  • Gender: Male
  • Young Modder
Re: PIC Led Fade Help!!!
« Reply #22 on: January 12, 2011, 01:35:10 PM »
im sure you could cram it in  a psp :P you could use smd parts? or just one rgb led or just use the ones that change color themselves
Well I had this in plan for a go, i had an original idea, maybe if i use smd it will fit, and in a couple weeks i'm custom ordering a psp you can only get in japan, hopefully it doesn't come out here later bc i'm about to waste another 150 on it.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal