Working w Data Pin

I am super new to Arduino and electronic projects so please bear with me on my noobie question

How can I tell if my Arduino board is outputting data through the correct pin? Would a multimeter be the way to check? Reason being, I am trying to run LEDs in my project and nothing is happening. I was thinking the LEDs were all burned out but when I plug them in, they all blink but then they turn off and nothing happens from there. I am just trying to run the adafruit led test sketch.

Also (here is where my noob shows) if the Arduino is plugged into my PC via USB, will the sketch on the Arduino still run automatically or do I need to power the Arduino through another power source to get the sketch to run?

Thanks!

How can I tell if my Arduino board is outputting data through the correct pin?

One obvious way is to use an LED ...

You can check the voltage on a pin using a multimeter but before you do that post your code here. The Arduino will start when it gets power from any source, including the USB.

puredark:
I am super new to Arduino and electronic projects so please bear with me on my noobie question

How can I tell if my Arduino board is outputting data through the correct pin? Would a multimeter be the way to check? Reason being, I am trying to run LEDs in my project and nothing is happening. I was thinking the LEDs were all burned out but when I plug them in, they all blink but then they turn off and nothing happens from there. I am just trying to run the adafruit led test sketch.

Also (here is where my noob shows) if the Arduino is plugged into my PC via USB, will the sketch on the Arduino still run automatically or do I need to power the Arduino through another power source to get the sketch to run?

Thanks!

First of all, hopefully you know that the LED should be current limited with a resistor before connecting it to an Arduino pin. A value of 220 ohms is a good value... connect it like this:

[b]
Arduino pin <--- 220 Ohm <--- LED <--- GND[/b]

