Just bought my first Arduino. Im having issues with my power input.
When powered by my laptop my program runs correctly. When I power up using ac/dc adapter 9V 1A (Elegoo) the program runs correctly but the led is dim. This is a simple code using a HW-201 IR sensor and a led. The led is 20 ma with a forward V drop of 2.2 v, Im using a 140 ohm resistor. I get the same results when I plug the usb into a wall wart.
Lastly, if I plug the 2560 into my pc and then plug in the ac/dc adapter and then remove the usb from the PC it works. Weird? Any help will be greatly appreciated. Thanks
Yes, that sounds odd.
Could You draw a schematics and post? Something is overlooked in the description I feel.
Feeding with 9 volt is never good. It often makes trouble later because the onboard 5 volt converter has a very limited capacity.
Same old request…
Circuit diagram of how your reject is wired together
The only difference is that LED is connected to pin 13.
Why? Pin 13 is the on board LED driver. Considering that the problem remains a mystery, please post good close up photos of your actual circuit.
No particular reason. I've tried other outputs. Same issue. The on board LED is dim also.
Do you have any other Arduinos to test with? Also please don't hold back facts like that. We need to know everything. So does this happen with no external LED circuit connected, then? Does it happen with the IR module disconnected?
aarg
I have no other arduinos. removing either component form the board will show nothing. The IR sensor is high until its path is interrupted, then it goes low. The led doesn't turn on until the ir goes low. Ill try a simple PB sketch with the same led and see what happens. thanks
One other note, when the board initializes the led blinks twice at its full brightness.
What does your voltmeter read from GND to 5V pin when powered by your laptop? When powered otherwise?
Led works with PB input. Must be sensor. Ill have to do additional research.
JCA34F both read 4.96-4.97V
Does your sketch perhaps modulate the LED by turning it on/off so rapidly that you can't see it flashing? That would make it appear dim... we haven't seen your code hint hint...
Usual cause of a dim LED is failing to set pinMode to OUTPUT. Writing HIGH to an INPUT causes it to be INPUT_PULLUP with an effective 47k source resistance.
Oh, true, but then why does the power source make a difference?... in either case we need to see the entire sketch in code tags, please... or else:
We're catching up with this now... What happens when you run the Blink sketch?
It's super important to understand right now whether this is a software or hardware issue.
Here is my code. Ill try blink with and without the sensor connected.
int IRSensor = 2;
int LED = 13;
void setup()
{
pinMode; (IRSensor, INPUT);
pinMode; (LED, OUTPUT);
}
void loop()
{
int statusSensor = digitalRead (IRSensor);
if (statusSensor == HIGH)
{
digitalWrite(LED, LOW);
}
else
{
digitalWrite(LED, HIGH);
}
}
Ran blink no problem on ac/dc power supply. Added the sensor to the 5V still no problem. added signal line to pin 2, still no issue.
My guess, just a guess. The IR sensor is picking up AC flicker from the lighting, which turns it on and off. Thus the LED turns on and off at 50/60 Hz and appears dim.
Try covering the IR sensor. Have you "exercised" the sensor at all? Like, covered, pointed light at it, anything at all? Or, it's sitting idle on the bench?
I think it is overdue to see photos of your setup. I see that the sensor has an on board LED to signal a detection, thus it is possible to see whether it is working, independently of the Arduino (so long as the right voltage is supplied). What is it doing?
I've figured it out. I removed the ; after pinMode and the circuit works correctly.
Thanks for your help