New to Arduino - Looking for help with component selection

Thread Starter

Cralis

Joined Mar 31, 2019
6
G'day all.
I'm a total novice to electronics. I'm a software developer, but not C/C++ (C#).
I'd like to try create something and am working out what (As in, I have no idea, but to make a light come on would be a great start!)

My plan is the typical weather station.
I've ordered a Freenove clone of the Arduino Uno R3. It comes with some items, some of which will be useful in my rather (for you guys) boring quest.

My goal is the have
  • the Temperature, Air Pressure and Humidity displayed on the LCD
  • a potentiometer connected where I can set a 'Warning' temperature value
  • which will light a red LED lit when at or above the warning temp
  • a green LED is lit when the temp is below the warning temp
What I have is the Arduino board, and a kit that has:

Red LED x4
Green LED x4
Blue LED x4
RGB LED x 1
220Ω Resistor
1kΩ Resistor
10kΩ Resistor
Potentiometer
Push Button
1N4001 Diode
NPN Transistor
PNP Transistor
2xAA Battery Holder
L293D
74HC595
Active Buzzer
Passive Buzzer
Thermistor
Photoresistor
Relay
Motor
Servo
HC-SR04 ultrasonic ranging module
LCD1602 Display Module
RC522 RFID module
IC Card
Key Fob
Breadboard
Jumper Wire M/M
Jumper Wire F/M
Resistor Color Code Card

I think I need to order a BME280 which will supply my temperature, humidity and air pressure values.
From what I have read, that works well with the arduino, and is pretty accurate.
It seems I can get one in either 5v or 3.3v - Not sure which to go for. I'm not sure.
It also seems you can't get them with the header pins soldered on. Bad for me, as I don't know how to solder. Anyone aware of a cheap supplier of the BME280 with header pins soldered?

Is there anything else I may need to achieve my stage 1 goal?
(Stage two would be to somehow be able to get the data somehow onto a webpage, but that's wifi... and a whole load of things I don't think I'm ready for)

Any help and advice would be great. I'm really new. Trying to work out why you need a resister for a LED. That's how green I am.
 

MrChips

Joined Oct 2, 2009
30,708
Welcome to AAC!

You've come to the right place.
Sounds like you jumped into the ocean and don't yet know how to swim.
You gotta dip your toes in the water and get your ankles wet. It's a long ways to go yet before you learn to tread water.

Get yourself a DMM (digital multi-meter) and a soldering iron.
Learn how to use both. You will need those skills.
 

MrChips

Joined Oct 2, 2009
30,708
Your first project ought to be:

Connect a resistor and LED to a 9V battery. Use your DMM to measure voltage and current.
Use your math skills to verify that Mr. Ohm was right.
 

ScottWang

Joined Aug 23, 2012
7,397
The LED is a current working components, so you need to limit the current for LED, that's why you need a resistor to do the job to avoid too much current flows through the LED, too much current will blow out the LED, before you use the LED you need to know how much current that LED can afford it.

You can learn very basic EE knowledges from -- https://www.allaboutcircuits.com/textbook/
 

dendad

Joined Feb 20, 2016
4,451
Welcome to the wonderful world of electronics. It is so much easier to get fun things going nowadays.
You will need tools.
I would recommend a multimeter like the AN8008
https://www.amazon.com/Digital-Mult...words=an8008&qid=1554093891&s=gateway&sr=8-10
There are others in the series too. AN8002 and AN8004.
These little meters are very good for the $$$. You can buy cheaper but I doubt you will get better for the price.
Then some reasonable side cutters.
And a temperature controlled soldering iron. (Make sure you wear safety specs when soldering, and wash your hands afterwards.)

The Arduino is a great way to get going. If you need a book, Google "ASK Manual". It is a bit old now, but still pretty useful. This was produced to go with an early Arduino Starter Kit (ASK).

As well at the tutorials here, https://www.allaboutcircuits.com/education/ I quite like...
http://www.learnabout-electronics.org/

I've used the BMP180 for air temp and pressure but not the later ones.

Enjoy your learning :)
 

Ya’akov

Joined Jan 27, 2019
9,069
Hello! Welcome to AAC and a great hobby.

You've gotten plenty of good advice so far, I want to add mine for what it's worth.

First of all, tools are very important but even before you've received them you can do quite a bit with your breadboard. The DMM will be immediately useful, soldering iron, cutters, and the like will be essential later.

Because you are familiar with programming, it offers a basis for some heuristic analogies that shouldn't be overextended but could be very useful as a starting framework.

You can think of the DMM as a domain specific debugger. It will allow you to test parts of your circuit to ensure the inputs and outputs are what you expect.

In analyzing circuits and the functions of components, you can think of passive components (resistors capacitors, inductors, etc.), individually, as something akin to statements. That is, they have a function in the circuit depending on what and where they are, and they can be roughly understood the way you understand program flow. A circuit is what it sounds like, a loop. It must complete that loop to operate, this is an invariant rule.

Active components, like transistors, ICs, and the like, are more like subroutines. They do something with inputs that are active. They ca switch, amplify, and do basic things, or in the case of ICs, do a lot more such as run your programs.

So, in the case of your LED needing a resistor, this comes about because your circuit needs to solve the problem posed by Ohm's Law (this is an intentional inversion of the usual view, tailored to this heuristical approach). Ohm's Law states:

E = I/R

Where E is voltage in Volts, I is current in Amps, and R is resistance in Ohms. Your LED circuit, with no resistor has two if these numbers specified. (as an aside, be aware that every component you use, even wire will have resistance, capacitance, and inductance which may be important but usually isn't expect for the main function)

You have a Voltage source (say a battery) and the important specification of the LED which is the current it can handle in mA.

If you connected V (let's say 5V) to the LED which has a very low resistance, the current would be far greater than the ~20mA a typical LED is expecting. At this point, the magic smoke is driven out accompanied by a sickening "crack" sound and what may become a familiar and peculiar smell of LED death.

So, you need a resistor as a current limiter. Resistors drop voltage, so in my analogy you can think of the as a "reduce voltage" statement which modifies the value passed to the LED. Since, as you can see from the formula above, voltage coming out of the resistor is inversely proportional to the value of the resistor in Ohms, we can select an appropriate value resistor by calculation:

5V / .02A = 250Ω

It's that simple. The voltage drop will prevent the LED from being overpowered.

There are many more details, of course, and this way of thinking will only get you started, but I think it helps to see that circuit analysis can be a sort of analog programming activity and things you know about working out how programs are behaving can be transferred.

On the other hand, if you think of the as a ladder, when you get to the next level you will need to kick it away, don't try to haul it up there with you, it won't be so useful.
 

djsfantasi

Joined Apr 11, 2010
9,156
So, you need a resistor as a current limiter. Resistors drop voltage, so in my analogy you can think of the as a "reduce voltage" statement which modifies the value passed to the LED. Since, as you can see from the formula above, voltage coming out of the resistor is inversely proportional to the value of the resistor in Ohms, we can select an appropriate value resistor by calculation:

5V / .02A = 250Ω

It's that simple. The voltage drop will prevent the LED from being overpowered.
I usually totally agree with @Yaakov, but I think his reply needs a little more clarification; it’s a little more complicated. Just a tad. His answer is correct, but you should learn why.

It will work, since there is usually a little wiggle wiggle room in the current range over which an LED will operate, albeit with a difference in brightness.

So, the next thing you can learn about LEDs is a parameter called forward voltage (Vf). Let’s say for this example, that Vf for your LED is 2 volts. When calculating a current limiting resistor, you use Vf in the equation for Ohm’s Law thusly:

( 5 - 2 ) / 0.02 = 150Ω
if you used the 250Ω resistor, the current would be:

( 5 - 2 ) / 250 = 12 mA​

Not 20 mA.

This is less than the rated current of the LED. But, as I stated earlier, LEDs will operate over a wide range below the rated maximum. The lower current will crease the lifetime of the LED.

I’ve taken the time to respond with this explanation so that you can better understand how LEDs work. I suggest that you repeat my calculations with the actual specs of your device. Try different resistors on a breadboard, calculating the current for each and observing the LED.

Have fun.
 

Ya’akov

Joined Jan 27, 2019
9,069
I usually totally agree with @Yaakov, but I think his reply needs a little more clarification; it’s a little more complicated. Just a tad. His answer is correct, but you should learn why.
Have fun.
Perfectly correct, but to clarify, my explanation was intended as “wetting the sponge”.

The water runs off dry ones.

Thanks for adding details, though. It helps.
 

danadak

Joined Mar 10, 2018
4,057
For programming you can start with Ardublock or mBlock, they are
visual drag and drop Scratch like visual programming tools. The
nice thing about them is they produce C code (to feed to Arduino
IDE for compile and chip programming) which you can examine.

mBlock appears to have a broader support and active base of users.

http://blog.ardublock.com/engetting-started-ardublockzhardublock/

http://www.mblock.cc/

These tools are being used by kids across country to program basic
robots. And frankly are a real quick way of measuring and creating
a usable application.

In the case of mBlock it also bridges the Arduino board with Windows.
Eg. you can acquire data from Arduino, using its A/D or sensor, and
display in a windows environment. Don't be mislead by the panda symbol
displayed by mBlock, its a real useful tool, not just a kids toy. Same for
Ardublock.

Cool stuff.

Here is a simple ap creating a pulse train of various pulse widths and delays
between pulses.

https://forum.allaboutcircuits.com/threads/visual-programming.157949/#post-1370895

There is one other tool, flow code, that programs visually with a flow chart like
interface. Very capable, but costly. The other tools above free.

https://forum.allaboutcircuits.com/threads/flowcode.158101/#post-1372612



Regards, Dana.
 

Thread Starter

Cralis

Joined Mar 31, 2019
6
Hello! Welcome to AAC and a great hobby.

You've gotten plenty of good advice so far, I want to add mine for what it's worth.
Thank you so much for that great post, Yaakov! Really made things clear and understandable. Thank you. I've been reading the links people have posted, and it makes a lot of sense. The resistor part made a lot of sense. The part I need to work out is... "So, you need a resistor as a current limiter. Resistors drop voltage,"

So:

+ ----> Resistor -----> LED --------> -

Where + is a 5V supply... If the resister drops voltage, would that mean the + is putting out 5V, but the '-' only gets back (5V, less what ever voltage the resister dropped the voltage by)? I'm seeing it as water flowing. So 5V at the source (the +), and only (5V less what ever the resister did) at the destination (-). But the quote I posted also contains "resistor as a current limiter". That makes more sense. I assume, in the river of water, that's just slowing down the flow? Which would mean you have 5V at the source, and destination, but the flow (current) will be slowed down by the resistor? Meaning, you could do:

+ ----> Resistor -----> LED --------> -
OR
+ ----> LED --------> Resistor -----> -

Is that right?
 

Thread Starter

Cralis

Joined Mar 31, 2019
6
I’ve taken the time to respond with this explanation so that you can better understand how LEDs work. I suggest that you repeat my calculations with the actual specs of your device. Try different resistors on a breadboard, calculating the current for each and observing the LED.
Thank you, @djsfantasi - I certainly will. I have a DMM, but not a brilliant one, I fear. I got it a while back, and I think it's a AU$10 job off ebay. So not confident in it's accuracy.
 

MrChips

Joined Oct 2, 2009
30,708
We've seen/heard the water analogy used to explain electric current flow. This is the first time I have seen anyone use software as an analogy to current flow.

Both are flawed.

Explaining electric current flow is so simple why not discuss the real thing?

Take three resistors R1, R2, and R3 connected in series with a voltage source.
The only formula you need to apply is Ohm's Law,

I = V / R

The current in the loop is I.
The voltage across R1 is I x R1.
The voltage across R2 is I x R2.
The voltage across R3 is I x R3.

The sum of the voltages across each resistor must be equal to the voltage source V.

V = I x R1 + I x R2 + I x R3
V = I x (R1 + R2 + R3)

In other words, we can replace R1 + R2 + R3 with a single resistor Rs.

Rs = R1 + R2 + R3

Hence

V = I x Rs
or
I = V / Rs

End of story. No water analogy required.

 

Ya’akov

Joined Jan 27, 2019
9,069
We've seen/heard the water analogy used to explain electric current flow. This is the first time I have seen anyone use software as an analogy to current flow.

Both are flawed.
I tried to be very clear that the analogy was just a thinking tool to be abandoned after it did its job. The last two paragraphs called this out explicitly.

I know from my own experience that analogies are extremely useful if they are used to the extent they help model something and become a burden when extended beyond their utility.

I chose that analogy because of the OPs experience, I leave it to him to fill in the details, y reading posts like yours and corrections to mine like @djsfantasi’s, relying on his intelligence and sense.
 

Ya’akov

Joined Jan 27, 2019
9,069
Thank you so much for that great post, Yaakov! Really made things clear and understandable. Thank you. I've been reading the links people have posted, and it makes a lot of sense. The resistor part made a lot of sense. The part I need to work out is... "So, you need a resistor as a current limiter. Resistors drop voltage,"

So:

+ ----> Resistor -----> LED --------> -

Where + is a 5V supply... If the resister drops voltage, would that mean the + is putting out 5V, but the '-' only gets back (5V, less what ever voltage the resister dropped the voltage by)? I'm seeing it as water flowing. So 5V at the source (the +), and only (5V less what ever the resister did) at the destination (-). But the quote I posted also contains "resistor as a current limiter". That makes more sense. I assume, in the river of water, that's just slowing down the flow? Which would mean you have 5V at the source, and destination, but the flow (current) will be slowed down by the resistor? Meaning, you could do:

+ ----> Resistor -----> LED --------> -
OR
+ ----> LED --------> Resistor -----> -

Is that right?
The order of the components doesn’t matter in this case because the concern is the sum of everything in the circuit. It’s more like math than programming when it comes to passive components.

Remember, Ohm’s Law tells us that voltage and current are inextricably linked. So, for example, if we have a power supply that can provide any amount of current we need, 1V through 1Ω will get us 1A while 1V through .5Ω will get us 2A, etc.

To work this out in a real circuit (and yes, a circuit is the complete loop) we need to add up all the resistance no matter where they are in the circuit then calculate.

So the water analogy give you a quick and only slightly useful insight, my own analogy is about as useful, the math describes it exactly, and it’s not complicated once you have your mind focused on how it applies.

The explanations from other folks here are much more complete and precise, and I encourage you to work out what they are telling you.
 

Thread Starter

Cralis

Joined Mar 31, 2019
6
Thanks guys. I've tried to read up a bit. Ohms Law makes a bit of sense. What breaks me is when people say 'Voltage across the ...'. So I tried to create a virtual circuit... very basic... (Don't have my kit yet), and came across this rather awesome site. I created what I think will be my first attempt, and got it working quite simply.

https://www.tinkercad.com/things/05...=_PA8MN-MSkiKyToY-3CsCo8ak7-FY0s89Bg72RjfJrA=

But... I've put little annotations where I am confused.

5V power in, but when I measure "across" something, I'm not sure why I see 1.99V. I'm not sure what that is telling me.

V=2, R=300, so I = 0.006 something?

When I press the A on the multimeter, is say 16.7mA. Is that the current draw of the LED?
 

Ya’akov

Joined Jan 27, 2019
9,069
When measuring across a component, you are measuring the voltage drop across that component. While all the drops must sum to zero when you get back to the start of the circuit, each one will be it's proportional share.

Each drop is depends on the resistance, so you can, for example use E=I/R to determine the resistance of the DUT (Device Under Test) if you know E and I using R=E/I.

That 1.99V you are seeing is the voltage that results from the share of power consumed by the component as part of the circuit.

Does this help? I am not completely certain about the crux of your confusion.
 
Last edited:

Thread Starter

Cralis

Joined Mar 31, 2019
6
It does help, @Yaakov - That does help, a bit. I won't digress the point of my post, as it's kinda moved onto electronics 1-0-1 now. I'll maybe start a different thread, to try understand the "across a component". Thanks for the assistance.
 

MrChips

Joined Oct 2, 2009
30,708
Voltage across a component

It will pay for you to note that a voltmeter has two leads, a red lead and a black lead.
Voltage measured is always "across a component". It is not voltage at a component. (People sometimes do say this. I will clarify this in another post.)

Voltage measured is always a voltage difference between two points in a circuit. That is why you have two leads on the voltmeter.

It is the same as measuring distance between two places.
Asking "What is the distance at Melbourne?" makes no sense.
A proper question could be "What is the distance between Melbourne and Sydney?"
 

Thread Starter

Cralis

Joined Mar 31, 2019
6
Brilliant! That makes a lot of sense. When someone explains it like that - it’s makes it clear and now I feel stupid. :)
 

MrChips

Joined Oct 2, 2009
30,708
Current through a component

In contrast, current is always a measurement through a component.
Ammeters are usually protected by an internal fuse, typically, a ½A fuse.
It is common for newbies (and pros too) to blow the fuse at least once in their life.

Why does this happen?

The fuse will blow when you inadvertently try to measure voltage with the DMM set in the current measurement range.
It also happens when a newbie doesn't know how to take a current measurement.

In order to take a current measurement you have to break the circuit and insert the DMM leads to reconnect the break.
In other words, the ammeter is placed in series with a component.

Voltmeter goes in parallel with a component.
Ammeter goes in series with a component.
 
Top