Bar graph LED electronics help needed

Discussion in 'Replica Props' started by Mr. Nagata, Feb 25, 2012.

  1. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    I'm trying to make a simple circuit for a phaser rifle. All I want to do is wire some kind of controller circuit for a 10 segment LED bar graph with two push buttons. One button would light the segments sequentially, the other would turn them off. So some kind of basic up/down counter. But after hours of searching the internet, I can't seem to find a schematic for something like this. Can anyone point me in the right direction?
     
  2. Robiwon

    Robiwon Master Member Gone but not forgotten.

    Trophy Points:
    2,595
    Sending you a PM.
     
  3. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    Thanks Robiwon. I've seen that circuit before. It's not quite the same as what I'm looking for. With that circuit if you watch the demo video, you hold down the button and the lights sequence up very quickly, then flash a few times. Then you reset it with the other button. It looked promising, but it's in actuality more complicated than I would need.

    I'm hoping to find a schematic of a circuit where you push button A and one segment lights up. You push it again and the next segment lights up. And so on and so forth until the entire barograph is lit. If you push button B, the last LED segment will go off. Press it again and the next one goes off. Until the whole barograph is de-illuminated. Does that make sense? Is that actually way more complicated than I think it is? It seems like a simple concept, but I'm an electronics novice who pretty much only knows how to solder. So maybe I'm way wrong.
     
  4. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    P.S. I'd also be okay if button B just reset the who bargraph, rather than step it down. That would be acceptable as well.
     
  5. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    Bump. Any thoughts?
     
  6. Mr.Engineer

    Mr.Engineer Well-Known Member

    Trophy Points:
    736
    I have done this years ago for one of the Phaser rifles but the deal botched because I could not live with working on a recast. This was my few very first prop projects and I did not realise the cost of setting things up when I wanted an optical trigger and a working (changing LED colours) scope. This video did not show the 'screensaver' feature although it was done because I have reused the prototype board for other things and realised too late.

    http://chowfookcheong.com/Phaser Rifle IIIa/Phaser rifle.htm


    Finally, I gave that up but when a friend wanted me to modify his Playmates Boomerang Phaser, I salvaged some of the circuits into them here. Notice that this time, the video is much better now because I stopped talking :lol:

    Exploring the Playmates First Contact Phaser
     
  7. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    Thanks for sharing. I found your video and web page as well in my endless search for how to make this circuit. It's excellent stuff, but beyond the realm of my understanding and capability. I'm just looking for the basic circuit that will light up the bargraph.
     
  8. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    does it have to be a button? Would a potentiometer work instead?
     
  9. Mr.Engineer

    Mr.Engineer Well-Known Member

    Trophy Points:
    736
    Unfortunately, the Star Trek Phaser Rifle needs two buttons to adjust the rifle's 'power' setting, just like the hand phasers in Star Trek:The Next Generation, Deep Space Nine and Voyager.
     
  10. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    I was afraid of that, would have made things so much easier.

    It lOoks like the circuit on here does the incrementing, im not entirely sure. For the second button you could have it so it just turns it off. Would be fun to breadboard it.

    Up/Down LED Sequencer - Page 2

    It actually looks like he made a better circuit tested in real life here,
    http://www.electro-tech-online.com/general-electronics-chat/89852-up-down-led-sequencer-4.html


    Otherwise I think that you'd have to enter the realm of micro controllers and programming. Eeek!

    Blah, scratch that. I just realized that I don't think these work with each button press; once you flip the switch they increment by themselves. Oh well.
     
    Last edited: Feb 26, 2012
  11. Mr.Engineer

    Mr.Engineer Well-Known Member

    Trophy Points:
    736
    Yep, went that route many many years ago. Took me a lot of IC Chips, funky wiring and lots of hair falling. Eventually, I got a very big circuit board which sucks a lot of power and still can only does 40% what I wanted it to do.:facepalm

    So, I saved up and bought a microprocessor package and all it took was just one chip which does everything. But man, I am still learning those stuff as I can blink LEDs but I just can't dim them... yet.:unsure
     
  12. Nicksdad

    Nicksdad Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,415
    Hey Ryan, I have an old upgrade circuit made for the playmates phaser years ago that if I recall does about what you want. You push the left button and the bar graph climbs up, you push the right button and it resets. It might work for you. Ir you are putting your circuit into a first contact rifle then I have a chaser circuit that the guys used in those originals.
     
  13. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    If you are willing to tolerate the B button just resetting it, you can do it with one chip, the 4017 decade counter. I haven't read every link in every post above and it's almost certain to have been mentioned.

    It has a clock input to which you connect your "up" button, a reset input to which you connect your "Reset" button, and ten outputs, to which you connect your LEDs (always via a suitable series resistor).

    There are subtleties. To turn it into a bargraph, you will need to dance the funky chicken with some transistors (or gates) and diodes to ensure that everything less than the active output turns on, because by default it just has one output active. You will need to debounce at least the "up" switch, or you'll find that switch bounce will make it count up in units of more than one. This is easily googled.

    Option B involves something like a LM3914 bargraph meter driver. It's a bit more complicated to set up, but it's basically a bargraph volt meter. You'd want to make it read the voltage across a capacitor, and have your A and B buttons charge the capacitor via a resistor. The graph would increase while you held one button down, and decrease while you held the other one down. It would be nonlinear, possibly very nonlinear, so the speed with which the segments illuminated would change as it got near the ends.

    Neither of these really replicates the behavior of the screen prop, which I suspect used a microcontroller (which is how I'd do it). That said, if you're not into microcontrollers, I think it can be done in discrete logic, probably two chips.

    Chip one is a 4510 BCD counter. This operates broadly like the 4017, except it has a count-up input, and critically, a count-down input. The other difference, though, is that it doesn't have a completely decoded output. It outputs BCD, binary coded decimal, which is basically four-bit binary data. That's no disaster, though, because you could then use a 74HC42, which takes the four BCD outputs from the 4510 and decodes them to individual outputs.

    You would still need to debounce the switches and do something to ensure that all the segments below the one you selected were lit, which could actually get quite sticky - I'd do it with transistors and diodes, probably. At that point you would have exactly replicated the behavior of the screen prop, with the possible exception that if you went all the way up to the top and kept pressing "up" it would probably wrap round to the bottom again.

    You could I suppose have a 4017 connected to a high-speed oscillator, and connect a series of AND gates between its outputs and the outputs of a 74HC42, with their outputs connected to the reset on the 4017. That would keep all the segments below the selected segment lit. More could be used to gate off the "up" and "down" buttons to prevent overflowing. But that's ten AND gates, and now the thing is becoming a five or six chip monster.

    Which is why people do it in microcontrollers.

    HF
     
    Last edited: Feb 26, 2012
  14. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    Interesting read Hfuy. I found this schematic for an LED sequencer but i'm not entirely sure if it operates the way OP wants. It uses 3 74LS194 chips and two ULN2803A chips to drive the LED's. I'm tempted to bread board it but would certainly like your opinion on it's functionality.

    Check it out.
    View attachment 85390

    I know OP has already gotten offers of the same chip but it'd be nice to know what kind of options there are to play with.

    I'd love to get something to work using wired logic instead of a MC if possible.
     
    Last edited: Feb 26, 2012
  15. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    Hrm, that's quite crafty. I haven't analysed it in depth but I think it does broadly what you're after, although it has one button and an up/down switch as opposed to an up button and a down butto, but that looks like it's fixable.

    It's probably a cleaner solution than any of my harebrained plans, certainly.
     
  16. SJason

    SJason New Member

    Trophy Points:
    16
    Way too much work and bulk, with old style electronics, heh - an MCU, a chocolate bar, and an hour to program...
     
  17. Dave Porter

    Dave Porter Sr Member

    Trophy Points:
    1,506
    I'd do it with an Arduino nano or mini, and just program it to do what you'd want.
     
  18. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    Assuming you're already au fait with MCUs, yes.

    Arduino makes this sort of thing rather a lot easier, but most Arduino boards are too big for a phaser. I think there are some very small ones designed for wearable stuff that might suit. To the OP, do investigate that, at least. It's suprisingly easy, and probably not significantly more expensive than all these discrete chips.

    HF
     
  19. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    If the code isn't big, and doesn't use many pins it can be ported over to an 8-pin ATtiny Chip or something similar via an Arduino board. I just don't have the where with all in me to learn coding for projects like that. I can make an LED blink but that's just about it. :lol

    Here's some simplified instruction to "shrinkify" Arduino projects.
    http://www.youtube.com/watch?v=30rPt802n1k

    If anyone wants to post the Arduino code up by all means post away. I think it would be fantastic to archive something like that in this thread for the sake of future searches. Just use spoiler tags to hide all that code! hehe


    That's great to know! Now if i can ask one more favor and inquire as to what the clock is? Is it a 555 timer wired for a single pulse or something? That's the only thing holding me back from ordering the parts.

    I love circuit logic like this because of the abundance of parts that are used. Kind of the opposite of most people's thinking I know, but having a compartment that shows electronic guts like this in a phaser just makes the prop look all the better IMHO. :)

    Cheers! :cheers
     
  20. Mr. Nagata

    Mr. Nagata Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,560
    Wow, there's a lot of information here. I appreciate all the help, though this is beyond my abilities, especially for this project which is only a quick build. I'll probably just have non functioning buttons and just light the bar graph LED solid when the rifle is turned on.
     
  21. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    Well, if you want the super simple approach, do the 4017 thing. At least you can increment it up, and it's one chip and half a dozen external parts.

    The clock is just a pushbutton. You're clocking it up and down one step at a time to create the effect. You might have to do a bit of fiddling to translate that into an up/down button.
     
  22. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    Ah, good to know! Time to order me some goodies! I'll be sure to post my bread boarded results. Thanks for the helpful info Hfuy!
     
  23. madmanmoe64

    madmanmoe64 Well-Known Member

    Trophy Points:
    566
    I always use PICAXE for projects like this. It's similar in approach to Arduino, in that it is meant to be an entry level into programming micro-processors.
    It was originally developed as a means for teaching electronics to students.

    The main difference to Arduino is that instead of having a large populated board, into which you plug stuff, it is just the Pic on it's own (you can use anywhere from 8 to 48 pin models) And each pic is relatively cheap (£1.50)
    You can programme it via USb which makes everything easier.

    In about a day I was able to breadboard a working IR motion detector without ever having programmed a pic before.

    Maybe a bit of an undertaking for just one project, but it's a small investment and I use them all the time in projects now.
    This explains it far better
    What is PICAXE?
     
  24. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
  25. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    Just use a simple 555 timer with a decade counter IC--most of those circuits will do what you want.
     
  26. Aaron01110111

    Aaron01110111 New Member

    Trophy Points:
    2
    I would have to agree with avian, using a 555 with perhaps a 4029, and I would add a 4511, then connect the pins (using resistors of course), of the bargraph leds, to "a-g" pins of the 4511.

    you can do it, don't give up! Good luck and God bless !
     
  27. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    Yep--or even a 4026, as it'll drive 8 channels.
     
  28. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    well, I breadboarded everything but I couldn't get the * thing to work. Don't know if I missed a connection somewhere or what, but no joy all the way. To top it all off the graphs I received are all common anode, which is a pain because I'm not too savy like that.

    I know what a 555 timer is but I wouldn't have a clue as to wire them with what as was suggested here. Let alone to make it so it increments with each button press.
     
  29. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    That's where you would need to wire the 555 as a monostable one-shot timer for each increment pulse.
     
  30. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    Just to be sure you mean like this right?

    [​IMG]

    And then the #3 would be wired to which IC, 4026 or the 4511?
     
  31. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    That's one example--there are others.
    The decade counter IC depends upon how many channels you need to drive.
    When I get home tonight, I'll take a look and draw up a usable diagram for you.
    In the meantime, shoot me a message with exactly you want the circuit to do and type of control you want.
     
  32. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    Here are a few:
    [​IMG]

    [​IMG]
     
    epilepticsquirl likes this.
  33. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    Sounds great man. At this point it's more of a learning experience for me than anything else; and if others can learn something to then great! I'll shoot ya a PM with what I want but in a nutshell I've got some anode common LED bar graphs that I'd like to increment with a button. It's probably easier to wire up than I'm thinking about.
     
  34. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    OK, OK, I give up, I fold.

    How many LEDs do you want it to light up?

    Edit: Also, is this a screen prop that will appear on camera? It's slightly easier to do if it is acceptable that the LEDs may shimmer slightly when shown on video.

    Edit edit: And what d'you want to run it from? Three AA cells is easiest from an engineering point of view, as the micro is a 5V device (that will tolerate 4.5)
     
    Last edited: Mar 17, 2012
  35. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    Are you talking about programming a Microcontroller?
     
  36. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    Well, possibly. No guarantee on turnaround, though.
     
  37. avianoguitarist

    avianoguitarist Active Member

    Trophy Points:
    332
    Besides the plethora of schematics i sent you--a programming board would be the easiest option...
     
  38. epilepticsquirl

    epilepticsquirl Sr Member

    Trophy Points:
    1,782
    It would be, but then I wouldn't learn anything. ;)

    Thank-you for your offer Hfuy but using logic gates are a great way to learn some circuitry. I've got an Arduino but I find the circuits themselves fascinating in their own right and would just love to get a handle on them. One of those crawl before you walk things you know?
     
  39. Hfuy

    Hfuy Active Member

    Trophy Points:
    341
    Well, OK, let's get the discrete logic approach working then.

    Common anode displays are going to make it slightly more complicated, but it shouldn't be the end of the world. It simply means that all the positive ends of the LEDs are connected together, and you need to control the display by connecting its negative ends to ground. You can do this using inverter chips on the output of your existing logic circuitry, although you could also just reverse the sense of your "up" and "down" buttons and flip the display over to get the same result.

    The way to prototype this sort of thing is to do it block by block and test each part works before you move on. For instance, if you used the 4510 BCD counter, you could put four LEDs on its outputs (with suitable series resistors) and watch it count in binary, to ensure you'd got that bit right. I don't know what you've bought, but you might want to try that in the first instance. Then you can add the other parts.

    The only thing that confuses me is the constant reference to 555 oscillators in this thread. The 555 is a timing device that's very often used in situations where you want a running sequence of lights. I suspect a lot of real Star Trek hand props used exactly the sort of 555/4017 combinations that are being proposed here - the tricorders, etc - if they didn't do it with micros.

    The thing is, you don't want a constant running sequence, you want a sequence that steps up or down when you press a button. That being the case, you don't need something that has a 555 in it. Just connecting a pushutton (via suitable debouncing circuitry) to the clock input of the 4017 will make it step up once every time you hit the button, which is sort of half of what you probably want. As we discussed before, there are imperfections with this simple approach. It won't count down, it'll only light one LED at once, and when you reach the top end it'll cycle around back to zero again. But that's sort of partly what you're after - and it doesn't need a 555 oscillator section.

    You could theoretically build a 555 one-shot, but you might as well just connect it directly to the pushbutton. There wouldn't be a lot of point, other than perhaps as a really overcomplicated approach to debouncing.

    What ICs do you have at hand?

    HF

    PS - Something else that strikes me is that many digital logic ICs aren't going to have the grunt to control, say, ten LEDs all at once. That's a not-insignificant amount of current. If things start getting hot, we may need to address this. Be aware.
     
    Last edited: Mar 18, 2012
  40. Mr.Engineer

    Mr.Engineer Well-Known Member

    Trophy Points:
    736
    Because of this, I steered away from the logic path when I wanted to do the Phaser Rifle many years ago. It would include a lot of wiring and hair pulling (because all it takes is one broken wire....). even if I did get it working, the circuit board will be very very large and not to forget, the amount of power it needs.

    As I continue from my earlier post (page 1), I forgot to mention that this circuit I did was using 3 volts and I actually tapped the power from the toy's existing batteries after a few minutes probing it. But if you're using more than 5 volts, you will definitely need a 7805 voltage regulator, current limiting resistors and what-nots.

    I have just drawn the circuit (from memory) this morning. As its using 3 volts, I did away with a lot more components since they're not that 'critical'. Based on my own experience, doing the circuit and also wiring it up is the easy part for me. What really took so long was learning how to program the $&@# chip by myself as I do not have friends who have the software nor the programmer. I am still learning until now as I really hate programming.

    The programming was originally meant for the First Contact Phaser rifle which failed to materialise as no one wanted to put in the money for it. In this Phaser project, I modified the code from 16 LEDs to 10.

    In theory, both circuits (LED & Playmates sound) are supposed to work together but during multiple firing, it does not. Still my friend, Peter, was happy with it. As far as the Phaser is concerned, I think its still working as my trigger-happy friend did not call me since 2010 :lol
     
  41. SJason

    SJason New Member

    Trophy Points:
    16
    Heh, I've forgotten about this thread for over a month now - yeah, told my wife to make one up just for the experience, went to work, and she had it done when I got home. Even had sound effect for every level, and varying level of phaser emitter power. She also used the 16f628a. (oh, also an 'overload' effect with sound)
     

Share This Page