Tutorial 04 for Arduino: Analog Inputs

  Рет қаралды 679,648

Jeremy Blum

Jeremy Blum

Күн бұрын

Пікірлер: 387
@Grufian
@Grufian 11 жыл бұрын
You are an extraordinary teacher. I graduated from the RCA Institutes back when semiconductors were first appearing on the scene. The manner in which you present and clarify material is without peer. I hope to absorb everything in this series to the bitter end. Keep up the great work.
@ukalafina5218
@ukalafina5218 11 жыл бұрын
Considering how much crap there is on youtube it is amazing to come across a series produced so professional and knowledgable. Thank you! I wish I could pay for those videos I am watching but I don't know how.
@marciomaiajr
@marciomaiajr 4 жыл бұрын
Cant believe these videos are already 10 years old. Still one of the best series on arduino.
@xiongbeezo1983
@xiongbeezo1983 11 жыл бұрын
Finally someone that makes sense, keep it up. Don't shy away from repeating information, although your doing a great job doing that.
@sciguy14
@sciguy14 14 жыл бұрын
@pjharro I've had similar thoughts. My opinion on the arduino is that it is a good jumping off point - a great way to make something really cool, really quick. It certainly is not a production level solution. I think arduino should be used to test and refine a concept, then port it over to C code on an atmega when it's ready to be finalized into a product. It's a great way to get acquainted with microcontrollers if you are new to them. I use atmegas with C for serious research projects.
@sciguy14
@sciguy14 14 жыл бұрын
@BanthaFodd3r Very glad to hear that! Look forward to more.
@sciguy14
@sciguy14 14 жыл бұрын
@raghunitin No, it detects general ambient light. I have bright lights for filming, so I had to move my arm in close proximity to create a change. In general it will detect changes to light in the room.
@BanthaFodd3r
@BanthaFodd3r 14 жыл бұрын
Thanks a lot for this series, i've done a little theory behind simple electronics at school but have never really done anything in a practical sense with it. After buying an aduino board and looking around, I have to say, your videos are by far the most informative.
@ewalstad
@ewalstad 14 жыл бұрын
Just a thought: digitalWrite( ledPin, (abs(currentDist - lastDist) > thresh && lightVal < 800) ); although this is arguably less self-documenting, the logic seems more concise to me and easier to understand. Thanks for your video series, I'm enjoying them!
@sciguy14
@sciguy14 14 жыл бұрын
@billwesleypatrick this is a tutorial series aimed at beginners. Many people have asked me to explain things slowly, so that's what I'm doing.
@wiccawill420
@wiccawill420 11 жыл бұрын
The serial print line was used to determine what the board was reading from the photo-resistor. It made the arduino report directly to the computer what this output was. He used this info to make the program react to the range.
@electronash
@electronash 11 жыл бұрын
For anyone interested in starting with electronics, check out the falstad circuit simulator (just Google for "falstad circuit"). It's great to learn the basics from and play around with. Yep, great tutorials Jeremy! Some of the most complete vids on the Arduino, and you take the time to explain each part well.
@TheAngryJazz
@TheAngryJazz 12 жыл бұрын
This video inspired me to make my own project. I used a Ping))) sensor to get distances in cm and attached a led to indicate if objects came to close to the sensor. Good job on the tutorials!
@Bandicoot803
@Bandicoot803 12 жыл бұрын
The pin types are already pre-defined in the microcontroller chip and in its factory-burnt bootloader. The only thing you have to do is choose the correct pin number/type for your project schematics which is printed on the PCB. A=Analog, D=Digital, PWM=Pulse Width Modulation.
@francisdelacruz1099
@francisdelacruz1099 6 жыл бұрын
Your videos really helped me to understand how Arduino works and how to apply the basic concepts I've learned from school. Thank you!
@exforbrian
@exforbrian 14 жыл бұрын
This is great, I just learned about the Arduino last night and with this video and some others I now see the ease of programing and DIY progects, his "SLOW" expinations of this project was perfect for me, THANKS!!!!
@eduardo1984ism
@eduardo1984ism 11 жыл бұрын
I just want to thank you for your videos. I'm new to electronics/programming and these vids have been great for learning arduino!
@joechacon8874
@joechacon8874 10 жыл бұрын
This tutorial answered so many questions that I couldn't find in any of the Arduino Forums. Thank you.
@ataraxic89
@ataraxic89 12 жыл бұрын
Im so proud, after watching episode 3 I made a nightlight like in here, even put the pot on it so I could varry the light level manually without altering the code. I had no idea that was coming up lol
@sciguy14
@sciguy14 14 жыл бұрын
@bluemagictube I am hoping to do more, just taking a short break. Putting these out every week can get exhausting.
@yhwhdesigntruth
@yhwhdesigntruth 6 жыл бұрын
Firstly, thank you for all your teaching here. It is helping me get up and running very quickly. I am a web developer and coder so once I get a decent grasp of this I will be fine, but I do need some decent support to get me there. Maybe more that I would like to admit :) I am needing help with a project and if you could or anyone has the time to walk through this with me I would be so greatful! Here is my project : I need to take 12v from a total of 8 sources ( each has its own 12v wire and ground ) ( 4 left and 4 right ) I need to take that 12v and step it down to 5v. I have purchased (2) 4chnl opocouplers and I have a voltage stepper to bring my voltage down to 5v. What I want to do... the base of the project would be when pin "x" sees 5v it will tell pin "x" it has a signal and a loop will run until that signal is no longer there. This would apply to all four inputs. the advanced part of the project would be when multiple pins see signal it can run multiple loops at the same time. Real world application ( vehicle parking lights, brake lights, turn signal, and reverse )
@chain3519
@chain3519 9 жыл бұрын
If anyone was wondering about pull up resistors on inputs, you can set the pin mode to input_pullup to save yourself a resistors, only on digital inputs through.
@Ronitrocket
@Ronitrocket 6 жыл бұрын
can u elaborate, i'm not sure i understand.
@sciguy14
@sciguy14 14 жыл бұрын
@whisk0r Haha yeah... Had to rewrite and re-capture the arduino programs several times... I filmed enough content for 10 total episodes (6 more).
@ivanmunzrivera4266
@ivanmunzrivera4266 12 жыл бұрын
Pedro Santos, you can use the same code but the values obtain by the sensePin are probably going to be different from does in the video. So you need to first read from pin A0 to see what values you get and then constrains and map with does values. I hope I explained my self clearly.
@sciguy14
@sciguy14 14 жыл бұрын
@manutube8080 Either an electromechanical relay + a transistor and a flyback diode, or an opto-isolated solid-state relay. The panasonic AQG12105 electro mechanical relay would work. Be sure to power it from the arudino using a transistor (this will be shown in the next video). Also, add a diode from the negative to positive end of the relay.
@WebDesigneri
@WebDesigneri 13 жыл бұрын
@sciguy14 The device I'm working with is actually a cruise control actuator. It has some kind of a potentiometer / variable resistor in it, but I can't get the output voltage of the pot from any wire that's coming out of the device. There are 7 wires total. Two are for controlling the motor in the actuator, 2 are for a solenoid that locks the actuator arm and I can read a varying resistance value between 2 wires.
@sciguy14
@sciguy14 14 жыл бұрын
@11thtoe Yes, good call, using abs would make it more concise. Thanks!
@JasonFlowersX
@JasonFlowersX 12 жыл бұрын
You are awesome! The only comment I have is that in future tutorials it would be helpful to us newbies if you used standard color code for your jumper wires. Black for ground, red for positive and so on.
@pjharro
@pjharro 14 жыл бұрын
Part1: This is a great series Jeremy. One thing that seems stuck in my head. I have a strong backgruound in programming and would find C coding easy enough (although I havn't coded in C for a few years). When I see the Arduino boards I keep thinking it is cheating somehow, I think "some clever cookies have done all the hard work for me so making things with it is not as big an achievemnt"...
@NikolajLepka
@NikolajLepka 13 жыл бұрын
this made me make a bargraph, consisting of 6 leds, each with overlapping values.. showing me 11 different brightness levels, instead of just 2... in other words: very useful tutorials!
@RatCrapper2
@RatCrapper2 10 жыл бұрын
By the way... I love the videos you have posted!!! I have been surfing for a while, and these are the best so far. Thank you very much.
@alfonsoPina
@alfonsoPina 10 жыл бұрын
I really enjoyed this tutorial. very useful item. most tutorials don't have a back story and use for every day. this was cool. I'm gonna build one!
@sciguy14
@sciguy14 13 жыл бұрын
@WebDesigneri If it only have two pins, how is it being varied? You can set it up in a voltage divder circuit with a fixed value resistor, and use the output voltage to determine the value of your variable resistor.
@sciguy14
@sciguy14 14 жыл бұрын
@hardikvpandya We had a long back and forth after they saw my "building an engineer" talk. We eventually decided to work together to promote arduino.
@cmpollardjr
@cmpollardjr 12 жыл бұрын
Great job on the tutorials. I am very green and new in the MC world and your explanations really make sense. The sprinkling of basic electronics helps also. Now I know why you need the "pull down" resistors. :) Thanks again!
@samynashabeh
@samynashabeh 10 жыл бұрын
In 3:36 , it looks like the photo resistor is connected to GND and to 5V !
@fabse64
@fabse64 13 жыл бұрын
Finally a channel it's worth subbing to. Thanks for your tutorials!
@sciguy14
@sciguy14 14 жыл бұрын
@TheSaltysack Mega 2560 has the most functionality, but is overkill for most projects.
@elfboy0
@elfboy0 13 жыл бұрын
For the last example, since I don't have an infrared sensor, I used a pot. However, I found I had to add a "delay" command to the end of the loop, and lower the "thresh" value, to account for me turning the pot more slowly than the loop would cycle through. Otherwise, it worked fine. But I imagine a lot of viewers won't happen to have an infrared handy.
@snerkrabbledauber7032
@snerkrabbledauber7032 7 жыл бұрын
These tutorials are very helpful! Thank you for getting right to what people want to know without wasting any time babbling. Very nice!
@herrskittler
@herrskittler 11 жыл бұрын
Great video. Had to play with the sensor numbers a lot but it eventually worked fine.
@michaelmeisman4731
@michaelmeisman4731 5 жыл бұрын
I know this is an old video but you gave the best explanation I have found on how the input work. One question To be clear I cannot use a 12VDC input even if it is just used as a signal to trigger other actions from the Uno.?
@elainehoey2914
@elainehoey2914 10 жыл бұрын
great video tutorials ..!! wondering however, if you can show more of the entire setup of the breadboards for each exercise, Im a complete beginner(no knowledge of using breadboards) and having all steps initially will really help..but the best tutorials for Arduino that I have found so far,thanks
@greybruce714
@greybruce714 11 жыл бұрын
Thanks Jeremy. Glad you are spreading the word so well!
@FranticPress
@FranticPress 11 жыл бұрын
Jeremy is truly a great guy
@bluemagictube
@bluemagictube 14 жыл бұрын
Fur future reference when you have a camera view like that at 3:52 it is better to do some rotation of the board so we can see what is going on clearly. Excellent tutorials ! Shame you arent doing any more !
@HighFlyActionGuy
@HighFlyActionGuy 9 жыл бұрын
I wish I could like this more than once. You've been an incredible help and I only wish I could show enough support to repay the favor.
@sanjaysampat707
@sanjaysampat707 11 жыл бұрын
Very nice, I think v may use absolute function to detect absolute distance difference (Current distance - last distance ) and then compare it with threshold...
@whisk0r
@whisk0r 14 жыл бұрын
Good stuff Jeremy! Was this the episode during which the laptop blue screened? How many more did you manage to finish with your video binge?
@whisk0r
@whisk0r 14 жыл бұрын
@sciguy14 That is a serious amount of work! Great idea though (school). Our videos are more about what's happening 'today' so we can't work ahead like that.
@squiresuzuki
@squiresuzuki 12 жыл бұрын
There is a difference between photo resistor and photodiode (and photo transistor too). Look it up.
@sciguy14
@sciguy14 13 жыл бұрын
@Slench101 because you use the analogRead command.
@PaulWellner
@PaulWellner 3 жыл бұрын
Great job! Have been looking for this info for a couple days... Might need your help on a couple projects I'm working on. Being a newb it takes a lot of searching around since I know so little about coding. You do a great job of explaining things. I'll be taking a look at your other vids. Thanks!
@sciguy14
@sciguy14 14 жыл бұрын
@shebotnov NOt sure, possibly in the future.
@sciguy14
@sciguy14 13 жыл бұрын
@MrMimsicle You mean putting the brackets on the same line? I switch back and forth.
@arkanglegeibriel
@arkanglegeibriel 12 жыл бұрын
in the arduino IDE click Tools->Serial Port Monitor(or Ctrl+Shift+M)
@rsstorm1
@rsstorm1 5 жыл бұрын
Great job dude 🙂 this tutorial help me alot with program my ESP32 and rescue my fern
@stevethul1
@stevethul1 12 жыл бұрын
Excellent videos, you do a great job explaining the workings of all issues in each of your videos.
@RandyLin061
@RandyLin061 11 жыл бұрын
This tutorial is VERY useful for a rookie likes me for learning arduino. Thank you so mush.
@JazzDrummer101rocks
@JazzDrummer101rocks 10 жыл бұрын
much*
@francisroan
@francisroan 14 жыл бұрын
i just love the intro tune
@josephmojo123
@josephmojo123 12 жыл бұрын
Nice video, just wondering if it would matter if I used an R3 UNO instead of the R2 UNO you are using all the time, plus I would be very happy if you could post a tutorial on ultrasonic range finders as I can't work out how to use them at all, if you could leave a comment that would be great
@ahshohug
@ahshohug 12 жыл бұрын
Hi, your tutorials are really good and understanding.Is it possible to make a tutorial on controlling RGD LED using mic and arduino micro controller. Will really appreciate.Thanks
@soccer3564
@soccer3564 12 жыл бұрын
Have you ever messed with the teensyduino? I currently am using one to emulate keyboard strokes but am thinking about getting an arduino uno.
@Mystefier
@Mystefier 11 жыл бұрын
Awesome Tutorial. Question - The infrared proximity sensor, how wide of a rage does it check? I mean if someone is not standing directly in front will it detect them? Are there sensors that only detect if someone is directly in front of them like a very narrow beam detecting?
@jarrellestes1793
@jarrellestes1793 10 жыл бұрын
Great: This answers a lot of how to use an analog value in real life!!
@fabse64
@fabse64 13 жыл бұрын
But I've got a question: On the schematics you show, anything that's not connected to something goes to ground, which is minus, is that right? That means we're basically only working with plus, right?
@oblivion5683
@oblivion5683 11 жыл бұрын
i don't know. if you want to look up the datasheet for it. knowing how to find and read schematics for things will be a valuable resource if you ever want too do even hobbyist electronics. also just so you know this message isnt meant to sound hostile, i honestly do want to make sure you know how to read schematics.
@ieuanskinner9772
@ieuanskinner9772 11 жыл бұрын
Swap out the photoresistor for the thermistor and you've got a basic version of the room security from Sneakers.
@dylanm36
@dylanm36 12 жыл бұрын
An IR sensor probably won't reflect off of water. You could, however, just place a buoyant object on top of the water (sheet of plastic, foam etc).
@dubhealedlouiedawg
@dubhealedlouiedawg 13 жыл бұрын
Did you build the yellow robotic arm? or did you buy it anywhere? If yes to the latter, where can I get one?
@flyguynumber1
@flyguynumber1 10 жыл бұрын
This is another of your very excellent presentations. WELL DONE!!!
@Bosw0rth99
@Bosw0rth99 12 жыл бұрын
Great level of detail. Very informative series.
@cincyking
@cincyking 13 жыл бұрын
QUESTION!!! - - Hey I have an Ethernet shield and have absolutely no idea how to get started with it... What "project" would you recommend?
@ukiews
@ukiews 12 жыл бұрын
Do you have any experience with Stellaris ARM microcontrollers? I was hoping to use the "serial input view" from the Arduino software to view the serial input from the Stellaris ARM microcontroller, however, I'm not quite sure how to setup microcontroller to do that. Any suggestions?
@TheMetallicBros
@TheMetallicBros 11 жыл бұрын
To open what Jeremy opened first click on the tools at the top of the Arduino window, next click serial monitor. And then you should be able to see what he can.
@sabutter
@sabutter 12 жыл бұрын
Will a IR sensor reflect off of water? I have a 5ft tall 1600 gal water tank that I'm wanting to monitor the water level. I was thinking of using a pressure sensor but if a IR will reflect off of water it would be less work and no contact.
@NealBailey
@NealBailey 11 жыл бұрын
I have been looking for good tutorials like this. Thank you so much for making it make sense.
@valor36az
@valor36az 14 жыл бұрын
These tutorials are awesome, keep them up Jeremy
@bobbyshishedjiev7691
@bobbyshishedjiev7691 12 жыл бұрын
This series are great very well explained. Thank you and keep the good work
@MrKellyclarksen
@MrKellyclarksen 9 жыл бұрын
You explain everything so well. Thanks so much :)
@PRBHTRAI
@PRBHTRAI 13 жыл бұрын
your videos helps a lot...i am doing a project that includes using arduino , gps and a magnetic field sensor......
@nelsonmacieira9892
@nelsonmacieira9892 12 жыл бұрын
Hi, great tutorials, congratulations. But i have one question. I'm a begginer. Should i use it for program the micro and then use the micro on a pcb board? Does it serves to do the program an then use the microcontroller on my pcb board? Or the project must have the Arduino inside? Because i have some projects that would run better in a microcontroller, but i don't want to join an Arduino protoboard in each project.
@TheVerkoda
@TheVerkoda 10 жыл бұрын
What is the program used to monitor Arduino sensors on the computer?
@iroh1796
@iroh1796 10 жыл бұрын
go tools -> serial monitor
@the4hunters
@the4hunters 4 жыл бұрын
The legend! Do you have any videos with motors
@sciguy14
@sciguy14 14 жыл бұрын
@whisk0r Yeah, ordinarily I prefer not to work like that, but it seemed like the smartest thing to do...
@fredjones100
@fredjones100 12 жыл бұрын
Looks like you've forgotten the = sign; should be int ledLevel = map (etc etc). The error shows that you're trying to use a variable (ledLevel) without having declared it first, as the corrected line does.
@BrettPrice1983
@BrettPrice1983 12 жыл бұрын
hey jeremy.. I'm learning alot from your vids. Thanks. Qquick ? .... Why are you going out from both 3.3v and 5v into the breadboard?
@איליהפרידמן-ג5ב
@איליהפרידמן-ג5ב 12 жыл бұрын
hi, how frequent is the void loop() being scanned? if it is too fast or too slow the distanse ditector may fail to enter into the "if" statement.
@hardikvpandya
@hardikvpandya 14 жыл бұрын
super informative. may i ask how u got in touch with element 14 guys?
@WebDesigneri
@WebDesigneri 13 жыл бұрын
@sciguy14 The resistance varies when the actuator arm moves, so the position of the arm could be determined. So one wire is left. I assumed this would be the output from the potentiometer, but I don't get a voltage however I wire it (maybe it's broken?). I tried the voltage divider circuit with a fixed value resistor already, but didn't get that good of a resolution on the Arduino. What would be the best value for the fixed value resistor for this to work? Thanks for your help.
@HexoFire
@HexoFire 12 жыл бұрын
Just a question @ 14:10 I understand motionPin & lightPin are at pins 0 and 1, but what tells the arduino that those are analog inputs and not digital inputs?
@GamerDude1112LoL
@GamerDude1112LoL 12 жыл бұрын
i have a question, i do all of the photoresistor things right and the led is not effected by the light level at all any help?
@mudithead
@mudithead 13 жыл бұрын
Hey great video. :) Well, i did order the arduino starter kit so thats not a problem. But, i did order the infrared sensor(short range) but that did not come the connector( the jst connector or whatever it is called) :( How should i connect the sensor now? Is that cable available on element 14 website? Or is it available everywhere?
@mudithead
@mudithead 13 жыл бұрын
Hey, question- i have infrared sensor and everything but the the JST connector which connects the sensor to the breadboard is actually aluminium( that reddish- brownish fiber like thing) and not copper. Will that make any difference? Help
@MrDubje
@MrDubje 12 жыл бұрын
Not directly. You can do it the easy way with a current shunt (resistor). Just follow the steps to measure voltage over the resistor and you're done.
9 жыл бұрын
great tut, im getting negative numbers i think because im using 3.3 volts with no external reference dont know how to use external reference to make it work for reading analogue 3.3 volts is there a quick way to do this?
@pedrolealdossantos
@pedrolealdossantos 12 жыл бұрын
hey! Nice tutorial by the way. Just one doubt. I dont why, but using the same code with the led thing when i turn off the light, the led goes off. What am i doing wrong? thanks
@ThorgeirSkulason
@ThorgeirSkulason 11 жыл бұрын
Great tutorials mate! The idea circuit in my brain is on HIGH right now :p Gonna order me an arduino starting kit as soon as I can
@manutube8080
@manutube8080 14 жыл бұрын
Which relay can I use to power a light bulb?? I can't find one. Which specifications do I have to considered if I'm on South America and the voltage is 220V?
@WebDesigneri
@WebDesigneri 13 жыл бұрын
Hi! I have a variable resistor that can be set from 3.34 to 8.72 kohms. What's the best way to read the position of the variable resistor with an arduino and get the best resolution? The variable resistor has only 2 pins, so it doesn't work like a potentiometer.
@CIPHERJAY
@CIPHERJAY 13 жыл бұрын
@sciguy14 Would it be possible to include the infrared transmitter product on your website? I cant find one from element 14! Thanks!! (and thanks for the tutorials, they are great! )
Tutorial 05 for Arduino: Motors and Transistors
17:05
Jeremy Blum
Рет қаралды 646 М.
Arduino Analog Inputs
6:08
HackTheWorld
Рет қаралды 71 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Tutorial 03 for Arduino: Electrical Engineering Basics
16:12
Jeremy Blum
Рет қаралды 691 М.
Tutorial 02 for Arduino: Buttons, PWM, and Functions
20:09
Jeremy Blum
Рет қаралды 1,3 МЛН
Tutorial 01 for Arduino: Getting Acquainted with Arduino
14:32
Jeremy Blum
Рет қаралды 2,5 МЛН
Tutorial 06 for Arduino: Serial Communication and Processing
20:00
Jeremy Blum
Рет қаралды 856 М.
1-Day Project: Build Your Own Arduino Uno for $5
14:23
Julian Ilett
Рет қаралды 1,6 МЛН
Tutorial 07 for Arduino: I2C Communication and Processing
18:22
Jeremy Blum
Рет қаралды 460 М.
Tutorial 10 for Arduino: Interrupts and Hardware Debouncing
19:54
Jeremy Blum
Рет қаралды 353 М.