Hello everyone, I have a problem with my current Bargraph project (Bar Leds).
For some reason unknown to me when I power my project in 12v I observe the following things.
On my red yellow and green LEDs, only the red LEDs light up with a low intensity then little by little they increase I usqua their max then the reds go Off to go to the turn of the yellows and the same process then red and yellow go turns on at max and finally with the green leds.
This whole process is too long and takes a good 20 minutes for the bar graph to light up at maximum intensity as desired...
I also observe that the current varies from 10mA on ignition and goes up to 20mA after 20 min when everything is on.
For me the ULN2803 limits the current, or a value somewhere takes time to increase I don't know...
Well that doesn't happen. But do you understand that the ULN2803 can only sink a signal and not source it. That is it will only connect an output to ground, or not connect it anywhere, depending on the input.
So in your "schematic" your LEDs are the wrong way round.
From what I see on the internet and from my tests the LEDs are in the right direction and still light up in my tests even if they take 20 min to light up completely ...
Pins on an Arduino default to being inputs, therefore what you are doing is simply toggling the pull up resistor of about 50K on an input, which would explain what you are seeing.
HI,
It sounds like another code that was written all at once and not in stages.
@remay66 did you write your code in stages?
If you did then you should have some code that JUST tests the LED output and display of one 2803.
If not, then write one and see if the problem is still present.
As @Grumpy_Mike and @6v6gt and @Wawa have stated you have no pinMode declarations for the outputs to the 2803s.
It is best to use the F() macro to conserve RAM but, on a Mega, you'll probably get away with out doing this. Serial.println(F("MCP2515 Initialized Successfully!")) ; // F() macro
I just have a question for my personal understanding, does it change if the pin of the arduino is in In or Output because you are talking about a 50K resistor ... and i want to understand.
I just tested and by adding the OUTPUT line in the setup my bargraph lights up correctly, I would never have found without your help for me the problem was electrical ^^
Inside the Arduino chip is a resistor of about 50K that is optionally connected to the chip's positive voltage. When a pin is set to be an input, or is an input because you have not set it to be an output, then this resistor is connected or not connected when you write HIGH or LOW to this pin. It is an input so you are not supposed to write to it in the first place. But if you do this is what happens.
So it looks like a very weak output.
Any pin you have not set to be an output will actually be an input and might appear to "work" but you will not get very much current drive through this 50K (or so) internal resistor.
Hence beginners often forget about setting pins to be an output and try and drive an LED directly from this pin and then complain about the LEDs not being very bright.