Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
18

From page 411 of the ATmega328P data sheet, we have a graph of the output current vs voltage. We can see over the the 20mA range of output currents, we drop ~0.5V, giving an approximate internal resistance of 25Ω. A typical LED has a forward voltage of about 2V. Therefore, we end up in the situation where we will drop 3V over the 25Ω internal resistance ...


18

Your circuit is safe from the electronic viewpoint, so long as the LEDs used can withstand a back-emf of 4v or so. If only one LED is on at a time, all will be sweet. But if two or more are on, the brightness will drop and the brightness between LEDS will probably be inconsistent. The forward voltage drop of individual LEDS tend to vary a little, so one is ...


15

Can two LEDs attached to different pins share their resistor? can : yes should : probably not Your resistor act here as a current limiter, say to 3mA If you light one LED at a time, you give 3mA to that LED If you light 2 LEDs, you give 3mA for both of them (more of less 1.5mA each) If you light 3 LEDs, you give 3mA for all of them (on average 1mA each) ...


12

Leaving series resistors out will definitely greatly (exponentially) shorten lifetime of both the controller and the LED. Absolute maximum ratings for most AVRs are (a.o.): max. 40mA per GPIO pin max. 200mA per package. A new Arduino sets you back $20 or more, a fist full 220 ohm resistors sets you back 1$. When treated within spec, an Arduino (and LEDs ...


10

That resistor, where positioned, is called a pull-down resistor, and if replaced by a straight wire, that circuit would short out when the switch was closed. The purpose of this is that when a digital input pin is not connected, it floats, and if the switch were open that pin could see upwards of 2v floating value from external and internal noise. With ...


7

It means "Micro Controller" - you know it as "Arduino".


6

You're very close. The resistor is there to act as a pull down resistor; If the input pin is floating it is just an antenna picking up random static. The key is that when positive is supplied (by pressing the button) the positive source needs to "overwhelm" the pull down resistor so that the input pin reads positive. If there were no resistance, than the ...


6

They are what is known as Pull-Up resistors. The circuit will not work if you replace them with wires. Not only that but you will short circuit the power supply when you press a button. Why don't you want to use resistors? The value is not important - you could use the same value as you are using for the LED if you don't have the 10k resistors shown in ...


6

I see a couple of issues here, which are related to your questions. I will use numbers here, but these do not necessarily correspond to the numbers you have used when asking. The first thing you need to do when controlling a motor is to know it maximum stall current. The stall current is the current that will circulate through the motor (and through the ...


6

In general it makes little or no difference what the value of resistor you use is. The only things it can affect are: The current consumption while a button is pressed - a lower value resistor will cause more current to flow while for the time the button is pressed (it makes no difference at other times). The LOW voltage (VIL) read at the IO pin if the ...


5

If you are using the pin as an input in close proximity to the Arduino there is little reason to use an external pullup. There are a number of factors to consider. If the switch is some distance from the chip and/or in a noisy environment it will be more susceptible to interference as the internal pullups are high impedance (20kΩ to 150kΩ depending on ...


5

The claim “The cause it that your 3rd led (2nd element in the array) is reapeted twice” is wrong. Apparently that sentence is supposed to mean that the long delay is due to i being one too large, coming out of the first loop and entering the second one. Indeed, i is too large, but that's because each element of the array is a 2-byte int, so that instead ...


5

A resistor can only drop a certain voltage when there is a certain current - as you know from Ohm's Law. If you have resistance R and current I the voltage dropped is R×I. So if the current changes the voltage changes - and if the voltage changes the current changes. So what do we do? Well, we have one known fixed value, and that is the 5V from the GPIO ...


4

The cases where using a higher value resistor will damage a circuit exist, but are a bit less usual than the cases where it may simply produce a weaker result than desired, or a different frequency response than desired. The primary situations where you do have to watch out come about where "feedback" is used to adjust one thing in relation to something ...


4

Without the resistor, closing the switch would connect the positive supply directly to the negative supply. This would cause the voltage across all digital components in the circuit to drop close to 0V, crashing the whole thing.


4

150 Ohms may be "enough", but it's often still far too bright, so many tutorials keep a lower limit of around 10mA to help the LED live longer without affecting the application. You'll probably find that red LEDs are still visible at 1mA and a 330 Ohm resistor with a 5V supply will give about 8.5mA (assuming a 2.2V drop), which is plenty. It's really a "...


4

In the above circuit there are several other resistances that are being ignored for simplicity and because most of them are extremely tiny. However, one of the resistances is significant, and that it the internal resistance of the power supply. Without the resistor shown in the schematic, the internal resistance of the battery becomes the most significant ...


4

Roman, As I understand your question you have a resistor, an LED and a switch in "series". It makes no difference in which order these are connected. It may help to think like water flowing through a hose, with a tap being a switch - it can be at either end. "Current" flows through each in turn. As others have mentioned current conventionally is considered ...


4

Vdd on the DS18B20 is not connected to anything. According to the datasheet: When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground Connect 5V from the Arduino to both DQ from the DS18B20 and Port 2 on my Arduino (the two yellow cables). That means port 2 would always be high, right? According to Temperature Sensor ...


4

No, it doesn't matter. That resistor is just for the backlight LEDs. The larger the resistor the dimmer the backlight will be. As @VE7JRO suggests, you can always put two 330Ω resistors in parallel, which will halve the resistance to 165Ω, which will give a brighter backlight.


3

An important consideration is that the chip cannot necessarily source 20 mA on all output pins at once. In fact pins D5 to D13 on the Uno (PD5 to PD7, and PB0 to PB5) cannot source more than 150 mA combined. Thus the maximum you could source on those pins, if you are driving them all at once, is 150 / 9 = 16 mA. So, designing for 10 mA per LED is allowing a ...


3

You will definitely need resistors for each LED connected to MCP23017 circuits. This is necessary because without resistor the following is likely to happen: burn each LED that is lit on as it would be fed too much current burn the MCP23017 because it is rated for 125mA maximum (20mA per output pin) The resistor to use normally depends on the color of ...


3

I'm pretty sure that, despite the schematic provided, you will find that the 5V Pro Micro actually has a 5V regulator onboard. So even if you open the jumper, it will still be powering the Atmega32u4 at 5V (technically 5V minus diode voltage drop and regulator dropout voltage). You could change the regulator for a 3.3V one using a hot air station and solder ...


3

No. If you change the voltage to 3,3 Volt you also have to change the crystal to 8MHz and reprogram the ATmega32u4 to meet the new frequency.


3

No, it would not be correct to use a single resistor to replace a potentiometer. On an LCD the potentiometer is used to adjust the bias level of the LCD - that is the contrast. You need to use it to set a voltage between Vcc and Vee, which you feed into Vo. That is, a voltage somewhere between +5V and -5V. You can't do that with one resistor. You can, ...


3

The answer is: It depends what you want to use them for. You need a wattage that is higher than the power it will dissipate. What that power is depends on what you are doing with them. There are standard formulae that tell you the power in any given situation. For instance, if you know the current and the resistance you can use: P=I²×R. If you know the ...


3

Unless properly filtered, an LDR has a spectral sensitivity very different from the human eye, which makes it unsuitable for any kind of photometric measurement. It is also typically very loosely specified, so you won't know the illuminance it receives better than a factor two even if you measure its resistance very accurately. Thus, if you really need ...


3

You should connect the AVCC pin to VCC. From the datasheet (emphasis mine): AVCC is the supply voltage pin for the A/D converter and a selection of I/O pins. This pin should be externally connected to VCC even if the ADC is not used. [...] The following pins receive their supply voltage from AVCC: PC7, PC[5:0] and (in 32-lead pack- ages) PA[1:0]...


3

EDITED The Arduino loop() function makes the use of a while loop redundant in this case. Even worse: the way you've implemented that while loop prevents buttonState from being updated, thus getting stuck in the loop. What you actually need is to use timers to blink the LED, and a 2-state machine driven by HIGH to LOW button transitions. Try this instead: ...


3

As the OP explained in a comment, what he is trying to achieve is to have a button alternate between blink and off, not having the button to be pressed to shut down the led. This can be done in this way: bool prevButtonState; bool ledBlinking; void loop() { bool buttonState = digitalRead(buttonPin); if (prevButtonState && !buttonState) ...


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