i'm using the IR distance sensor with the DC motor to switch on automatically and stay on until no motion is detected.
shall i use 1) a for loop to gradually increase motor speed
OR 2) the map function?
because using the for loop, after every delay, if the IR detects motion, the motor will start to accelerate from 0 again instead of retaining a constant velocity. Thanks! great videos!
i'm using the IR distance sensor with the DC motor to switch on automatically and stay on until no motion is detected.
shall i use 1) a for loop to gradually increase motor speed
OR 2) the map function?
because using the for loop, after every delay, if the IR detects motion, the motor will start to accelerate from 0 again instead of retaining a constant velocity. Thanks! great videos!
That 1 K resistor is quite hard to understand. Can current flow out through the transistor base and short circuit the Arduino? How to calculate that resistorin case qe want other voltages to be controlled, for example a 48 volts motor?
@CURISION Analog pins don't operate at simple 1 or 0 values. He's using analog. The maximum value of current through an Analog pin is 255, the lowest is 0. So if he puts analogwrites 100 to the motor pin, the motor will be using 100/255 of it's power. This is a generality but hopefully that helps explain it more.
great tutorials bro! thank you very much.. i have a question though. Is the ic in arduino uno detachable? i mean can you change the ic you are using now with another one? tnx in advnce for your rply keep it up bro! =>
@WebDesigneri The voltage across a capacitor cannot change instantaneously, so it serves to smooth out voltage spikes that can be created by as the DC motor turns. The diode ensures that as a charge builds up on the motor coil when the transistor is "off", a current is able to flow to dissipate the charge.
@CIPHERJAY The arduino is supplied 5V via the USB connection. Anything that needs 5V power can be plugged into the arduino's 5V pin, and it will receive 5V via USB as well.
@CURISION Considering that you asked this 2months ago, Im assuming you've already found the answer to this. Althoughm, I will answer it anyways, just incase you havn't found the answer or someone else has the same question. He is using an analog signal, so 255 is the number of points he can specify in the 5v. When he sets the variable to 255, it uses all of the 5v, but when he sets it to, lets say 127, it only uses half of the volatage, thus running the motor at half speed.
Jerremy: I have to say you series is very well done and I have learned a lot from them, keep up the good work and be sure to showcase your projects as well. Cheers!
I have a question about what you said about connecting all the grounds together, so your saying connect the 9v negative though the circuit and end it at the arduinos ground???
Nice series of tuts. Thanks for the great work, time and effort you put into these videos. But why does the servo moves back after he reached the 180 degrees if you don't tell him via code? Or did I miss something?
Amazing tutorial. I have a question. Instead of the 9v battery and that whole setup with the voltage regulator, could I use a 6v battery pack made of AA batteries? I use that set up on some RC stuff and the servo works fine. Is there a complication that I am missing on the Arduino?
@sciguy14 Thanks. I tried it last night and it worked fine. If I am going to be powering 5 servos(I am making a strange version of a robot arm) should I have multi battery packs or should it be ok to run them all off the same 6v AA pack?
Ive build an h-bridge using 4 transistor... What do I do with the diode seeing as the direction changes? Are the diode and capacitor really necessary?
@raghunitin Wait, you might be a bit confused between transistors and voltage regulators. You said what "transistor" did I use, but listed two voltage regulators. I used a 2N7052 to allow me to use 9V power for the motor while switching it with 5V from the arduino. If you want to convert 9V>5V, you want a voltage regulator. In which case, an LM7805 is fine.
@sciguy14 If i want to buy a npn transistor from Radioshack which want should i bought to get the circuit working. And instead of 9v for the motor i only need 1.5v to 3v for the motor.
Ok i have done the coding correctly (had to add an int) but the fan just go's round 24/7. now i have an old pc fan and it has a white cable (not in use atm) and i know that send messages back of how fast its going, do i have to add that to the circuit???
@herctrap Actually no. Electrons, flow from the emitter to the collector as you mentioned, but current flow is opposite from the direction of electron flow. See the wikipedia page on bipolar junction transistors for a good image of this process.
@herctrap Ah ok, I had misread PNP as NPN. Yes, indeed current flows collector to emitter in NPN, and that's what I said in the video. I don't even mention PNP transistors in the video.
Good series. I've been tempted to buy an arduino for a few months now but also wanted to experiment with C and other atmel chips. I've read you can use an arduino as an ISP programmer but apparently this can't be done with the new UNO. What arduino would you recommend and what method to program other chips?
@MrAAK95 I have more info about using an h-bridge on my blog (link in description). I may or may not do a video on it, since I might not have enough time.
@pjharro Thanks :) Be sure to check out the blog posts that I make with each episode too. I include more info about H-Bridges, and I also upload parts lists, schematics, and code.
Is FET transistor same as NPN ?
moviescorner 7 hours ago
This has been flagged as spam show
@sciguy14 Hi Jeremy, quick question....
i'm using the IR distance sensor with the DC motor to switch on automatically and stay on until no motion is detected.
shall i use 1) a for loop to gradually increase motor speed
OR 2) the map function?
because using the for loop, after every delay, if the IR detects motion, the motor will start to accelerate from 0 again instead of retaining a constant velocity. Thanks! great videos!
dsai0001 21 hours ago
Hi Jeremy, quick question....
i'm using the IR distance sensor with the DC motor to switch on automatically and stay on until no motion is detected.
shall i use 1) a for loop to gradually increase motor speed
OR 2) the map function?
because using the for loop, after every delay, if the IR detects motion, the motor will start to accelerate from 0 again instead of retaining a constant velocity. Thanks! great videos!
dsai0001 1 day ago
@sciguy14 can i use a PWM on pin 9 instead of using the servo library ,to control the servo??
kunal944 5 days ago in playlist Tutorial Series for Arduino
@kunal944 yes
sciguy14 3 days ago
@sciguy14 is it possible to drive a 35v 30 A brushless 3phase motor with arduino pwm?if yes how?
chilidress 1 week ago
@chilidress Yes, you'll need to drive it through a transistor or an hbridge
sciguy14 3 days ago
there is nothing called decelerate its only negative acceleration
carterblizz 1 week ago
@carterblizz
yes there is you tool! deceleration just means negative acceleration. its still valid.
MrColmbob 3 days ago
u are the best one who can teach me about elec.
im just beginer and i love this series
i were interested about a tranzistors and i know how to use them now
mrleva999 1 week ago
Y DO U SWALLOW UR SPIT NONSTOP
MY EARS
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
RenegadeFury 1 week ago
@RenegadeFury He doesn't want it to drip on the breadboard ... duh.
fabse64 1 week ago
Comment removed
RenegadeFury 1 week ago
Comment removed
RenegadeFury 1 week ago
The 22uF capacitor on the output of the regulator is WAY to big. Look up a datasheet for a 7805, it should be small, around .1uF.
chrisjpf33 2 weeks ago
How much mg995 towerPro servo motor need current.
i need current and voltage rating for the servo motor.
younisbaloach 3 weeks ago
That 1 K resistor is quite hard to understand. Can current flow out through the transistor base and short circuit the Arduino? How to calculate that resistorin case qe want other voltages to be controlled, for example a 48 volts motor?
Riskteven 1 month ago in playlist Tutorial Series for Arduino
the videos are great, but i have to say hearing you swallow every 30 seconds is really unpleasant...
opuslinkex 1 month ago
Great videos!! Im learning allot from them!! Could i use a transistor to control a dc motor with a larger voltage?, like a 48 volt dc motor? Thanks
olliecracker 1 month ago
I love these vids!!! More please!!!
minniman1234 1 month ago
Some of the best arduino tutorials on youtube! thank you SSSOOOOOOOO MUCH!!
anakinsdad 1 month ago
quiesiera preguntarte para deminuir la velocidad de un ventikador de 12v para hacer un noria gracia joselitoe tablillllaroja
tablillaroja 1 month ago
can we use a pin))) sensor
powerwingman 2 months ago
@powerwingman yes
sciguy14 1 month ago
what should i do help me
powerwingman 2 months ago
when i program the servo it said name lookup of 'i' changed for new ISO 'for' scoping
powerwingman 2 months ago
Should an analog or digital servo be used ?
nawazsucks 2 months ago
What does the capacitor do with all of this?
AnnoyingXboxer 2 months ago
Jeremy you are awesome, I find this videos highly educational and inspiring.
lowendguru 2 months ago
i think you should upload more tutorials with arduino! :P
greektricky 3 months ago
man, REALLY nice job! congratulations!
greektricky 3 months ago
you the man.... cause for a beginner like me i actually understand lol
but keep doing yah thing man hope someday i can get on that level someday
jamflava881 3 months ago
which is the transistor datasheet? there are a lot,...
dandy4547 3 months ago
Why do we connect the motor to a different 5V?
healthyforyou 3 months ago
@healthyforyou The 5V regulator on the arduino cannot supply enough current.
sciguy14 1 month ago
Thats a 9v to 5 v voltage reg. what to use to make a 12 to 5v
what's the v.regulator's model , I cant seem to find one?
Thanks in advance!
013dirtdiver 3 months ago
can i use a 2k resistor?
MRcrAzyProd 3 months ago
Awesome tutorial. Thank you for this.
amoralesmdl 4 months ago
Man, I wish I could type out programs like regular english like youuu.
omgitschrislol 4 months ago
When I'm confused, I look up: Tutorial 01 for Arduino, then I go to the playlist which is related to the video
theminecraftman2200 4 months ago in playlist Tutorial Series for Arduino
Good tutorial. Clear diagrams, superb explanations.
primeq 5 months ago
Your voltage regulator was in a TO-220 package...does the motor actually draw that much current?
evrythingelswastaken 5 months ago
why the need of separate 5v rails?
fabiuh991 5 months ago
255 rpm or what ?? don't get it , ima a noob
CURISION 5 months ago
@CURISION 255 is the position.
sciguy14 1 month ago
@CURISION the highest 8bit value is 255 so 255 is 100% pwm, I assume
DanFrederiksen 4 weeks ago
@DanFrederiksen understood, thanks alot :)
CURISION 3 weeks ago
@CURISION Analog pins don't operate at simple 1 or 0 values. He's using analog. The maximum value of current through an Analog pin is 255, the lowest is 0. So if he puts analogwrites 100 to the motor pin, the motor will be using 100/255 of it's power. This is a generality but hopefully that helps explain it more.
enticed2zeitgeist 4 weeks ago in playlist Tutorial Series for Arduino
@enticed2zeitgeist wow that actually explained alot thanks :)
CURISION 3 weeks ago
Hi! excelent video!
The 9V ground goes to the arduino ground?
InsaurraldeGustavo 6 months ago
@InsaurraldeGustavo Yes
martinopresnik 5 months ago
@martinopresnik Thanxs man!
InsaurraldeGustavo 5 months ago
great tutorials bro! thank you very much.. i have a question though. Is the ic in arduino uno detachable? i mean can you change the ic you are using now with another one? tnx in advnce for your rply keep it up bro! =>
Rk17 6 months ago
WOW! Not sure what I did wrong but my transistor started smoking! Luckily I'm pretty sure the arduino survived.
christophertaylor87 6 months ago
big help these tutorials are awesome, really good examples simple and understandable and the coding is just like java great!
sghazi 6 months ago
HBRIDGE!!!!
TheMrSion 6 months ago
Why exactly do you need the capacitor and the diode? What happens if you don't use them? How do they protect from "noise and spikes"?
WebDesigneri 7 months ago
@WebDesigneri The voltage across a capacitor cannot change instantaneously, so it serves to smooth out voltage spikes that can be created by as the DC motor turns. The diode ensures that as a charge builds up on the motor coil when the transistor is "off", a current is able to flow to dissipate the charge.
sciguy14 7 months ago 5
You have a natural tendency of being a very good teacher. Keep it up.
sohailyt 7 months ago
@sciguy14 , Thanks. What i'm confused about is where to connect the 5v (on the arduino) to the circuit.
CIPHERJAY 7 months ago
@CIPHERJAY The arduino is supplied 5V via the USB connection. Anything that needs 5V power can be plugged into the arduino's 5V pin, and it will receive 5V via USB as well.
sciguy14 7 months ago
@sciguy14 Thankyou!
CIPHERJAY 7 months ago
Does 5V2 just refer to the voltage that is supplied from the pc? Or do you have to connect the 5v pin next to the groun pin?
CIPHERJAY 7 months ago
@CIPHERJAY never connect the 5V pin to ground.
sciguy14 7 months ago
@sciguy14 225 as in rpm or what ? , and also please if you can show me how to control multiple motors on an ardunio , i'm still a beginner ..:)
CURISION 5 months ago
@CURISION Considering that you asked this 2months ago, Im assuming you've already found the answer to this. Althoughm, I will answer it anyways, just incase you havn't found the answer or someone else has the same question. He is using an analog signal, so 255 is the number of points he can specify in the 5v. When he sets the variable to 255, it uses all of the 5v, but when he sets it to, lets say 127, it only uses half of the volatage, thus running the motor at half speed.
d3fish3r3 3 months ago
@d3fish3r3 thanks alot man , i couldn't really find out the answer ..
CURISION 3 months ago
@AgentMitra Thanks! I appreciate that :)
sciguy14 7 months ago
Jerremy: I have to say you series is very well done and I have learned a lot from them, keep up the good work and be sure to showcase your projects as well. Cheers!
flashMXdesigner 8 months ago
Awesome
Bashar46 8 months ago
I have a question about what you said about connecting all the grounds together, so your saying connect the 9v negative though the circuit and end it at the arduinos ground???
eddiea6987 8 months ago
oddly enough this does NOT work for me with an external power supply...
Slench101 8 months ago
your servo tutorial was more useful than the one on arduino.cc
Slench101 8 months ago
Comment removed
Slench101 8 months ago
Awsome... just what I've been looking for, hate books, love video tutorials. Keep up the good work!
BadASszZ 9 months ago
Nice series of tuts. Thanks for the great work, time and effort you put into these videos. But why does the servo moves back after he reached the 180 degrees if you don't tell him via code? Or did I miss something?
MackhackCA 9 months ago
hey Guys. Please kindly help me : how to constantly put off the fan ???
makinsoft 9 months ago
Amazing tutorial. I have a question. Instead of the 9v battery and that whole setup with the voltage regulator, could I use a 6v battery pack made of AA batteries? I use that set up on some RC stuff and the servo works fine. Is there a complication that I am missing on the Arduino?
mathboy1212 9 months ago
@mathboy1212 no, that's fine.
sciguy14 9 months ago
@sciguy14 Thanks. I tried it last night and it worked fine. If I am going to be powering 5 servos(I am making a strange version of a robot arm) should I have multi battery packs or should it be ok to run them all off the same 6v AA pack?
mathboy1212 9 months ago
@mathboy1212 yes, should be fine.
sciguy14 9 months ago
Hey dude, thanks for the awesome tutorials!
Ive build an h-bridge using 4 transistor... What do I do with the diode seeing as the direction changes? Are the diode and capacitor really necessary?
Thanks again!
jonnythebutcher 9 months ago
Great!!! Guy, I love your tutorials!
Please, keep recording and posting more tutorials \o/
Nice job. Thank you!
crentelouco 9 months ago
Is it possible to make motors go in reverse?
jimmyinaus16 11 months ago
@jimmyinaus16 Yes, hook the wires up backwards
sciguy14 10 months ago
@sciguy14 Hi
Looking to get into Arduino programming. This tutorial is really good. I was wondering if and how i would:
Control a switch with the arduino - to control when a relay receives current
Control the position of the DC motor - to make an electric screen for a projector
Can you help?
Anima87 9 months ago
@jimmyinaus16 or use a 'H-Bridge' (just google the term for more details).
raghunitin 6 months ago
what transistor did you use?
LM317 or LM7805
raghunitin 11 months ago
@raghunitin 2N7052
sciguy14 11 months ago
@sciguy14 Is it advisable to use LM7805 with 0.3microF and 0.1microF capacitors? I want to convert 9V to 5V rail~~~
raghunitin 11 months ago
@raghunitin Wait, you might be a bit confused between transistors and voltage regulators. You said what "transistor" did I use, but listed two voltage regulators. I used a 2N7052 to allow me to use 9V power for the motor while switching it with 5V from the arduino. If you want to convert 9V>5V, you want a voltage regulator. In which case, an LM7805 is fine.
sciguy14 11 months ago
@sciguy14 oh, sorry... I was in a bit of a hurry and blabbered.... sorry.... I should have typed Voltage regulator in the first place....
raghunitin 11 months ago
@sciguy14 If i want to buy a npn transistor from Radioshack which want should i bought to get the circuit working. And instead of 9v for the motor i only need 1.5v to 3v for the motor.
loco15912 10 months ago
Ok i have done the coding correctly (had to add an int) but the fan just go's round 24/7. now i have an old pc fan and it has a white cable (not in use atm) and i know that send messages back of how fast its going, do i have to add that to the circuit???
GamingAnt98 11 months ago
@GamingAnt98 I'll need to see your code.
sciguy14 11 months ago
i get the error of ' motorPin was not declared in this scope' PLEASE HELP!
GamingAnt98 11 months ago
@GamingAnt98 try this leave a space between the include and servo.h
raghunitin 11 months ago
why is it not i==i+20 ?
Shockszzbyyous 1 year ago
@Shockszzbyyous because i==i+20 just checks whether i is equal to i+20 or not..... It is a relational operator....
raghunitin 11 months ago
great tutorials
but in PNP transistors current flows from the emitter to collector!!!
herctrap 1 year ago
@herctrap Actually no. Electrons, flow from the emitter to the collector as you mentioned, but current flow is opposite from the direction of electron flow. See the wikipedia page on bipolar junction transistors for a good image of this process.
sciguy14 1 year ago
@sciguy14
In pnps current flows from the emitter to the collector if current is able to flow from emmiter to base
In npns current flows from the collector to emmiter if current is able to flow from base to emmiter
herctrap 1 year ago
@herctrap Ah ok, I had misread PNP as NPN. Yes, indeed current flows collector to emitter in NPN, and that's what I said in the video. I don't even mention PNP transistors in the video.
sciguy14 1 year ago
Can we increase the resolution of servo ?
karandex 1 year ago
@karandex No, it is preset.
sciguy14 1 year ago
do you realize that you are good at this, you can be next kipkay, post it on metacafe
karandex 1 year ago
servos are costly so could ya find some video or tell me how to make one servo or any schematics????
francisroan 1 year ago
@francisroan Making a servo yourself would be way more expensive than buying one.
sciguy14 1 year ago 2
@francisroan You can use stepper motors, which is cheap.. An example is available in Jeremy's second channel, 'JeremyEblum'
raghunitin 11 months ago
Good series. I've been tempted to buy an arduino for a few months now but also wanted to experiment with C and other atmel chips. I've read you can use an arduino as an ISP programmer but apparently this can't be done with the new UNO. What arduino would you recommend and what method to program other chips?
boabie 1 year ago
@boabie Yeah, the new version no longer uses the FTDI Serial Chip. If you want to do what you're describing, you'll need the Duemilanove
sciguy14 1 year ago
@sciguy14 ok thanks buddy keep up the good work.
MrAAK95 1 year ago
I appreciate your work, you are doing a great job. When will you be doing the H-bridge?
MrAAK95 1 year ago
@MrAAK95 I have more info about using an h-bridge on my blog (link in description). I may or may not do a video on it, since I might not have enough time.
sciguy14 1 year ago
Another good video my man, cool stuff thanks.
Thom in Scotland.
fuelban 1 year ago
I like the way you are progressing these tutorials, thanks again great stuff
khisanth75 1 year ago
how to make a servo rotate fully? please help me!!!!! i need it for my project!!!!
raghunitin 1 year ago
@raghunitin Buy a continuous rotation servo. You can get futaba continuous servos from parallax.
sciguy14 1 year ago
This has been flagged as spam show
Way to go SENSEI i will keep an eye wide open once you upload your next videotuto.
20 thumbs up, did i say 20? uhmm ok
thanks
thepimping666 1 year ago
Way to go SENSEI i will keep an eye wide open once you upload your next videotuto.
20 thumps up, did i say 20? uhmm ok
thanks
thepimping666 1 year ago
Cool stuff. Glad to join the atom hackers!
topgunwow 1 year ago
Thank Jeremy for all you great work, im learning one video at a time, im a visual learner
sasquatch200269 1 year ago
excellent tut!
manutube8080 1 year ago
hey i was wondering if you could link us to a decent site that has a some filter code i could use it and im sure many other people can
Thanks You
HalfFullEffects 1 year ago
@HalfFullEffects There is a code sample linked on my blog post for this episode.
sciguy14 1 year ago
my new saying is that i learn something new every Monday hahah thanks jeremy
HalfFullEffects 1 year ago
Man your good
nfalas 1 year ago
Thanks, that was very much educational.... I really wanted to know about these servo things and this taught me right!!!
And yeah!!!!!!!! I'm waiting eagerly for that little yellow led to light up... :)
raghunitin 1 year ago
@raghunitin Next Week! We'll get started with serial communication.
sciguy14 1 year ago
Comment removed
raghunitin 1 year ago
Great tut. Keep up the extra info (common gournds... comment code...) all great stuff. Sometimes the simple things help tie things together :)
pjharro 1 year ago
@pjharro Thanks :) Be sure to check out the blog posts that I make with each episode too. I include more info about H-Bridges, and I also upload parts lists, schematics, and code.
sciguy14 1 year ago
Now we've got enough information to build an evil robot to do our bidding!
whisk0r 1 year ago
@whisk0r mwahaha
sciguy14 1 year ago
Great tutorial
MrHorsetail 1 year ago
Excellent! Please keep them coming. Can't wait to see more.
fuqur2dom 1 year ago
Nice.
jeriellsworth 1 year ago
Nice work as usual. Keep it up.
AntiProtonBoy 1 year ago