Breadboard not connecting to Ground?

I am new to Arduino and got myself a huzzah32.
I connected it on a breadboard with a button and uploaded the pre-written Button program.
But it doesn't seem to work properly. The Huzzah32 itself work's (i atleast think so), i uploaded the "Blink" sketch and that worked.

The LED turns on if i touch a wire with my hands or a screwdriver or something else and turns off if i press the button

https://imgur.com/GlMGUa0 (sorry, it's up side down)

daksnursp's photo:

In the future please attach and embed images on this site following the tutorial here so that we don't have to go to an external site. When you do post links please use the chain links icon on the toolbar to make them clickable.

I see multiple problems here:

It appears you didn't solder the headers on the Huzzah32, they are just sitting in the holes. Is that correct?

The Button example (https://www.arduino.cc/en/Tutorial/Button) specifies a pull-down resistor connected to ground but you have no such resistor. Are you using the Button example sketch unmodified?

pert:
daksnursp's photo:

In the future please attach and embed images on this site following the tutorial here so that we don't have to go to an external site. When you do post links please use the chain links icon on the toolbar to make them clickable.

I see multiple problems here:

It appears you didn't solder the headers on the Huzzah32, they are just sitting in the holes. Is that correct?

The Button example (https://www.arduino.cc/en/Tutorial/Button) specifies a pull-down resistor connected to ground but you have no such resistor. Are you using the Button example sketch unmodified?

Ok thank's, noted.

No i didn't solder the headers on the Huzzah32, they are just sitting on it, that is correct. Am it required to do so? If so, i'll do it.
And yes, i modified the program so it would workout with the pins i attached it to. I tried to change the HIGH and LOW but it didn't work.

You need to solder the headers. You will not get a reliable connection with them just poked through the holes.

Did you read the comment in the Button sketch about how it's supposed to be wired? If so, why don't you have a resistor on your breadboard? It's very important to follow directions exactly. The resistor is important because without it the pin is floating when the button is not pressed. That means the pin could be HIGH, LOW, or rapidly fluctuating between the two depending on any electrical noise it's picking up from the environment. This is why you noticed it change when you touched it. You want the pin to always be at a know state whether the button is pressed or not.

If you don't have a resistor you might be interested to know that many microcontrollers have internal pull-up resistors that can be activated like this:

pinMode(pin, INPUT_PULLUP);

where pin is the pin you want to turn the internal pull-up resistor on for. Some microcontrollers even have internal pull-down resistors. I don't know about the ESP32 but I'm guessing it has the pull-ups on at least some of the pins. You can learn more about INPUT_PULLUP via this tutorial:

which goes along with the sketch File > Examples > 02.Digital > DigitalInputPullup
and the reference:

You can easily adapt the Button sketch to use the internal pull-up resistor but you will need to change your wiring so that the button is connected between the Arduino pin and ground instead of Vcc. Then you need to remember that the logic is changed. When the button is pressed the pin will be pulled LOW by the ground connection. When the button is not pressed the pin will be pulled HIGH by the pull-up resistor.

pert:
You need to solder the headers. You will not get a reliable connection with them just poked through the holes.

Did you read the comment in the Button sketch about how it's supposed to be wired? If so, why don't you have a resistor on your breadboard? It's very important to follow directions exactly. The resistor is important because without it the pin is floating when the button is not pressed. That means the pin could be HIGH, LOW, or rapidly fluctuating between the two depending on any electrical noise it's picking up from the environment. This is why you noticed it change when you touched it. You want the pin to always be at a know state whether the button is pressed or not.

If you don't have a resistor you might be interested to know that many microcontrollers have internal pull-up resistors that can be activated like this:

pinMode(pin, INPUT_PULLUP);

where pin is the pin you want to turn the internal pull-up resistor on for. Some microcontrollers even have internal pull-down resistors. I don't know about the ESP32 but I'm guessing it has the pull-ups on at least some of the pins. You can learn more about INPUT_PULLUP via this tutorial:
https://www.arduino.cc/en/Tutorial/InputPullupSerial
which goes along with the sketch File > Examples > 02.Digital > DigitalInputPullup
and the reference:
https://www.arduino.cc/en/Tutorial/DigitalPins

You can easily adapt the Button sketch to use the internal pull-up resistor but you will need to change your wiring so that the button is connected between the Arduino pin and ground instead of Vcc. Then you need to remember that the logic is changed. When the button is pressed the pin will be pulled LOW by the ground connection. When the button is not pressed the pin will be pulled HIGH by the pull-up resistor.

Thanks.
I didn't know about the tutorial's on this website. I watched a simple tutorial on YouTube to get started, that's why i was missing the resistor.
I now read the tutorial and did it with some trial and error. Pretty damn complicated if you're new and have absolutely no idea of this stuff (even harder if english is not your mother tongue).
Thank you man, very helpful!

daksnursp:
Pretty damn complicated if you're new and have absolutely no idea of this stuff...

Most beginners start with an Uno, and leave the complicated stuff for later.
You seem to want to learn to drive in a Lamborghini.
Good luck.
Leo..

Wawa:
Most beginners start with an Uno, and leave the complicated stuff for later.
You seem to want to learn to drive in a Lamborghini.
Good luck.
Leo..

Thanks, i might need it.
When i bought the Huzzah32 they didn't have the Uno in stock, so i decided to go with the Huzzah32 because it seemed interesting.
I am defintely going to get an Uno too.