loading

Step 7: Troubleshooting

The main problems you're likely to encounter are getting Processing and the arduino to talk to each other. Make sure you install the arduino software - this will bring with it all the necessary serial libraries. You can find avoid problems with the circuit by testing as you go - test each LED, then each strand, then each transistor set. If all else fails go back to this to diagnose where the problem lies.

Now that I've managed to squash all the bugs from my own setup, I can't think of what they were off the top of my head. Post any problems you have, as I probably ran into them and have since forgotten.
<p>I cannot get processing to communicate with my arduino!</p>
<p>My led is not reacting with the sound at all I am just going directly to an led instead of using mosfets though</p>
I dont know if I'm doing something wrong, but I keep getting this error when trying to verify your code. <br>Instructable:5: error: variable or field 'drawWaveForm' declared void <br>Instructable:5: error: 'AudioSource' was not declared in this scope <br>Instructable:2: error: 'import' does not name a type <br>Instructable:3: error: 'import' does not name a type <br>Instructable:4: error: 'import' does not name a type <br>Instructable:5: error: 'import' does not name a type <br>Instructable:7: error: 'Arduino' does not name a type <br>Instructable:11: error: expected unqualified-id before '[' token <br>Instructable:12: error: expected unqualified-id before '[' token <br>Instructable:23: error: 'Minim' does not name a type <br>Instructable:24: error: 'AudioInput' does not name a type <br>Instructable:25: error: 'AudioPlayer' does not name a type <br>Instructable:26: error: 'BeatDetect' does not name a type <br>Instructable.pde: In function 'void setup()': <br>Instructable:46: error: 'P2D' was not declared in this scope <br>Instructable:46: error: 'size' was not declared in this scope <br>Instructable:48: error: 'minim' was not declared in this scope <br>Instructable:48: error: expected type-specifier before 'Minim' <br>Instructable:48: error: expected `;' before 'Minim' <br>Instructable:49: error: 'arduino' was not declared in this scope <br>Instructable:49: error: expected type-specifier before 'Arduino' <br>Instructable:49: error: expected `;' before 'Arduino' <br>Instructable:51: error: 'ledPins' was not declared in this scope <br>Instructable:52: error: 'Arduino' was not declared in this scope <br>Instructable:52: error: expected unqualified-id before numeric constant <br>Instructable:55: error: expected type-specifier before 'Minim' <br>Instructable:55: error: expected `;' before 'Minim' <br>Instructable:58: error: 'song' was not declared in this scope <br>Instructable:60: error: 'beat' was not declared in this scope <br>Instructable:60: error: expected type-specifier before 'BeatDetect' <br>Instructable:60: error: expected `;' before 'BeatDetect' <br>Instructable:63: error: 'in' was not declared in this scope <br>Instructable:63: error: 'Minim' was not declared in this scope <br>Instructable:64: error: 'beat' was not declared in this scope <br>Instructable:64: error: expected type-specifier before 'BeatDetect' <br>Instructable:64: error: expected `;' before 'BeatDetect' <br>Instructable.pde: In function 'void draw()': <br>Instructable:71: error: 'beat' was not declared in this scope <br>Instructable:71: error: 'song' was not declared in this scope <br>Instructable:72: error: 'AudioSource' was not declared in this scope <br>Instructable:72: error: 'drawWaveForm' was not declared in this scope <br>Instructable:74: error: 'beat' was not declared in this scope <br>Instructable:74: error: 'in' was not declared in this scope <br>Instructable:75: error: 'AudioSource' was not declared in this scope <br>Instructable:75: error: 'drawWaveForm' was not declared in this scope <br>Instructable:79: error: 'ledPins' was not declared in this scope <br>Instructable:80: error: 'beat' was not declared in this scope <br>Instructable:81: error: 'arduino' was not declared in this scope <br>Instructable:81: error: 'Arduino' was not declared in this scope <br>Instructable:81: error: expected unqualified-id before numeric constant <br>Instructable:82: error: 'lastFired' was not declared in this scope <br>Instructable:84: error: 'lastFired' was not declared in this scope <br>Instructable:85: error: 'arduino' was not declared in this scope <br>Instructable:85: error: 'Arduino' was not declared in this scope <br>Instructable:85: error: expected unqualified-id before numeric constant <br>Instructable.pde: At global scope: <br>Instructable:96: error: variable or field 'drawWaveForm' declared void <br>Instructable:96: error: 'AudioSource' was not declared in this scope <br>
<p>Was your problem ever solved if so how?</p>
<p>Its so coool.But it is acting different than yours.Mine is lighting up but just opposite of yours.My leds turn off instead of lighting up when it should.Why is that</p>
I know this is kind of an old instructable but I was hoping I might get some help. Ive got everything installed and the visualizer window pops up, but the led's do nothing. It worked on another computer but doesn't want to run on my laptop. Any ideas?
<p>Well, @jweeks3, is the audio input set correctly on your computer? I ran intto the same problem before.</p>
Has anyone tried to do this was a wave shield?
Ok problem solved
Ok so my input source is my internal mic on my Mac. Any help appreciated!
Oh, PS I am using this for everything that comes out of my system
This is so awesome!!
Awesome! Thank you pablopeillard
Im getting these errors: <br>Stable Library <br>========================================= <br>Native lib Version = RXTX-2.1-7 <br>Java lib Version = RXTX-2.1-7 <br>Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy <br> at cc.arduino.Arduino$SerialProxy.(Arduino.java:119) <br> at cc.arduino.Arduino.(Arduino.java:168) <br> at cc.arduino.Arduino.(Arduino.java:152) <br> at sketch_121117a.setup(sketch_121117a.java:73) <br> at processing.core.PApplet.handleDraw(PApplet.java:2103) <br> at processing.opengl.PGL$PGLListener.display(PGL.java:2595) <br> at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:189) <br> at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:177) <br> at javax.media.opengl.awt.GLCanvas$DisplayAction.run(GLCanvas.java:928) <br> at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:425) <br> at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364) <br> at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:827) <br> at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:415) <br> at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:515) <br> at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248) <br> at sun.awt.RepaintArea.paint(RepaintArea.java:224) <br> at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:308) <br> at java.awt.Component.dispatchEventImpl(Component.java:4729) <br> at java.awt.Component.dispatchEvent(Component.java:4481) <br> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648) <br> at java.awt.EventQueue.access$000(EventQueue.java:84) <br> at java.awt.EventQueue$1.run(EventQueue.java:607) <br> at java.awt.EventQueue$1.run(EventQueue.java:605) <br> at java.security.AccessController.doPrivileged(Native Method) <br> at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) <br> at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) <br> at java.awt.EventQueue$2.run(EventQueue.java:621) <br> at java.awt.EventQueue$2.run(EventQueue.java:619) <br> at java.security.AccessController.doPrivileged(Native Method) <br> at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) <br> at java.awt.EventQueue.dispatchEvent(EventQueue.java:618) <br> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) <br> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) <br> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) <br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) <br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) <br> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) <br>Already called beginDraw(). <br>Exception in thread &quot;Animation Thread&quot; java.lang.RuntimeException: java.lang.IllegalAccessError: processing/core/PApplet$RegisteredMethods <br> at processing.opengl.PGL.requestDraw(PGL.java:1021) <br> at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1526) <br> at processing.core.PApplet.run(PApplet.java:2006) <br> at java.lang.Thread.run(Thread.java:662) <br>Caused by: java.lang.IllegalAccessError: processing/core/PApplet$RegisteredMethods <br> at cc.arduino.Arduino$SerialProxy.(Arduino.java:119) <br> at cc.arduino.Arduino.(Arduino.java:168) <br> at cc.arduino.Arduino.(Arduino.java:152) <br> at sketch_121117a.setup(sketch_121117a.java:73) <br> at processing.core.PApplet.handleDraw(PApplet.java:2103) <br> at processing.opengl.PGL$PGLListener.display(PGL.java:2595) <br> at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:189) <br> at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:177) <br> at javax.media.opengl.awt.GLCanvas$DisplayAction.run(GLCanvas.java:928) <br> at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:425) <br> at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364) <br> at javax.media.opengl.awt.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:945) <br> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199) <br> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646) <br> at java.awt.EventQueue.access$000(EventQueue.java:84) <br> at java.awt.EventQueue$1.run(EventQueue.java:607) <br> at java.awt.EventQueue$1.run(EventQueue.java:605) <br> at java.security.AccessController.doPrivileged(Native Method) <br> at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) <br> at java.awt.EventQueue.dispatchEvent(EventQueue.java:616) <br> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) <br> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) <br> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) <br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) <br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) <br> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) <br> <br> <br>Does that mean something is wrong with my arduino library? <br>Any help would be greatly appreciated
https://github.com/pardo-bsso/processing-arduino
Wow! That's one of the coolest things ever made with an Arduino! But I have also found this site which has detailed instructions on how to make a simple Arduino LED music visualizer. Its also pretty cool and dead simple:&nbsp;<br> <br> <a href="http://gallactronics.blogspot.in/" rel="nofollow">http://gallactronics.blogspot.in/</a><br> <br> It can be of great help for amateur Arduino geeks. :P<br> <br>
Hi, great jobs. Could you tell me which are the transistors that you used before the leds?
Any NPN transistor that can handle the current will work - I think I used 2n2222s, but really anything should work.<br><br>If you want to experiment with fading the LEDs or doing any kind of PWM you'll need to use something more heavy-duty - transistors and MOSFETs dissipate a lot of power while switching, and it's easy to burn up little signal-level transistors like the 2n222.
tanks a lot :)
I was wondering if it was possible if there was a way to eliminate the computer and have the arduino react to a connected microphone. I kind of plan on making something similar but more portable. I dare say,even wearable.
Absolutely! As I said somewhere in here (I think), this project is completely overkill. When the summer residents in my dorm trashed the old system I rebuilt the controller with something like&nbsp;<a href="http://www.instructables.com/id/Nixie-Tube-Music-Visualizer/" rel="nofollow">http://www.instructables.com/id/Nixie-Tube-Music-Visualizer/</a>&nbsp;to get rid of the computer and make it a completely analog system. &nbsp;The basic idea would be to use a set of band-pass filters to isolate specific frequencies from the microphone input, rectify and time-average each of those frequencies to get a somewhat steady voltage, then use that voltage (potentially buffered or amplified) to drive your lights.<br> <br> Alternatively, if you're good with microcontroller programming, you could set up the FFT to run only on the Arduino (or some other controller).<br> <br> If you want to go the analog route, having an oscilloscope handy is VERY useful for identifying the pass-frequencies of your filters and figuring out the necessary gain on the amplifiers.<br> <br>
Is it possible you can upload a higher resolution of your set up on to the site.....ive been trying to get this to work for hours but your description along with the images posted are extremely gauge for beginners like myself. I followed every instruction to the T and my result is the LEDs not lighting up nor responding to the music being played. I have the proper transistors, ground setup, pin setup, and external power source positive lead to the outer positive power rail and the negative lead to the negative rail of negative less. Im really lost at this point.
Unfortunately this setup doesn't exist anymore, so I can't get any better pictures. &nbsp;Can you identify more specifically where your problem is? Try uploading the basic &quot;blink&quot; sketch to the Arduino and seeing if you can get the LEDs to light that way - if they don't, the problem is in your circuitry, and if they do, the problem is in the Arduino.<br> <br> Let me know the results and we can continue debugging from there.
really cool
Wow this looks amazing! Could anyone point me in the right direction if i wanted to do this of the inside of my pc? any help would be great because i have little experience :)
nice project! i have one question though. how bright were those leds? like in terms of mcd. thx
hey this is a great project but I had to go the long way around to get it to work<br>1. had to make processing libraries folder(this was hard to find a good answer to to fix the lost cc.arduino library)<br>2.update the java TX/RX file<br>3.change the com port in your processing file<br><br>but all in all its pretty cool
This Is amazing! It would be a super cool dance floor too. but reinforcing might raise the price smidge.....
After much re-organising i'm just a couple squares away from finishing my own version of this :) Great instructable and explained well enough for a beginner to figure out. I recommend using music with a very strong beat such as Pendulum, Skrillex or Benny Bennasi, looks great. If anyone has any questions feel free to message me (odds are I had the same problem at one point or another :/ )
I've got everything connected, power is going to the LEDs, but I cannot get them to respond to the music. I've uploaded the standardfirmata to my arduino and your processing sketch and changed the pin values to my own pin values. Help please? I have no idea what could be wrong
just to be sure... in order to use this? i would need to have the computer running at the same time? is there a way i could make one without having to use my laptop?
I got it up and running, but the lights will flash randomly when no audio is being played. when music dose play the visualizer shows the audio wave form but the lights still just blink randomly. do you know what the problem might be?
For a start, try upping the &quot;tol&quot; value - beatDetect doesn't have any kind of thresholding, so it still reports beats even when the only signal is random noise on the line. I put in &quot;tol&quot; to ensure there's a minium signal strength for the lights to fire.
Definitely one of the coolest ibles I've seen thus far!<br><br>How would you set the frequency for each specific LED? I want to build something like this mainly to learn a bit about arduino and electronics in general but with more of an equalizer feel. Saying that is there anyway to have LED's respond to volume as well. For example if they were in a stack the bottom one would almost always be on and the top would only light when the music is clipping?
Sorry i just read the comment about different pins responding to different frequencies (0 is the lowest, 25 the highest yeah?). Still curious about volume or if some LED's can be made more sensitive
Hey! I think out of the box the Minim libraries don't give you access to specific frequencies or input levels; that is, I don't think you can add a few lines of code within my sketch to get a volume level or define frequencies. <br><br>However, you can go digging around in the Minim library files to figure out exactly what they're doing. I've moved on to a new laptop since writing the Instructable and don't have the library handy, but I do remember finding the declaration of 26 FFT bins and where the variance was calculated. It's possible that there are just undocumented commands to read the bin levels, or it should be easy enough to write your own.<br><br>Essentially: it's all in the library code! Once you're able to read the volume level, the display gets a bit trickier - you're essentially talking about a 2-dimensional LED display, which can require a lot of output pins. There are tons of instructables floating around about controlling displays (like http://www.instructables.com/id/LED-matrix-using-shift-registers/) so I'd say look around, mess around, and see what you can come up with.
I know there hasn't been any comments in here for a long while, but I was wondering if there was anyway I could configure this to work with a common anode LED. As of right now my lights are inversed with this program; that is, when there's no sound all LEDs are on.<br>Thanks.
Hey! Sorry I've taken so long to get back to you - grad school has sort of kept me busy. I'm not sure I understand the problem - if you have a bank of LEDs with a common anode (the side where current flows in), those should work as is in the circuit. <br><br>If you have a common cathode LED bank, you should be able to substitute PNP transistors and rearrange the circuit - connect the transistors between +5V and the LEDs, with the common cathode connected to ground. You may run in to trouble if you try to use +9 or +12 volts - I haven't used PNP transistors in a while but I think you can run into problems if your emitter voltage is much higher than your control signal. Then again, I may be getting confused with MOSFETs, so you may as well try.<br><br>Let me know if this helped (or if you've given up in the month I took to reply).
Ok, so its been quite a trip, but im almost done putting this all together, haha. And im very impressed so far. Sadly, i just wired my breadboard like the picture shows, and using a test script i found that the transistor is doing the opposite of what i want. When the LED is supposed to be off, it turns on, and vice versa. Any idea why that is?
It is probably way too late for this, but if the transistor is doing the opposite of what you are desiring (which would be the case for a PNP), you could plug in the output to the other side of the transistor (in the picture above move it from the left side to the right side of the transistor). The transistors are set up in a leader-follower stage [the output is on the emitter side (left side)], for a PNP the collector and the emitter are switched. This means that you could just move the output wire over.<br><br>
I believe you may have gotten PNP transistors instead of NPN ones, but the wisdom of the crowd should definitely check me on that one.
Ugh, yep youre right. Looks like im taking another trip to radio shack, haha. Thanks :)
I always seem to get errors saying I am missing packages, I actually think this is a problem with me being able to download .zip archives, since I get the same thing when downloading the libraries from the Arduino website for the Mega (library folder empty) but does anyone else need to add the Arduino library before they can run this?
when the processing sketch is running without arduino it works pretty fast, when arduino is up and running there's a delay on the equalizer and on the leds. is there a way to improve this ? any code optimization or hardware (external dedicated soundcard) ? This is what I'm getting: http://www.flickr.com/photos/xdgx/4877732548/ Thanks!
Got it to work, forgot to change the port# @ arduino = new Arduino(this, Arduino.list()[1]);
Hello! I ran the instructable.pde fine, I can see the 2 &quot;lines&quot; moving to the sound, but the LEDs don't light up. I've already uploaded the firmata. Is there something I'm missing ? Thank you in advance!
Hi, I really like this project and am trying to recreate it but I was wondering what you used to house the LEDs. What are those rounded inset squares you are using? Thanks!
The big squares separated by black in the image on the first page are the squares of the waffle ceiling in my dorm (<a href="http://drywallbuilders.com/subpage.html" rel="nofollow">http://drywallbuilders.com/subpage.html</a>), while the littler glowing cubes are paper lanterns I used to diffuse the LEDs (<a href="http://www.instructables.com/id/party-paper-lanterns/" rel="nofollow">http://www.instructables.com/id/party-paper-lanterns/</a>).
i keep getting the error &quot;variable or field 'drawWaveForm' declared void in function 'void setup()': in function 'void draw()': at global scope: bad error line: -3&quot;<br /> <br /> any suggestions?<br />
&nbsp;Same here.. did you debug it?

About This Instructable

89,368views

168favorites

License:

More by SecondTwo:LED Dance Room 
Add instructable to: