Hot answers tagged

25 votes
Accepted

NodeMCU - Vin pin as 5V output?

There is confusion about what is and what isn't possible with this board. This is because there are different versions with different power arrangements. NodeMCU 0.9 In this board the USB's 5V and the ...
user avatar
  • 102k
23 votes
Accepted

What is an ICSP pin?

ICSP stands for In Circuit Serial Programming, which represents one of the several methods available for programming Arduino boards. Ordinarily, an Arduino bootloader program is used to program an ...
user avatar
20 votes

Is there a way to have more than 14 Output pins on arduino?

I2C (Wire) You can use the I2C protocol (Wire library) to connect to other devices such as port-expanders. For example, the MCP23017. I used one of those chips to connect to an LCD board. The ...
user avatar
  • 35.1k
17 votes
Accepted

What to do with Arduino floating pins?

The simplest thing to do is set them to INPUT_PULLUP. If you want a purely hardware solution then you could connect them to GND through some resistors (10kΩ or whatever you have in that kind of order ...
user avatar
  • 102k
16 votes
Accepted

What is the purpose of the I/O pin capacitor on the AVR microcontroller?

To make explicit the implicit parasitic capacitance on the pin.
user avatar
  • 2,680
15 votes
Accepted

NodeMCU - use flash button as input in loop()

The Flash button on NodeMCU is connected between io 0 and ground. You can use it as a button. Set pinMode(0, INPUT_PULLUP) and you will read io 0 LOW if the button is pressed. NodeMCU schema To ...
user avatar
  • 16.2k
12 votes
Accepted

Why does an Arduino UNO need two GND ports?

In electronics circuits, a major point in connecting two circuits and make them "talk" together is to ensure, at the minimum, that they have a common reference of voltage (typically called GND and ...
user avatar
  • 8,829
11 votes

Use all pins As digital I/O

The main issue is with pins 0 and 1. Many pins have multiple functions assigned to them, such as A4 and A5 are also the I2C pins, pins 10/11/12/13 are also the SPI pins, etc. But pins 0 and 1 are ...
user avatar
  • 102k
11 votes

Pin 13 fires relay when powering on... How to disable?

There are three things you can do: Remove the bootloader entirely and program the board with a hardware programmer (USB-ASP, Another Arduino, etc). Edit the bootloader source, recompile, and ...
user avatar
  • 102k
11 votes

How to use analogWrite() on multiple pins at the same time?

You have your parameters the wrong way round: analogWrite(2, 100); analogWrite(6, 200); However: pin 2 on the Uno cannot do PWM, so you will have to pick a different pin. Look for the pins marked ...
user avatar
  • 102k
10 votes

Use LED on pin 13 again after using the SD library

It is possible to use the LED on pin 13 again by disabling the SPI bus that is used by the SD library to read/write data to/from the SD card. To disable the SPI bus, simply call SPI.end() after ...
user avatar
10 votes
Accepted

Male header pins on Arduino Uno

These are the In System Programming (ISP) pins. They are used to program the microcontroller without using the bootloader. The bootloader is a program already loaded into the flash of the ...
user avatar
  • 3,042
10 votes
Accepted

How to get number of available pins in code?

It is quite easy actually: Serial.print("number of digital pins: "); Serial.println(NUM_DIGITAL_PINS); Serial.print("number of analog inputs: "); Serial.println(NUM_ANALOG_INPUTS); Note that these ...
user avatar
  • 36.2k
10 votes
Accepted

NodeMCU does not boot up when GPIO pin is high

Certain pins of the ESP8266 perform special functions at bootup. GPIO15, when HIGH, makes the ESP8266 boot from an SD card. You can read more about the special functions of the pins here. The ...
user avatar
  • 102k
10 votes

Is it possible to make normal pins act like ground pins?

No, it's not going to work - even worse, you risk frying your Arduino -, for the following reasons: The Arduino data pins can't source (neither sink) enough current for that to work. The inductive ...
user avatar
  • 2,092
9 votes
Accepted

What type of connector does the GROVE system use?

It looks like the Grove connector is proprietary. I emailed Seeedstudio, and they directed me to this datasheet. Unless I'm reading it incorrectly, it doesn't appear to correspond to any type of JST ...
user avatar
  • 1,517
9 votes
Accepted

How can I detect a disconnected pin?

The way to do this, since there is no digital value in between HIGH and LOW, is to actively create a signal on the pin you can recognise. Note that if the signal coming in to the pin is a datastream (...
user avatar
  • 102k
9 votes

Why are the pin numbers of the diagrams and of the code different?

Every chip datasheet (and also the Arduino boards) uses 2 different ways to refer to the pins: Counting the physical pins in the order as they appear on the chosen package of the chip Referring to ...
user avatar
  • 13.8k
8 votes

Why is my LCD 16*2 is not displaying any characters, although all the wiring is correct?

Recently I also faced similar problem, with connection as: 1=GND, 2=+5v, 4=11, 6=12, 11=5, 12=4, 12=3, 14=2, 15=backlight positive, 16=backlight negative Solution: I just connected VEE (pin 3) of ...
user avatar
  • 81
8 votes

What type of connector does the GROVE system use?

Here is the updated link on the seed website. http://wiki.seeedstudio.com/wiki/File:3470130P1.pdf Also note that Digikey now stocks seeedstudio stuff. http://www.digikey.com/product-detail/en/seeed-...
user avatar
  • 207
8 votes
Accepted

Can I damage an arduino by setting pins high with no load

Nope, you should be just fine. Having a pin set to any state while unplugged will not cause any problems with your microcontroller.
user avatar
  • 4,309
8 votes
Accepted

Best Header for Arduino Nano

The Nano boards that I have used all have pins on 0.1" (2.54mm) spacing. There are single-row female connectors that are designed to accept 0.025" square pins. One example is Samtec 32 position ...
user avatar
8 votes
Accepted

What's the benefits between different interrupts on Arduino

Imagine that you have the circuit below: simulate this circuit – Schematic created using CircuitLab Let's say that you wanted to catch the user pressing the button. The input signal will go ...
user avatar
  • 261
8 votes
Accepted

Uno pin 13 LED mysteriously always ON at 0.14V unless pinMode OUTPUT

The LED is driven by an op-amp (see the schematic). When the pin is configured as input the op-amp has an undefined input (floating input). Thus it may or may not turn on the LED. If you configure it ...
user avatar
  • 35.1k
8 votes

How many pins does this circuit (HMC5883L) use?

Below image is the answer to your question. According to this image, magnetometer required four pins of arduino. GND of magnetometer ----> Arduino GND Vcc of magnetometer ----> Arduino 3.3 Volt ...
user avatar
  • 1,468
7 votes
Accepted

Can I turn off a device using the 5V and analog pins?

You would use a transistor. Something like this would work. In this case the Arduino controls a transistor to drive a brushless motor. Source: Arduino Cookbook: (https://www.inkling.com/read/...
user avatar
  • 2,086
7 votes
Accepted

Why is my LCD 16*2 is not displaying any characters, although all the wiring is correct?

Check out this tutorial on Adafruit. It will walk you through setting it up. In the tutorial they change the pins, which I believe is the issue here. Here is a snippet. And change your pins: ...
user avatar
  • 1,128
7 votes

How to read pinMode for digital pin?

There are functions which can get you the registers and bit numbers from a pin number built into the Arduino API. uint8_t bit = digitalPinToBitMask(pin); uint8_t port = digitalPinToPort(pin); ...
user avatar
  • 102k
7 votes

How to read pinMode for digital pin?

Seems like the Arduino core is missing a function to read the pinMode(). Here is a possible implementation: int pinMode(uint8_t pin) { if (pin >= NUM_DIGITAL_PINS) return (-1); uint8_t bit = ...
user avatar
  • 7,811

Only top scored, non community-wiki answers of a minimum length are eligible