Connect with us

Knight Rider K.I.T.T. Scanner

Discussion in 'General Electronics Discussion' started by kevbo423, Mar 28, 2013.

Scroll to continue with content
  1. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    Hey guys,

    I am looking to build an LED scanner/chaser for my next electronics projects. I want it to consist of around 30 blue LEDs (3.1fV @ 20mA), have an on/off switch, buttons or a knob that will change the speed (I believe I would use a potentiometer for this), and also a button that will allow me to switch between multiple patterns for the LEDs. I want to hook this up to my car; so that is what will be powering it. I know that this is going to require integrated circuits but I am completely new to them. If someone could get me started on the right track, I will begin to make a schematic.

    Thanks for any help in advance.
     
  2. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    A simple adjustable speed KITT pattern with no trailing lights is pretty easy, you can do this with a 555 timer, a few 4017 chips and some steering diodes... Optional transistors or darlington chips so that the load on the 4017 is reduced...

    Now once you get into the trailing effect and other patterns it gets much more complicated, and IMO a micro can't be beat... Heck at the end of the day the micro makes even the simple sweep easier but it requires you to be able to program micros...
     
  3. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    I'm alright with using a microcontroller. What kind would you recommend that is cheap and able to use 30 LEDs?
     
  4. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    I would recommend any micro with serial communication, and a serial LED driver or two... Generally 16 channel LED drivers like this for example are more economical than lager channel ones, use two of them and you can independently drive up to 32 LEDs in any pattern by just sending it serial commands from the micro...

    The micro choice is up to you and what compiler and programming environment you are setup to do or want to invest in...

    You could also do it by brute force and just get a 40 pin or so micro and some darlington chips or transistors to drive the LEDs and toggle 30 ports on the micro on/off...
     
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    11,801
    2,749
    Nov 17, 2011
    Or use 74HC594 (8 bit shift register with latch). Cascade any number of these chips to get n*8 parallel output pins. You need 3 pins on the µC (data, clock, latch) to send data into the shift register and latch it to the output.
    This will not allow for trailing lights (as in the original knight rider where it was due to the inertia of the incandescent bulbs). To achieve this effect with LEDs you will need adjustable LED current.
    The 74HC594 operates similar to the LED drivers CocaCola linked to. The difference being that the dedicated drivers need only one resistor to set the LED current, the 74HC594 needs one resistor per LED. And the 74HC594 may not be able to drive high currents.
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,500
    2,840
    Jan 21, 2010
    Or a uC and charliplexing. 6 pins can drive 30 LEDs.

    The programming required is a little "fancier"
     
  7. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    I would go with the 40 pin. Much simpler to program for a beginner than trying to use serial I/O or shift registers. You can get 40 pin DIP PIC microcontrollers.

    Bob
     
  8. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
  9. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    That is overpriced. It is also an older chip, which means it has less power and performance and costs more than newer chips.

    PIC16LF1904 would be a good choice and it is $1.99 in quantity 1 from Microchip direct.

    To drive that many LEDs you want to use darlington arrays, like the ULN2003, 7 drivers per package. About $0.30 each.

    Bob
     
    Last edited: Mar 28, 2013
  10. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Looking at this again, the part I reccommended is a 3.3V part.

    For your purpose, you probably want a 5V part because that is about what you will need for blue LEDs. So PIC16F1517 would be a better choice. It costs 3 cents more.

    Bob
     
  11. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    BobK,

    I really don't have any idea what you're talking about. Could you try to explain in simpler terms? For example, I don't know what you mean by "driving LEDs." Also you say that I will need 5V for blue LEDs. The blue LEDs that I have, have a forward voltage of 3.0-3.2V
     
  12. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    There is also another advantage to using dedicated LED driver chips, if you want the trailing lights is that many of them will allowing individual dimming of individual LEDs on the fly, takes a huge load off the micro...

    And on that subject, if you choose to use 30 I/O lines getting the trailing effect is even more troublesome to implement, especially for a newbie...
     
  13. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    The micro cannot connect directly to that many LEDs because the sum of them would require too much current for it to provide. So you need an external chip to turn the LEDs on and off. The Darlington arrays that I mentioned are just 7 transistor switches in a single IC package. You would use one of these switches for each LED.

    I said you need 5V to drive the LEDs because you need a little extra voltage to be eaten up by a current limiting resistor. I looked at the link and your LEDs had a forward voltage of 3.2 to 3.8V which is too much for the 3.3V PIC.

    As for Coca Cola's suggestion. I agree that if you want to get fancy with the patterns, serial I/O to a driver chip might be a better idea. But, as I said before, for a newbie to programming it might be a bit difficult. Let me explain the difference.

    In my scheme, you would simply control each LED with a single pin of the miccrocontroller (through one of the switches in the darlington array). This is simple and straightforward, unless you want something like the fading trailing effect that C.C. refers to. You cannot easily control the brightness of the LEDs with this scheme.

    In C.C.s scheme, the micro would use just a few pins to communicate serial data to a chip designed for driving LEDs, including controlling their brightness. You would need fewer connections from micro to the driver chips, but you would have to learn about SPI and data protocols and such things, instead of simply turning each LED on or off.

    Bob
     
  14. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    Ok I understand a little bit more. Thanks for explaining it on a lower level. I would like to have the trailing light effect. So I'm willing to learn about SPI and data protocols.

    As I understand it, I'm going to need a microcontroller and LED driving chips. Would I need a driving chip for each LED or does it connect to multiple LEDs?

    Also, how would I connect the microcontroller to my computer to program?
     
  15. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Coca Cola knows more about this type of LED driver, I have never used one.

    Are you there?

    Bob
     
  16. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    You need a programmer to program standard micros. They can be had for < $50 from Microchip. The PICKit 2 or 3 is an example. It connects to your computer via USB and you then program through tools that are free from Microchip. You can program either in assembly language or C.

    Another option is to use the PICAXE. This is a pre-programmed microcontroller that will cost you a bit more, but it needs no programmer, just a serial connection to the computer. It is programmmed via tools specifically for PICAXE in a BASIC like language. CDRIVE is the forum expert on PICAXE.

    As you can see, there are many options and it can get confusing real fast!

    Bob
     
    Last edited: Mar 28, 2013
  17. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    I'm here but I don't have the time to compose all the details right now, there is so much involved and personally I feel this is a giant leap for a newbie (as has become evident) to be taking on...

    So here is a pretty well laid out example written in BASIC that I happened to bookmark years ago (since that is primarily what I use) for a 16 bit LED driver, this isn't taking full advantage of all the features but it gets your feet dirty on the core principles...

    http://www.picbasic.co.uk/forum/showthread.php?t=10572

    On thing that will make it easier to visualize is to take the hex LED value in that example code and break it down into the primary binary numbers...

    Example

    LED value = $34FC when broken down looks like this...

    $3=0011
    $4=0100
    $F=1111
    $C=1100

    And that results in 0011010011111100 your 16 channels with 1 being on 0 being off...

    Now when you get into dimming and the sorts it gets a little more complicated and how the chip does that might change between chips but I highly suggest you just get on/off flashing and patterns working first before that...
     
  18. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    CocaCola,

    You said that you think it's a giant leap for a newbie. What would you suggest instead? Would not having the trailing effect make this more of a level someone like me can handle?
     
  19. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Yes, simple on / off status is what I was imagining when I suggested the 40-pin micro. If you want to build that first, you could still use the same micro for fading trails but the programming would get much more complicated. It might be reasonable to start with patterns that are only on / off and then move to fading effects.

    If you want to make the simplest version 1.0 you can set a limit on how many LEDs can be on at that same time that does not exceed the micro's capabilities. Then the circuit becomes very simple:

    1. A 40-pin microcontroller.
    2. 30 or so LEDs + a resistor for each.
    3. Decoupling between the power and ground pins of the micro.

    I think this is the minimum hardware configuration that would work for you. All the rest of it is software.

    Bob
     
  20. kevbo423

    kevbo423

    36
    0
    Jan 22, 2013
    Okay that sounds good. Could you explain how I would wire up this entire circuit with the LEDs and such. Also how would I switch between preset designs?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-