Arduino Tutorial 12: Understanding Potentiometers

Arduino Tutorial 12: Understanding Potentiometers

Paul McWhorter

5 лет назад

332,505 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@fredbarnes196
@fredbarnes196 - 23.12.2023 06:14

Why use the unfamiliar notation 5./1023. instead of the traditional 5.0 / 1023.0
Is there a reason?

Ответить
@MartinBriody
@MartinBriody - 01.01.2024 21:15

Two years ago got present of Arduino. Tried different on line lessons and eventually dumped the idea of learning coding. By accident I discovered your brilliant lessons and am now fully educated in coding up to lesson 12. Your are a brilliant teacher . Query on lesson 12 on reading voltage from potentiometer. You did not declare the input of the potentiometer in void set up. Keep up your brilliant lessons and I am looking forward to the rest of the lessons. Martin.

Ответить
@SaltanatAlisheva-q4v
@SaltanatAlisheva-q4v - 12.01.2024 21:02

Good day, Mr. McWhorter! I have a question regarding float numbers in your Serial monitor. I followed exact the same code that you shared in the video, however my Serial monitor prints numbers as they are integers. I would be more than happy if you could guide me on how could I fix it. Thank you for an amazing video! Absolutely loved and enjoyed it.

Ответить
@evaloarobertsdottir6956
@evaloarobertsdottir6956 - 23.01.2024 19:29

You are the best!! Watching from Denmark :D

Ответить
@ion4497
@ion4497 - 26.01.2024 11:58

VERY GOOD !!!!!

Ответить
@brightenpeer1356
@brightenpeer1356 - 09.02.2024 19:38

I’m afraid electricity baffles me. If the current through the first and second pin has to be constant at 0.5mA, where does the current for the third pin come from?

Ответить
@joesanford6284
@joesanford6284 - 22.02.2024 21:21

Good stuff

Ответить
@johnusg
@johnusg - 22.02.2024 22:43

Hi Paul - you're a credit to your profession. I am an IT Consultant having worked back in the days with AS400 COBOL to now Office 365 Development, C#, C++ (while ago now), Javascript etc. You have made this very easy to understand. I'm 54 and absolutely think I missed a trick not being an Engineer as opposed to a Computer Consultant. Always loved digital electronics. My father God rest him would of loved this. Greetings from Dublin!

Ответить
@johnusg
@johnusg - 23.02.2024 21:39

Paul - it's been driving me crazy. Your accent sounds so familiar. Guess who you sound exactly like........Owen Wilson.

Ответить
@ErlankBru
@ErlankBru - 25.02.2024 23:34

Sorry, the following is not on subject to tutorial 12. Pilot my Cockatiel is trying to sabotage my attention so I can shift it towards him instead of this lesson. He just doesn't realize that I want to learn Arduino code and components to help protect them (Pilot and Misty) from cats when I put them outside on the veranda, ;D LOL! ... One of my projects will be to have a speaker bark like a dog when the PIR picks up movement. :D Do we have to use (outdated) 2GB micro sd cards to work in a mini mp3 player module?

Ответить
@dylanhernandez4753
@dylanhernandez4753 - 10.03.2024 09:33

One of my "practice" projects for this lecture was also to include the current (I), Voltage(V), and also the current Resistance(R). That way, you can see the actual voltage and resistance on the serial monitor. The way I manage to read the resistance was first creating a variable with the current(I) then we apply Ohms law to get the Resistance(R), but the tricky part was to flip the values, why? Displaying those values will show you something like "5.00V at 10,000 ohms," that does not make sense, right? It should said something like "5.00V at 0 Ohms". To solve that, I subtracted 10,000 from our current value that we got using the Ohms law.

I hope this is useful to people who are interested in doing something similar, or at least that it can be used just as an idea.

Ответить
@boydmcree9085
@boydmcree9085 - 13.03.2024 22:23

I had already set up the led in the plim

Ответить
@boydmcree9085
@boydmcree9085 - 13.03.2024 23:11

divide by 2 mistake it should be 4 input from the potentiometers 1024 , the pwm output 0-255 it roles over to dim then bright a second time

Ответить
@bromsnor7852
@bromsnor7852 - 27.03.2024 22:21

You have to be sure that the 5Volt out the Arduino is really 5V. My Arduino gives 4.85 volt. So I change the formula into V2= (4.85/1023)*readVal and now it works fine.

Ответить
@decheek476
@decheek476 - 09.04.2024 04:16

love it so cool

Ответить
@rogerjones1701
@rogerjones1701 - 20.04.2024 19:13

Thanks Paul. I am looking to use this with a sliding potentiometer to build a throttle for my flight sim.

Ответить
@natalyvanderkeyl6324
@natalyvanderkeyl6324 - 29.04.2024 20:10

why don't you need to establish a pinMode (myVoltPin, INPUT) like you did in tutorial 10?

Ответить
@spacefentionz
@spacefentionz - 30.04.2024 07:57

You mentioned that you could use a potentiometer to dim an LED, so what I did was connect a resistor to the "voltage out" pin, then connect that to the anode to of an LED. I then connected another ground to the cathode of the LED, and BOOM (as you say), I can make the LED bright or dim!! Thank you so much for these videos! I am learning so much.

What I'm curious about is, in a previous video we used the analog write to vary the brightness of an LED using PWM. With this method that I'm using (using the potentiometer), I'm assuming this is no longer PWM, but a steady stream of voltage. Is that correct? I'm not quite understanding.

Thanks so much for the videos Paul!

Ответить
@MarvelBi
@MarvelBi - 10.05.2024 03:26

