Arduino Tutorial 31: Using Servo in a Simple Project

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this video we show you how to build a simple project using a servo and arduino. The project reads a light brightness value, and then creates a visual display with an arrow that points out brightness, ranging from moonlight to full sun. This requires the use of Algebra, and the equation of a line.

You can get the kit I am using for this series at the following link:

Also, you can get nicer servos than the ones in the Elegoo kit here. These are the good ones I use in most of my projects.

Follow along on our WEB site:

#Arduino
Рекомендации по теме
Комментарии
Автор

The "math" part is really important. Keep showing it!

drsmith
Автор

Hello, Mr. Mcwhorter! I just wanted to tell you that in my entire life I´ve never got excited when someone tell me "This is the homework/assigment for today" but you are the first person in all the world which make it happen. After just some minutes I did the "homework" before watching this video and I just got a lot of fun doing it. I even tricked my dad make him think that I was controlling the servo motor rotating the lamp that I have in my desk before telling him that it was the light produced by the lamp which made it move and the angulation of the lamp made the photoresistor get more or less light (which to the servo was translated to rotation degrees) depending of the rotation. Thank you! Mr. McWhorter. I could say that these are the best videos in all youtube.

richthofen
Автор

I did the math and I also added "if" statements after calculating the angle so that it would for sure stay within the range of my servo (15 to 165 degrees) in case the lightVal was higher or lower than my x values I used to find the slope.

karlgross
Автор

Hello Paul. I did the assignment and it works. I'm so happy and proud about it. Thank You for Your lessons. Three weeks ago I did not know anything about the Arduino and now I develop to a little expert. You are a great teacher and I am really happy that I have found these tutorial on YouTube. Please keep on with this series (y)

GeoGebweiler
Автор

I did the assignment too. I can't begin to tell you how much I really appreciate you doing this to help us all learn. I'm an old guy and retired recently and i'm a 2nd time watcher of your Arduino videos. I started out about 7 or so years ago with Arduinos and learned a great deal from all of your older series. I got away from microcontrollers and microcomputers while I pursued 3d printing and laser engraving for a few years. My electronics bench has been calling me for the last few months so, when I needed a refresher, I knew to look back to you and I'm very pleased that you've got a new series!
That said, I cheated a little on the assignment. I didn't forget everything I learned from my Arduino past. I remembered the "map" function and mapped the analog read from the LDR to the values of my servo's range (senseVal= map(analogRead(sensePin), 0, 1023, 0, 175);). The sketch works great and I owe it to you for being able to get me back into the coding saddle!
I see you also have a new Python series too!. I'm going to get into that one soon and I know that I'll benefit from both of these great video sets. YOU ROCK! Thanks again!

charlielowell
Автор

I've been following this series since lesson one, and I have never been so engaged in doing homework!
Half the time I make my code more complicated than it needs to be, and have a good chuckle when you show how easy it is. This one was actually pretty easy in relation to the button switch. I appreciate the need to brush up on my algebra, as it has been far too long! Thank you for your time and knowledge!

tobinsexton
Автор

You are doing such a service!! Thank you so much for being such a wonderful teacher. Your style of teaching is perfect for me; the way you explain not only what, but how and why, the way you repeat important points and even important points from previous videos. Really helps to job my memory. I always do the homework and I love doing it, it works out for me 95% of the time but that toggle switch a few episode back had me struggling. You sir have a gift for teaching

jamesunsworth
Автор

I'm a bit proud of myself. I was able to not only finish the assignment, but I also wrote a code that set up the min~max photoresistor value by itself depending on the light level.
whenever the code detects a smaller min value or larger max value, it will rewrite the minmax photoresistor value.
being able to start utilizing the knowledge that I learnt from your previous tutorial feels really great. can't wait to finish all the tutorial.

bearpapa
Автор

I did the home work assignment. I'm happy to say i got working. Im patting myself on the back.( but i did have to go back to see certain things make sure i was correct) so far this arduino tutorial is great. Im 4 years later and almost 40years old still learning new things. This is awesome. Thank you for what you did for us. Sry i dont comment very often but i felt i needed to this time.

allengerhard
Автор

This is amazing man, im 2 years in to my mechatronics engenieering major here in Mexico and this videos help me to rembeber the basics! Thanks a lot!

raultrevino
Автор

I am happy to say that, thanks to your wonderful tutorials and teaching style, I completed the assignment by my self! And it worked on my first try! Thank you so much for having this high quality and accessible technology education available to students.

steviekiss
Автор

I did build the project and coded it to get it to work. I'm not good at math, so I used a series of if loops to set the angle for the servo. Worked just fine. Replaced the if statements with the calculation and of course it worked. Really enjoying these lessons.

michaeldalfonzo
Автор

Hello Paul. I did the assignment and I also added an if statement to print out the weather based on the angle value. thanks very much for your time. 💯

corneliuschamberlainmarcou
Автор

Hi Paul. I did the homework, drew the curve, derived the equations, wrote the code, and it works! That was a pretty cool example to work through.
Thanks again for these lessons!

dougweaver
Автор

I finished the homework prior to this so I had a Margarita during this video instead of the coffee.

danwolfe
Автор

I did the homework (and the math) and it works!...even got an "oooo, ahhhh, from my son in systems design engineering! Used a potentiometer in place of the 5000 ohm fixed resistor so I can adjust the sensitivity to light / darkness. Thanks for another great lesson.

dougbrubacher
Автор

I did the homework :) Worked out great, put IF statements to limit the servo no less than 10, and no higher than 170. Thank You for your wonderful

richardjenkins
Автор

I always do the homework and focus on every second of the videos. I really benefit from the course. Thank you very much for all of that but I don't know what to comment so this is my first one here.
Maybe there is a lot of people who watching silently like me I hope you read that

AmeerCT
Автор

Once again I got my homework done without cheating. My math was a bit crude but I referred to some of the older projects and got it all to go. the arm swings right as the light goes out and left as it gets brighter. Mission accomplished. Another satisfied customer. :)

adamcurtice
Автор

I got this one working prior watching any of lesson 31. The code was easily created by referencing a few other lessons. The math is pretty easy at this point. No complaints from me.

Enjoyable lesson, seeing all of the previous lessons come together is very rewarding.

autocrosser