1

First off, I'm very new to Arduinos and electronics in general, so feel free to explain like I'm 5.

As a bit of background to this question, the project is simply using a Pro Mini to run a servo, with a button to turn it on and off, and an led to indicate when it's on. To make sure I was getting the button right, I built the circuit on a breadboard with just the button and LED. The button was supposed to switch the LED on and off. It did not.

I removed the button from the equation and just tried to power the LED with the Mini. No go.

It's a blue LED, so the resistor (100) was chosen assuming a forward voltage of 3.3V and current of .02A. I've tested the resistor and LED combo with JUST the battery pack, and it lights up bright like it should.

I have a 9V battery running into RAW (I've also tried a 6V pack). I had pin 2 as an output with digitalWrite(HIGH), running into the resistor, then into the LED (+, long end), and then back to a ground pin. I've tried other ground pins on the board to make sure it's not that. I've switched pin 2 to analogWrite(255), still nothing. I have tried connecting it to VCC instead. Nothing.

However, writing HIGH to the onboard LED works fine, so I can see that the sketch is indeed running.

I've verified the LED polarity. I have tried a different Pro Mini. Nothing. It's a Pro Mini 328P according to the stamp on the back, which Google says runs at 5V and 16 MHz.

Please tell me what stupid mistake I am making so I can stop wanting to rip my hair out. Thank you.

7
  • 1
    Do you have this in setup()? pinMode (yourLEDpin#, OUTPUT);
    – CrossRoads
    Commented Apr 5, 2018 at 17:20
  • I do indeed: pinMode(2, OUTPUT); pinMode(ledPin, OUTPUT);
    – Don
    Commented Apr 5, 2018 at 18:12
  • If it doesn't even work with Vcc, then maybe the battery is dead. What voltage do you measure across it?
    – CrossRoads
    Commented Apr 5, 2018 at 18:16
  • Sadly, I do not own a multimeter, so I can't directly test the battery or arduino pins. Indirectly though, I don't think the battery is dead. It does power the LED in a simple circuit when the mini isn't involved, and when I hook up the mini, it powers on and starts running the sketch, as evidenced by the onboard LED behaving as expected.
    – Don
    Commented Apr 5, 2018 at 18:41
  • 1
    Thank you both though for trying to help.
    – Don
    Commented Apr 6, 2018 at 18:10

1 Answer 1

1

This was my mistake. I had attached the Arduino to the breadboard by pushing in the provided pin strips, and then putting the mini on top of those, assuming that since the pin was through the hole and looked to be touching, a connection was made. It wasn't.

Rather than continue to mess around with fiddly connections, I just took the plunge and soldered the entire thing to a circuit board. The LED and the button work perfectly as expected, and now I just need to attach the servo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.