Only one question. When you are explaining the potentiometer, why do we use R2 to measure V Out. I don’t think I’m fully understanding the flow maybe because in my head, if the current flows clockwise then wouldn’t the space in between the resistors be r1?

Ответить
@chrisnizer
@chrisnizer - 25.05.2024 22:52

It's much easier for beginners to develop a basic understanding of electronics, circuits, components, etc, with the components in the kit. Without that the only thing we'd be doing with expensive/sophisticated electronics is breaking them.

Ответить
@ShahzaibAhmad-pg7mp
@ShahzaibAhmad-pg7mp - 01.06.2024 09:04

Iam also learning from your lectures Paul
(Pakistan)

Ответить
@chiyankwan611
@chiyankwan611 - 06.06.2024 15:54

No more coffee

Ответить
@hollz-m3q
@hollz-m3q - 21.06.2024 16:46

Can anyone explain why we don't have to set up the pin we're using as in input in the void setup before using it? i.e. pinMode(myVoltPin,INPUT);

Ответить
@zerostormrblx
@zerostormrblx - 24.06.2024 15:11

why R2 tho?

Ответить
@javisan6001
@javisan6001 - 03.07.2024 05:48

Las mejores clases, muchas gracias desde Guatemala, 64 years old guy learning from you!! thank you

Ответить
@Mr_Jonathan_Greer
@Mr_Jonathan_Greer - 09.07.2024 10:03

Im loving your videos. I want to do your robotics course with my son (7) but I decided to take your advice and start on this one. I love that you walk through a bit of Circuit analysis with it!

Ответить
@AmitKumarSaha-t5i
@AmitKumarSaha-t5i - 13.07.2024 12:28

Is it possible for you to make one video configuring pH sensor on Arduino?

Ответить
@amitsaha5247
@amitsaha5247 - 13.07.2024 21:40

Will it be possible for you to make a video on ph sensor calibration‽

Ответить
@victoriah3368
@victoriah3368 - 16.07.2024 17:22

Im not sure why you are saying Vout = I * R2 instead of Vout = I * Rt(total resistance)? And thus how you got that the 0-5 range? Could you please explain that?

Ответить
@zhenaustin2962
@zhenaustin2962 - 27.07.2024 04:29

ilovesyou

Ответить
@knunn552
@knunn552 - 16.08.2024 04:06

Paul drinks Folgers

Ответить
@dakonx7049
@dakonx7049 - 24.08.2024 15:35

Hi Paul, you peobably wont read this but thank you so much for what you did with this course. Im a cosplayer that makes mostly iron man stuff and ive always had to ask others for codes and help, but with this im getting the hang of it snd finally coding my own helmets. I cant wait for my kit to arrive, im working with components I have at home right now, to keep learning more. Thank you so much

Ответить
@AyyubxonShuxratbekov
@AyyubxonShuxratbekov - 10.09.2024 18:32

Do we need to write the code in which we set A2 as an Input?

Ответить
@iTeedo
@iTeedo - 12.09.2024 22:29

Updated Code:

int myVoltPin = A2;
int readVal;
float V2;
int delayT = 250;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
readVal = analogRead(myVoltPin);
V2 = (5.0 / 1023.0) * readVal;

// Print the result to the serial monitor
Serial.print("Analog Value: ");
Serial.print(readVal);
Serial.print(" | Voltage: ");
Serial.println(V2);

delay(delayT);
}

Ответить
@asdfrewqtyf
@asdfrewqtyf - 22.09.2024 16:18

Why there is no pinMode(myVoltPin, INPUT) ?

Ответить
@ReDoG129
@ReDoG129 - 26.09.2024 19:49

I'm from Barbados, and I must say, THIS CHANNEL IS A GODSEND prepping me for higher studies!

Ответить
@TheeFriskyy
@TheeFriskyy - 12.11.2024 14:31

Why did you not have to do a pinMode for this?

Ответить
@lakshmanrongali450
@lakshmanrongali450 - 13.11.2024 20:08

Here, i think pinMode(myVolt,INPUT); doesn't required

Ответить
@petersarfatis5737
@petersarfatis5737 - 28.11.2024 23:54

I love your lessons. I am 86 plus year old and I am learning a lot. My today’s question: while writing code the first part changes color ex pinMode, but not the second part ex OUTPUT, HIGH etc
Anything I am doing wrong. The code written still works

Ответить
@BeckhamDezdel-k4v
@BeckhamDezdel-k4v - 02.12.2024 00:47

i didnt have a potentiometer

Ответить
@BeckhamDezdel-k4v
@BeckhamDezdel-k4v - 02.12.2024 02:09

I used live simulations

Ответить
@Yash.Raj.Singhq
@Yash.Raj.Singhq - 04.12.2024 13:13

My potentiometer looks a little different but works identically

Ответить
@mikebowers7161
@mikebowers7161 - 05.12.2024 15:40

Thanks so much. I really appreciate the slow pace you go. Each lesson is enough to go away and practice. Thank you!

Ответить
@CSSivaguru-n1p
@CSSivaguru-n1p - 11.12.2024 08:42

Sir why you have not used pinmode here

Ответить
@Juka.23
@Juka.23 - 11.12.2024 19:57

Why did we not need to add a pinMode setup for A2?

Ответить
@dustinmcc8169
@dustinmcc8169 - 21.12.2024 08:51

Thanks for the tutorials! I am finally learning this stuff in a manner that makes sense. I do have a question though: why didn't we have to declare that pin A2 was an INPUT in the void setup? i.e.:
pinMode (A2,INPUT);
Thanks!

Ответить