Piezo activated LEDs, arduino controlled

Discussion in 'The Projects Forum' started by Interitus, Jul 4, 2010.

  1. Interitus

    Thread Starter Member

    Nov 8, 2009
    34
    0
    I've made a drumkit for rockband2, and I've installed RGB leds and a series of white leds in each pad. Each pad connects to my arduino-based board, Ardweeny, via Cat6 cable. Each output on the ardweeny turns on a mosfet, which turns on the LED string. There are 5 leds per color, and 25 white LEDs right now. Each pad has a seperate piezo for the light circuit.

    The script programmed into the arduino is simple, reads the analog input, checks it against a threshold value, turns on the associated LED chain. After so many cycles of any LED being on, it turns on the white leds for about half a second. It all worked fine on the test bench when testing one pad at a time, but now with everything hooked up the white is not turning on as often as it should be, and after a few seconds of hitting the piezos, all the LEDs come on. The LEDs don't come on full tho, the yellow LED still shows up yellow, not full red and green. And there is a flicker on the white leds. It all works again for a little bit after hitting the reset button, then goes on full again. I did a bit of testing, and then it seemed to work. I did a bit more work on the kit, not associated to the electronics, and it started doing it again.

    I tried asking for help in an electronics IRC channel, the only thing I could get as a suggestion before they decided to leave was to move the 1M resistor from inside the pad closer to the analog inputs, and to disconnect all but one piezo to "see if the tap is just propogating along the object they're all attached to" and "leave the analogs floating". He also mentioned something about weak pull-down resistors?
    After I disconnected all but one piezo, and moved a resistor down near the inputs, tapping the red pad was activating the other pads as well, tho nothing was very bright. I then took another look at the wiring and saw that my white leds had been disconnected from the output (they're just temporarily hooked up right now until I figure out a solution of how to get them all hooked up properly). I reconnected the white leds, and after a single tap, all the leds would come on and the whites were pulsing on/off quickly.

    I don't really know much about electronics, and I am at my wits end with this. I dont even know what else to try other than changing how the grounds are wired on the control board. I'm very close to giving up on this and scrapping the LEDs entirely, and I have no desire to spend any more money on this. Anything you can suggest to try or check would be extremely helpful.

    Here is all the info that I could get together, if you need more, let me know.
    Script programmed into the arduino: http://pastebin.ca/1893150
    Connections inside the pad: http://img713.imageshack.us/img713/8051/p1010054b.jpg
    Control board and connections: http://img15.imageshack.us/img15/1914/p1010055k.jpg
    Detail of control board including soldering job: http://img231.imageshack.us/img231/5876/p1010015board.jpg
    Schematic of control board: http://img249.imageshack.us/img249/1456/leds4c.jpg
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
  3. Interitus

    Thread Starter Member

    Nov 8, 2009
    34
    0
    As cool as that circuit looks, I don't have the parts to build it. I was hoping for a less complicated solution as well...
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
  5. Interitus

    Thread Starter Member

    Nov 8, 2009
    34
    0
    I don't have a hex inverter schmitt trigger that is in that circuit. But, I have experimented a bit, and discovered I do actually have some 5.1V zener diodes here (1N4733AT). I've put a zener diode and a 100k ohm resistor (have no 82k) in parallel with the piezo, with the black bar on the diode facing towards positive. I have it this way for the red and yellow pads. The red pad still triggers the blue, green, and orange pads in addition to itself. I dont think it was triggering the yellow pad before either. I ran out of 100k resistors now tho, so I cant do the other pads. And I dont think the LEDs are turning on as bright as they could, but thats likely something to do with the specs of my mosfets, not the arduino. I also don't have my white LEDs hooked up currently, something that seems to cause problems.
     
  6. Interitus

    Thread Starter Member

    Nov 8, 2009
    34
    0
    I had a friend come over and we ran some tests on the kit. Hooked it up via USB and had it msg back the values of the analog inputs, and we were getting numbers all over the place. I think we only had one piezo hooked up, and all the inputs were reporting values of ~300 (out of 1023), with no input on the piezo. Striking the pad was making all the inputs spike fairly high, and took a while to drop down. After more testing, I think we ended up grounding the inputs we weren't using, and the values were dropping down under 30 or so. At one point, striking the red pad was giving expected values, without affecting one of the other pads (turned off reporting of other ones). With it only reporting values over 60, I'd only get one line returning, but striking the blue would give about 10 lines or so of high number.
    If I remember correctly, we were thinking that the analog inputs needed a zeroed input to refer to or something to keep a zeroed input on them, as a reference voltage or something.and something that turning on the LEDs , using the ground, was affecting the input grounds as it all goes back to one point.

    Was discussing these findings in IRC, and the guy I was talking to there was saying I should have a 5V zener diode in parallel with piezo, black bar towards positive, as a 1M resistor wont really protect the controller. I hooked it up this way, and input values were around 200-300 (out of 1023). I hooked up input 4 directly to ground and it lowered 3 of the inputs to zero or near it. The Red pad was sitting around 100 and yellow pad about 150. When I striked the pad, there was only a slight increase in the values.

    So I'm left wondering what to do? Pulldown-resistors has been suggested before, and from what I know of them, it sounds like it might work. But I want to confirm before ordering from digikey (I doubt I'd get them in town)((I cant even find pull down resistors on digikey...)). Or is there something else I could do?
     
    Last edited: Jul 30, 2010
Loading...