When the pin is turned on (that is, "[b]pinMode (pin, OUTPUT); digitalWrite (pin, HIGH);[/b]"

The LED should light. Using "[b]digitalWrite (pin, LOW);[/b]" should turn it off.

You can also use a voltmeter to determine if the port/pin is working (if you suspect the LED is bad). Simply measure the voltage between GND and the pin. A "low" will be around 0 volts (but could be 0.5 to 0.8 or so), while a "high" will read around 4.3 to 5.0 volts.

Note that you do not need any resistor to use the voltmeter.

For your second question, the USB port will power the Arduino. You can also power it with an external power supply (a 9 volt battery connected to the barrel jack power connector, (plus to the center pin and minus to the shell) will work. Since the Arduino has a built in voltage regulator (transforming the 9 volts to the 5 volts Arduino needs), realize that the regulator needs a minimum input differential in order to work. That is, for 5 volts OUTPUT, the regulator needs at least 2 volts more than 5 in order to work. So, 7 volts is around the minimum, and 9 is even better.

You can actually put in as much as 35 volts DC into the external power jack, but since the regulator "skims off" the needed 5 volts and throws the excess away as heat, 35 volts input would make the regulator overheat in seconds. That's why I suggested 9 volts. 9 is enough to make the regulator work, without being SO high that the regulator burns up throwing the rest away.

Note that the Arduino has an automatic power switch-over circuit on board. If you provide external power AND also connect to USB, the Arduino will run using the external power. If external power is removed (or not used), it switches over to using USB power. The switch over is automatic. You can even repeatedly apply and remove external power and the Arduino will switch back and forth seamlessly, using USB power when needed.

Hope this helps.

I actually installed a 330 ohm resistor in line with pin 6 (pwm). Is there a visual way to tell if a resistor is burned out? None of my LEDs are lighting up at all so I was thinking perhaps it was something with the data connection to the LED strip. It is a strip of 50 ws2811 LEDs connected to a 5v 20a power supply, with data pin set as pin 6. I can post the code too if that helps. Thanks!

It is a strip of 50 ws2811 LEDs connected to a 5v 20a power supply

Do the power supply and the Arduino have a common GND ?

Please post the code and a circuit diagram. Hand drawn and photocopied is OK

UKHeliBob:
Hand drawn and photocopied is OK

"photograhed", perhaps. :slight_smile:

See this Image Guide

...R

puredark:
I actually installed a 330 ohm resistor in line with pin 6 (pwm). Is there a visual way to tell if a resistor is burned out? None of my LEDs are lighting up at all so I was thinking perhaps it was something with the data connection to the LED strip. It is a strip of 50 ws2811 LEDs connected to a 5v 20a power supply, with data pin set as pin 6. I can post the code too if that helps. Thanks!

I am new as well, and from a my (noob) perspective... Your volt meter can help with resistors too. I always double check a resistor before I install it with a volt meter. My eyes / brain do not compute the color bands correctly all the time. Your volt meter probably has a continuity setting as well. Which will tell you if the path you have the two probes at have a connection all the way through. However, read the manual of your meter first, because you make some measures with power on, some without, and some require you to have it in the circuit or you can burn the meter out.

puredark:
I actually installed a 330 ohm resistor in line with pin 6 (pwm). Is there a visual way to tell if a resistor is burned out? None of my LEDs are lighting up at all so I was thinking perhaps it was something with the data connection to the LED strip. It is a strip of 50 ws2811 LEDs connected to a 5v 20a power supply, with data pin set as pin 6. I can post the code too if that helps. Thanks!

Most Unos have an onboard led on pin13. If your code cab control it, code is ok.

If you have a controllable ledstrip it is a completely different story. You need to read the manual for it. Found a few 5V ledstrips at Adafruit complete with programming examples.

It is a Arduino Mega 2560 actually - and here is the circuit diagram. keep in mind that I did make a slight change - Arduino's web site made me weary of using the Mega's 5V pin as i saw stories of people burning out their boards when too much voltage is sent or the power supply spikes. (any creedence to this?) anyways, I connected power for the board into the Vin Pin instead. otherwise, the diagram is exactly how i'm looking to run the unit.

The HC-05 is a Bluetooth connection unit.

The LED strip is individually addressable ws2811 50 strip of them. I will post the code shortly. :slight_smile:

UKHeliBob:
Do the power supply and the Arduino have a common GND ?

Please post the code and a circuit diagram. Hand drawn and photocopied is OK

I posted the circuit diagram above. about the GND, I have the GND pin in the Arduino power area to the V- on the power supply. would that be a common ground?

here is the exact LEDs I have - I cannot seem to find this model on Adafruit. but I am still trying to use their tutorials to figure this out. Any more suggestions?

I guess this is a follow up on LED table Help needed! save my project! and you now want to check if your Mega is not blown up as well?

Follow @Krupsky's advise in reply #2. Depending on what you have, use a multimeter or a normal led plus resistor, not the led-strip with WS2811.

Write some code to test

void setup()
{
  pinMode(yourPin, OUTPUT);
  digitalWrite(yourPin, HIGH);
  delay(10000);
  digitalWrite(yourPin, LOW);
}

void loop()
{
}

It will give you 10 seconds HIGH (5V) that you can measure with @Krupsky's led setup or a multimeter followed by infinite LOW.

Your still supposed to give us your original code.

I'm not familiar with addressable led strips but wonder why you have a 330 ohm resistor; the fact that you show PWM in your diagram might indicate you do not understand how it works.

heere is the test code i was using..

// Simple NeoPixel test.  Lights just a few pixels at a time so a
// 1m strip can safely be powered from Arduino 5V pin.  Arduino
// may nonetheless hiccup when LEDs are first connected and not
// accept code.  So upload code first, unplug USB, connect pixels
// to GND FIRST, then +5V and digital pin 6, then re-plug USB.
// A working strip will show a few pixels moving down the line,
// cycling between red, green and blue.  If you get no response,
// might be connected to wrong end of strip (the end wires, if
// any, are no indication -- look instead for the data direction
// arrows printed on the strip).

#include <Adafruit_NeoPixel.h>

#define PIN      6
#define N_LEDS 50

Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
}

void loop() {
  chase(strip.Color(255, 0, 0)); // Red
  chase(strip.Color(0, 255, 0)); // Green
  chase(strip.Color(0, 0, 255)); // Blue
}

static void chase(uint32_t c) {
  for(uint16_t i=0; i<strip.numPixels()+4; i++) {
      strip.setPixelColor(i  , c); // Draw new pixel
      strip.setPixelColor(i-4, 0); // Erase pixel a few steps back
      strip.show();
      delay(25);
  }
}

i don't think my mega is burned out, i have been slow and steady with the power and using the regulated VIN pin to power it, just not sure how to test for sure my circuitry is working. also, like you said this is for the LED table, and the schematic is from there which i've done my best to construct. however, some other parts of the directions of this project listed by the poster have led me to believe some of them are quite incorrect and incomplete :(. do you think i should remove/replace the 330 resistor? love to hear your thoughts. Thanks for your help

If you want to make this be a separate thread for discussing how to determine if an IO pin on an Arduino has been damaged then maybe that makes sense but I see the discussion on this thread ending up duplicating your other thread's topic except without the necessary backstory. That just ends up wasting our time. So any discussion on wiring, code and determining functionality of the addressable LEDs which were exposed to 12 V should be continued at:
http://forum.arduino.cc/index.php?topic=459999

puredark:
It is a Arduino Mega 2560 actually - and here is the circuit diagram. keep in mind that I did make a slight change - Arduino's web site made me weary of using the Mega's 5V pin as i saw stories of people burning out their boards when too much voltage is sent or the power supply spikes. (any creedence to this?) anyways, I connected power for the board into the Vin Pin instead. otherwise, the diagram is exactly how i'm looking to run the unit.

The HC-05 is a Bluetooth connection unit.

The LED strip is individually addressable ws2811 50 strip of them. I will post the code shortly. :slight_smile:

You should have mentioned that you were using a strip of WS2811 addressable RGB leds.

Everything we've told you so far is applicable to ONE LED being powered by ONE Arduino pin.

The WS2811 strips require VERY precise timing in order to properly receive color and brightness data, as well as a very solid, well bypassed power supply.

Here's the comment block from my WS2811 driver code:

[b]/////////////////////////// WS2812B One Wire Timing ////////////////////////////
//
//          |<- 350ns ->|<---- 900 ns ---->|<-- 1250 ns total (25~)
//           ___________
//  0 code: |           |                  |
//          |           |__________________|
//
//
//          |<---- 900 ns ---->|<- 350ns ->|<-- 1250 ns total (25~)
//           __________________
//  1 code: |                  |           |
//          |                  |___________|
//
//
//          |<----- 5000 ns or more ------>|<-- 5000 ns total (100~)
//
//  RESET   |                              |
//  Code:   |______________________________|
//
//
// At 20 mhz, one clock is 50 nsec, so 350 ns=(7~), 900 ns=(18~) and 5000 ns=(100~)
//
/////////////////////////////////////////////////////////////////////////////////
//                                    MSB First!
//      |<-------- GRN -------->|<-------- RED -------->|<-------- BLU -------->|
// BIT:  23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
/////////////////////////////////////////////////////////////////////////////////[/b]

So, as you can probably see, you need a DRIVER LIBRARY in order to use your LED strip. You also need to RTFM before you can hope to get it working. Since I now see that you are using the Adafruit library, what's the problem? Read the documentation and connect it as they say and it will work.

You can basically disregard everything we told you in the past as it does not apply to what you're actually doing.

Krupski:
what's the problem?

See LED table Help needed! save my project! - General Electronics - Arduino Forum
@puredark connected the LED strip to 12 V. This is why it's such a problem to start a new thread when all this information was already written down in the other thread and answers provided.

pert:
See LED table Help needed! save my project! - General Electronics - Arduino Forum
@puredark connected the LED strip to 12 V. This is why it's such a problem to start a new thread when all this information was already written down in the other thread and answers provided.

It wasn't until the last few posts that I even realized he was using an addressable LED strip. The way the original post read, I thought he was trying to work with a single LED. Sheesh........ wasted all of our time.

Krupski:
It wasn't until the last few posts that I even realized he was using an addressable LED strip. The way the original post read, I thought he was trying to work with a single LED. Sheesh........ wasted all of our time.

It's just that I recognised the schematic as I participated in the other thread.

@OP
Are you still working with the potentially broken strip or did you use a new one?

My original post was about a project in which i did ask the question whether or not my strip could be burned out due to passing 12v through it. I have another set of LEDs on the way now that I am going to try out and my 12v power supply is gone. I also said "LEDs" in my OP on this thread and posted a test code in which 50 LEDs were clearly being addressed, so I don't know why people thought it was a single LED. It wasn't my intention to waste anyone's time, I posted some of these questions on the original thread and got no answers, which I figured was due to the fact my questions were more related to different issues not necessarily related to the original post.

Anyways, I have spent over $300 on this project and i was hoping someone here could help me save the project and possibly learn something in the process. feel free to visit my original post here, LED table Help needed! save my project! - General Electronics - Arduino Forum I'm not trying to hide that, I just figured that a post more specific to my exact current problem would yield more useful advise. I understand people losing their patience with me, I've said in the start of both posts i'm (obviously) not an electrician and a noob so please bear that in mind with some of the inquiries i may have.

So my question does still stand if anyone could answer it - will removing or replacing the 330 ohm resistor on the data pin going to the LED strip make any difference?

Krupski:
You should have mentioned that you were using a strip of WS2811 addressable RGB leds.

Everything we've told you so far is applicable to ONE LED being powered by ONE Arduino pin.

The WS2811 strips require VERY precise timing in order to properly receive color and brightness data, as well as a very solid, well bypassed power supply.

Here's the comment block from my WS2811 driver code:

[b]/////////////////////////// WS2812B One Wire Timing ////////////////////////////

//
//          |<- 350ns ->|<---- 900 ns ---->|<-- 1250 ns total (25~)
//           ___________
//  0 code: |           |                  |
//          |           ||
//
//
//          |<---- 900 ns ---->|<- 350ns ->|<-- 1250 ns total (25~)
//           __________________
//  1 code: |                  |           |
//          |                  |
|
//
//
//          |<----- 5000 ns or more ------>|<-- 5000 ns total (100~)
//
//  RESET   |                              |
//  Code:   |
_______________________|
//
//
// At 20 mhz, one clock is 50 nsec, so 350 ns=(7~), 900 ns=(18~) and 5000 ns=(100~)
//
/////////////////////////////////////////////////////////////////////////////////
//                                    MSB First!
//      |<-------- GRN -------->|<-------- RED -------->|<-------- BLU -------->|
// BIT:  23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
/////////////////////////////////////////////////////////////////////////////////[/b]




So, as you can probably see, you need a DRIVER LIBRARY in order to use your LED strip. You also need to RTFM before you can hope to get it working. Since I now see that you are using the Adafruit library, what's the problem? Read the documentation and connect it as they say and it will work.

You can basically disregard everything we told you in the past as it does not apply to what you're actually doing.

here are the LEDs I have, which I do not see listed on Adafruit. the product WS2811 on Adafruit is an actual flat strip of LEDs but i'm guessing they use the same Ws2811 chip, so I have been trying to use that documentation when available.

According to everything I've read, my circuit is correctly connected but they have not worked correctly once. I was thinking it could be due to the 12v power being run through the LEDs but I even read up on that. It seems like the heat would be the factor to burn out the LEDs, which didn't happen (they remained cool to the touch) and now when I connect them to my 5v power source, they all blink once and turn off. If they were completely burned out, would they blink at all? Either way, I have new LEDs coming (another $50 expense) and I want to make sure I do it correctly this time.

As for libraries, I was originally using code that called upon the Fast LED library which didn't work either. So at this point, I suppose I should wait for my new LEDs to arrive but I am still not confident the ones I have are completely burned out. If you want more info on the project, visit HERE. Even when it comes to woodworking, etc. this guy has had problems with his instructions so I'm really not surprised the same thing is taking place when it comes to the electronics. I am just trying to figure it out now that I have invested time, money and energy into this project and its too late to turn back now. If I wouldve known about these complications before, I probably wouldn't have even started but hey.. here I am. At the mercy of you good people :slight_smile:

Anyways, sorry for the rambling and thanks for your help.

Putting 12V power on a 5V LED strip will zap the parts for sure, and possibly the IO pin driving the control signal.

If you haven't already, write a simple sketch to toggle the questionable IO pin and see if it still toggles high & low okay with a meter, or with an LED/resistor.