Тёмный

Linear Actuator Arduino Control using L298N Motor Control Board 

Science Fun
Подписаться 6 тыс.
Просмотров 44 тыс.
50% 1

Linear Actuator Arduino Control using L298N Motor Control Board
In this tutorial I will show you how to use the L298N motor control board and write simple Arduino code to control a linear actuator. The L298N is a compact and inexpensive H bridge motor control board that easily interfaces with microcontrollers such as the Arduino or Raspberry Pi. Though it costs a little more than the L9110, it is capable of much higher power and can also provide 5V for your Arduino. It is also capable of dc motor speed control.
In a previous video I used an L9110 and a magnetic proximity sensor to control an industrial linear actuator. In this video, I use an L298N with a 3 button switch to extend, retract, and stop a linear actuator. I also describe the Arduino code used to interface with the L298N. In a future video, I will use and RC transmitter and receiver to control the speed and direction of the linear actuator. Please subscribe to my channel and help me reach my goal of 1,000 subscribers by the end of 2020.
Pin Connections:
L298N 12V to Battery +
L298N GND to Battery -
L298N GND to Breadboard GND Rail
L298N 5V to Breadboard 5V Rail
L298N OUT1 to Linear Actuator +
L298N OUT1 to Linear Actuator -
L298N In1 to Arduino Pin 9
L298N In2 to Arduino Pin 10
Button Common to Breadboard GND Rail
Retract Button to Breadboard 5V through 10k resistor and to Arduino Pin 2
Extend Button to Breadboard 5V through 10k resistor and to Arduino Pin 3
Stop Button to Breadboard 5V through 10k resistor and to Arduino Pin 4
Arduino GND to Breadboard GND Rail
Arduino 5V pin to Breadboard 5V Rail

Наука

Опубликовано:

 

27 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 143   
@michaelweatherby8648
@michaelweatherby8648 3 года назад
Thanks. I was pretty sure I knew what to do, but it's always nice to have a reference. This is exactly what I was thinking, 12V, l298n, and a limit switch. Cheers!
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Glad I could help!
@73Ferret
@73Ferret 6 месяцев назад
That’s got to be the clearest presentation of this ever.
@ScienceFunInnovations
@ScienceFunInnovations 6 месяцев назад
Glad you liked it. Thanks for watching!
@m.on.a.b.
@m.on.a.b. 4 года назад
Hello Sir! Great videos that you're making! Please keep up the nice work. You helped me with the EasyDriver Stepper Control Video on a side project for my Bachelors Degree. I hope that your channel gets popular!
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Glad I could help. Good luck with you B.S.
@neogator26
@neogator26 3 года назад
Number 750. lol As I get more time I feel your channel will be exceedingly helpful as I learn more about Arduino's for fun projects. As for now you are being quite helpful with my principles of measurement class. :-)
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Awesome, thank you for subscribing!
@3xAudio
@3xAudio 4 года назад
Always interesting ideas to get inspiration in the Arduino community thanks for sharing.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
No problem 👍
@hebrewhammer1000
@hebrewhammer1000 3 года назад
Thanks for sharing! Great video format and content
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Thanks for watching!
@sujitvasanth2502
@sujitvasanth2502 2 года назад
Nice video! I like that you explain everything!
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Glad you liked it!
@gusgtzmiranda
@gusgtzmiranda 3 года назад
Excellent code and explanaition my friend, it was really helpful. :) Keep doing this kind of videos. Greetings from Mexico
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Gracias, lo haré!
@ottolouis7653
@ottolouis7653 3 года назад
dont know if you guys cares but if you're bored like me atm you can stream all of the latest movies on instaflixxer. Have been watching with my girlfriend for the last couple of days :)
@guscarmelo9216
@guscarmelo9216 3 года назад
@Otto Louis yea, I have been watching on instaflixxer for since december myself =)
@ahmedizaiah9199
@ahmedizaiah9199 3 года назад
@Otto Louis Yea, I've been watching on instaflixxer for months myself :D
@sarthakskumar6026
@sarthakskumar6026 3 года назад
That's a really good video. Keep Up the Work Sir. I'm Kinda Interested in these stuffs and look forward to your support.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Much appreciated!
@sarthakskumar6026
@sarthakskumar6026 3 года назад
@@ScienceFunInnovations Are you available on Instagram? If you would allow me to share your channel and let you know. I guess that would just make me a better friend of yours.
@hemayetkabir1331
@hemayetkabir1331 4 года назад
Special thanks to you.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Glad you liked it.
@darrreltrigg2282
@darrreltrigg2282 3 года назад
Thanks for the video very interesting. I am only just getting into electronics and would like to take this a step further, by being able to read an output from the linear actuator as to how far it is extended, then display this on a LCD screen and also have the ability to be able to stop the actuator in different memory positions. I want to use these to control to 600N 500mm linear actuators to make a sit stand desk.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I am planning on doing a video about linear actuator position control very soon. My part is scheduled to arrive from China in a week or two, then I hope to have the video out by the end of the month. Hit subscribe and turn on notifications so that you are alerted once it posts. Thanks for watching!
@iangreaves5457
@iangreaves5457 4 года назад
Hi, a good demonstration. A schematic for the wiring would be helpful.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
I added a schematic to my Facebook page: ru-vid.com?redir_token=02jIURwDAyLgAtjWnW65wxRyDdl8MTU4NjgzNTUyNEAxNTg2NzQ5MTI0&q=https%3A%2F%2Ffb.me%2FScienceFun4u&event=channel_description Thanks for the feedback.
@iangreaves5457
@iangreaves5457 4 года назад
That's great, thanks very much. I'll be using this in the next couple of weeks to steer a mobility scooter base via remote control -- hopefully.
@charleslim4741
@charleslim4741 3 года назад
Hi great video! I am following your instructions to make my own arduino-controlled linear actuator. Quick question, is it possible to burn out the L298N by accidentally leaving the switch in extend/retract position for a few minutes and forgetting to press the stop button? (Assuming your linear actuator has an automatic cut-off function). I think I may have burnt out my L298N!
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Most actuators have automatic cut off on both ends, so that should not burn out the L298N. What could burn it out is if you actuator pulls more than 2 amps continuous or more than 3 amps momentary. Actuators under heavy force will pull more current. I may do a future video using a different motor control board that can handle more power.
@charleslim4741
@charleslim4741 3 года назад
@@ScienceFunInnovations Thanks for your reply! I figured out the issue, turns out I placed the L298N on a metal surface and the contacts on the bottom shorted out, causing the L298N to fail. Looking forward to that video!
@netsurfer2975
@netsurfer2975 3 года назад
For someone as new as I am to this I have to say you were too quick in explaining wiring and too brief in the explanation of some terms. But I do appreciate your video.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Glad it helped. I have a few other linear actuator videos that may help fill in some of the gaps.
@JohnAnderson-Catfish
@JohnAnderson-Catfish 4 года назад
Hi, great demo! I have a question, I'm using two wifi switches with my linear actuator with 4 relays, I would like to not use the relays and use something like this but with a raspberry pi or arduino. Can that be done?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Control will work with Rasperry Pi or Arduino, but you will need some sort of H-bridge or motor controller that is capable of handling the current of the actuator. The current can be much higher with higher loads, so you will want to make sure that the driver controlled by the Arduino can handle the load.
@JohnAnderson-Catfish
@JohnAnderson-Catfish 4 года назад
@@ScienceFunInnovations Thank you for replying, I new to both the Arduino and Raspberry, I did order an H bridge. Thanks again!
@aminfirdaus3279
@aminfirdaus3279 Год назад
great video, i have a question, if I want to use linear actuator with encoder to control it at specific location or length, how may I know the range of it, can i use manual method by just supply power to it and read the encoder position from the beginning until the end of it?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Yes you can. Check out my more recent videos to see how to do that.
@hemayetkabir1331
@hemayetkabir1331 4 года назад
A schematic would really help. Please upload that. Thank you so much.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
I added a schematic to my Facebook page: ru-vid.com?redir_token=02jIURwDAyLgAtjWnW65wxRyDdl8MTU4NjgzNTUyNEAxNTg2NzQ5MTI0&q=https%3A%2F%2Ffb.me%2FScienceFun4u&event=channel_description Thanks for the feedback.
@raymondche3685
@raymondche3685 3 года назад
G'day mate, question, if i were to incorporate this set up for an outboard/ jet nozzel steering system, how would i be able to make the actuator finish at the centre position (self centre) when there's no input signal. thank you in advance, Raymond from Sydney.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Great question. They do make actuators that have position feedback (usually a potentiometer) that you could feed into an Analog channel on the Arduino. Otherwise you would have to use some sort of position feedback system such as an LVDT.
@raymondche3685
@raymondche3685 3 года назад
@@ScienceFunInnovations thanks for your reply, I understand the theory, but do you reckon you could make a video on this project, also write the code for the arduino part as I am better with the building part, (not so good with the coding part) I am an electrician by trade. Thx.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I have had some similar requests for a video like that, so it is definitely on my to-do list. I'll have to order some parts first, but I do hope to do that video sometime in the next few months.
@Cosmos229
@Cosmos229 2 месяца назад
Hi, your video is so helpful for me. But I have one question. As I know, peak current of L298N is 2A. But your linear actuator's continuous current or stall current seem to exceed 2A. is it okay to use L298N?
@ScienceFunInnovations
@ScienceFunInnovations 2 месяца назад
I would use a BTS7960 if there was any load. It is good to 43 Amps and is still affordable.
@user-cr6ki4qs4y
@user-cr6ki4qs4y 4 года назад
Hi and thanks so much for this video! Is there such a way to make it so it works similar to a power window? Like hold the up button for 2 seconds and release to fully extend but make presses less than 2 seconds, a move and release? Also is it possible to make the stop button move the actuator to a specific position?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Yes, you could program it to be like a power window. Once the switch is pressed you record the timestamp using millis(). Then in your loop you would calculate elapsed time = millis() - timestamp. Once enough time has elapsed, you would check the switch again to set the mode to extend. Stopping in a specific position requires an actuator with a built in potentiometer (a bit more money) or an external linear position sensor. Once of these days I will do a video about it.
@itaycarpis9291
@itaycarpis9291 3 года назад
​@@ScienceFunInnovations, let's assume I have an actuator ​with a built-in potentiometer, is it possible to move the actuator to a specific position using the L298N only? or I must involve the Arduino with some code?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@itaycarpis9291 You would still need some simple code to keep track of the window position. You would use an analog input to measure the potentiometer position. That way you could have it go to specific positions. I will likely do a video about this in the future.
@itaycarpis9291
@itaycarpis9291 3 года назад
​ @Science Fun , thank you for the super quick answer :) Do you know maybe if there is a motor control that does the position fix without any external involvement, such as Arduino... Some motor control that gets the feedback from a potentiometer actuator signal as an input and fixes the position according to the required position.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@itaycarpis9291 There may be some that use limit switches, but I'm not sure if there are any with position control.
@IainHendry
@IainHendry Год назад
What do the resistors do for the switches? What do you mean by “pull up resistors”? Can’t the switch just wire directly to the input?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
There is a way to wire directly to the inputs without using pull-up or pull-down resistors if the microcontroller has resistors built in. Most of the newer Arduinos can do it without the resistors, but you may need to add a little more code. There are many articles about this if you search for it on the web. Cheers!
@tommasomarano7127
@tommasomarano7127 2 года назад
Great ones. I would like to know which is the name of the three button switch
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
It is called a membrane switch.
@croydon21H
@croydon21H 3 года назад
I thought we have to use BTS7960B 43A or similar. will L298N be enough?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Depends on the load on the actuator and the current draw. For heavy loads, use the BTS7960B. I will be using the BTS7960B in an upcoming video.
@allenwright1592
@allenwright1592 Год назад
I am attempting to do this except using a FlySky i6x and wanting to control the actuator with the 3 position switch. I can get the actuator to extend, but not retract. I'm sure it's in the code. Thoughts?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Probably in the code. I have several videos about controlling linear actuators, hopefully one of those gives you some good ideas.
@PreMix759
@PreMix759 3 года назад
How can I supply 12V to the linear actuator while still utilizing the Arduino? I need to establish an upper limit (extend 3.5") for the actuator and I need to supply all 12V as I will be maxing out the weight capabilities of my actuator. Its rated for 225lb with a 4" stroke, I need to lift 215lbs 3.5"
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Does you actuator have a max current rating? If it pulls more than about 3 amps at full load, you may need to use something stronger like a motor controller similar to this one ebay.to/2yrsTjn
@PreMix759
@PreMix759 3 года назад
@@ScienceFunInnovations 4.6A. I have a L298N as well
@DC_ABC_123
@DC_ABC_123 4 года назад
EDIT: I Switched to my Arduino Mega and for some reaason everything works now. I'm getting frustrated here. I've been trying to measure the PWM signal from my tx input using the serial monitor. However, before I even turn on my tx, the serial monitor spits out random numbers, and when I turn the tx on, it still does the same. I double checked the code, which is exactly as you have it. I'm on pin 7, both in the sketch and on the Uno. I plugged a servo into several different channels as a test that they're working. I've tried this with my flysky fs-t6 in sticks mode as well as my tactic pistol controller. NOTHING works like it should in the video. What's going on here? I'm about ready to give up.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
That is weird that it worked on the Mega but not the Uno. Did you have any breakthroughs on what was wrong?
@jaandel1
@jaandel1 3 года назад
How can you input data ( measure) to extend to the right measurement e.x input 20mm the bar should increase 20mm exactly.. if you input new data they will adjust the previus measurement to the new data
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Some actuators have built in position feedback sensors that can connect straight to an Arduino. These generally cost a bit more. Other options are to use an external linear potentiometer or an ultrasonic sensor. I'm hoping to cover this topic in a future video. Thanks for watching.
@user-ou6bc6ci4b
@user-ou6bc6ci4b 7 месяцев назад
thank u for cool video. i ahve a question that did you use any library manger? When I write your code, high and low couldn't be blue. Is it okay that high and low code is just normal? I hope you solve my question quickly!
@ScienceFunInnovations
@ScienceFunInnovations 6 месяцев назад
I try not to use any libraries if I can help it. Check out some of my other actuator videos to learn more.
@richardpayne9640
@richardpayne9640 3 года назад
could you not do the same with a dpdt switch plus relays if you wanted to be easy on on the switch?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Yes. A DPDT would work as well. The motor control board allows for variable speed control (as well as automation if sensors are used instead of buttons).
@richardpayne9640
@richardpayne9640 3 года назад
@@ScienceFunInnovations I understand actuators are pretty neat
@gumuruhsspj
@gumuruhsspj Год назад
is it possible if we want to implement linear actuator for sliding a door (house) not a smaller one?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Yes. They come in all sorts of lengths.
@Kimky265
@Kimky265 4 года назад
Thank you for your vidio, i wonder part name of the switch(?)
@Kimky265
@Kimky265 4 года назад
Please let me know !
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
It is called a 1X3 Membrane Switch. I purchased mine from Ebay ebay.to/2RXWxUk
@nurjamahashiabdulle1711
@nurjamahashiabdulle1711 3 года назад
@@ScienceFunInnovations what is the size of this I linked and saw 1*3key 36*55 mm one
@nurjamahashiabdulle1711
@nurjamahashiabdulle1711 3 года назад
@@ScienceFunInnovations is it?
@user-tw1ti1tr3l
@user-tw1ti1tr3l Год назад
안녕하세요 혹시 아두이노 메가로 변경하면 핀 번호가 달라져야 하나요?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Mega는 Uno와 동일한 핀을 가지고 있어야 하며 더 많은 핀이 있어야 합니다.
@parthdandawate7245
@parthdandawate7245 2 года назад
Please reply...I have a 24v 6 amp linear actuator can I use L298N Motor drive or do I need to use more powerful motor drive?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
L298N is only good to about 3 amps. I would use a BTS7960.
@parthdandawate7245
@parthdandawate7245 2 года назад
Instead of using all these motor drives, Arduino, membrane button to control actuators, I have used DBDT (Double pole double throw) switch and I am able to control actuators.
@chewchengkai2769
@chewchengkai2769 Год назад
Hello sir, want to ask how about connection two linear actuators and syncing the movement of the linear actuator?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
In order to sync the positions of the actuators, you need actuators with position feedback. Some of my new videos use these 5 wire actuators. You would still want 2 seperate motor controllers but you would use the position feedback from one actuator to control the other actuator.
@tawiahlot9926
@tawiahlot9926 2 года назад
Can I just use any Linear Actuator with the L298N Motor Control Board? or there are specific linear actuators?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
The L298N is limited to about 3 amps. You may want a more heavy duty controller if you intend to have high loads/forces. But they all pretty much work the same way. Just find out how many amps the actuator uses under full load first, then select a motor control board that can handle the power draw. Cheers!
@burak6871
@burak6871 3 месяца назад
Good day. I would like to control a TGM7 series 24V 6A geared motor using a 24V DC motor controller (lithium battery) and Arduino. I would appreciate your help on this subject.
@ScienceFunInnovations
@ScienceFunInnovations 3 месяца назад
What exactly are you needing help with? You could send an email to my business email with details.
@mirulzzz99
@mirulzzz99 3 года назад
hi can u help me with the circuit and code if i added hc 06 bluetooth module
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
You can send more details to my business email sciencefunbiz@gmail.com and I can see what I can do to help. Thanks for watching!
@nurjamahashiabdulle1711
@nurjamahashiabdulle1711 3 года назад
@@ScienceFunInnovations How can i control linear actuator without using these 1x3 membrane switches?
@shresthagupta7610
@shresthagupta7610 2 месяца назад
Can we make a circuit without using buttons such that if we program it in labview, one click will push it forward and another click er take it backwards?
@ScienceFunInnovations
@ScienceFunInnovations 2 месяца назад
Definitely yes. The button is just one easy way.
@kanhuprasadmaharana6409
@kanhuprasadmaharana6409 3 года назад
Where I got this button, please give the link
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I get my on eBay. Here is the link ebay.to/2RXWxUk
@user-sy5bp3mv3w
@user-sy5bp3mv3w 4 года назад
What is the name of the remote control with 3 buttons? Could you tell me the name or purchase link of that part?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
It is called a 1X3 Membrane Switch. Here is a link ebay.to/2RXWxUk
@user-sy5bp3mv3w
@user-sy5bp3mv3w 4 года назад
@@ScienceFunInnovations thank you very much
@cardude2191984
@cardude2191984 2 года назад
First I’d like to start off by saying I am a complete novice when it comes to this type of stuff. I’m wanting to put together a automatic chicken door opener. I have components from a lift chair which consist of a 24v dc linear actuator and power supply. I’m trying to figure out the best way to control this system and I’m wanting.
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
It would be similar, but you would probably want a stronger motor controller. Good luck!
@muhammadfakhry8797
@muhammadfakhry8797 7 месяцев назад
Hello sir good day. I have a question instead of controlling the linear actuator using three buttons, how can I automatically move the linear actuator based on input data from SD card? I hope you can help me
@ScienceFunInnovations
@ScienceFunInnovations 6 месяцев назад
You would just do a read command to get the new position value, then set that to the current position as is done in some of my other actuator videos.
@muhammadfakhry8797
@muhammadfakhry8797 6 месяцев назад
can you please give the link to the video so I can refer to the video @@ScienceFunInnovations
@moathnaji2763
@moathnaji2763 4 года назад
Hi …I want to control a dc motor making it rotate 10 times forward then pause for 3 seconds and rotate 10 times backward…. this rotation cycle back and forth will be repeated automatically 20 times exactly like the washing machine. What I need to do that?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
You could do that with a stepper motor ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aKxi7B4-d2U.html or else you would need a motor with position feedback such as an encoder.
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Also you could use an easydriver ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nafoHAhz8Ys.html
@shahrizanf
@shahrizanf 8 месяцев назад
Hi sir , if want to make this linearmotor system to move automatically, how to do it?
@ScienceFunInnovations
@ScienceFunInnovations 8 месяцев назад
I have some other videos on my channel that do that. Check them out.
@CzKaa
@CzKaa 3 года назад
Hmm, this basic simply code in arduino and drive have same function as only 2-pole switch with blind position in middle.... :)
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Pretty much, but you can also change the speed with this setup. Thanks for watching.
@WestKyCrime
@WestKyCrime 4 года назад
How do we contact you with out going to facebook? Looking to see if you would be willing to support the design for a controls system that is too long to describe here? Thanks In Advance Todd
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
I just added an email address in the "About" section on my RU-vid channel. If nothing else, I could read about your idea and possibly give some suggestions.
@duller9430
@duller9430 2 года назад
Is there any way of doing this without a motor driver
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Yes. You can do it with a dpdt switch.
@mackgonsalves8925
@mackgonsalves8925 2 года назад
Can a raspberry pi be used instead of the arduino?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Yes. The pi can do digital inputs and outputs, but at 3.3V instead of 5V. Most motor controllers will work with the lower voltage.
@daffaarfnd463
@daffaarfnd463 3 года назад
hai, how to make it move automaticly? like every 3 second actuator will change direction. i need for science project, sorry for bad english hahah
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
You could set it up in a 3 second loop that alternates between extend and retract mode. Start by deleting the code related to the buttons and just use the extend and retract commands. Good luck.
@sammoore9689
@sammoore9689 3 года назад
Did u upload your code anywhere?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Sorry, I can't seem to find it for that one.
@williamfrench1277
@williamfrench1277 4 года назад
I was wondering if the code was available to download?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Here it is: const int Retract_button = 2; const int Extend_button = 3; const int Stop_button = 4; const int Extend = 10; //Connect to L298N Pin In1 const int Retract = 9; //Connect to L298N Pin In2 void setup() { pinMode(Retract_button, INPUT); pinMode(Extend_button, INPUT); pinMode(Stop_button, INPUT); pinMode(Extend, OUTPUT); pinMode(Retract, OUTPUT); digitalWrite(Extend, LOW); digitalWrite(Retract, LOW); } void loop() { if(digitalRead(Retract_button)==LOW) { digitalWrite(Retract, HIGH); digitalWrite(Extend, LOW); } if(digitalRead(Extend_button)==LOW) { digitalWrite(Retract, LOW); digitalWrite(Extend, HIGH); } if(digitalRead(Stop_button)==LOW) { digitalWrite(Retract, LOW); digitalWrite(Extend, LOW); } delay(250); }
@nurjamahashiabdulle1711
@nurjamahashiabdulle1711 3 года назад
@@ScienceFunInnovations thanks 4 beautiful code with beautiful project 😍😍😍
@MattG101680
@MattG101680 3 года назад
What is the benefit of using this board over a relay board?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
With this board, you can adjust the speed. With a relay it is either full on or full off.
@MattG101680
@MattG101680 3 года назад
@@ScienceFunInnovations, thank you, that is great info. I have a project, that I am trying to figure out, and new to Arduino. Researching all the parts to see what is best. Im basically making power windows with auto up and down when you hit the switch. I just dont have it figured out yet, then I want to update the switch to a GPS module so the motor would run one way at a certain speed and the other at a certain speed. Its for a retractable rear spoiler on a car.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@MattG101680 The are GPS modules compatible with Arduino. You would probably need to convert the speed text string from the GPS into a number on the Arduino and then just run a simple if statement. You also may want to add a time condition so that it doesn't keep going up and down if you are cruising right at the trigger speed. Good luck!
@MattG101680
@MattG101680 3 года назад
@@ScienceFunInnovations, thats kind of what I was thinking, I thought id make it go down at 25 and up at 30. I have the GPS module on order, I thought maybe getting it set up by switch first is smart and then switch it to the GPS as the switch
@teddyruxpin3811
@teddyruxpin3811 2 года назад
Thanks but it would be nice if you put the code on github and put a link in the description or us
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
I don't have that code anymore, but from now on I will be posting much of my codes.
@teddyruxpin3811
@teddyruxpin3811 2 года назад
@@ScienceFunInnovations thanks. And thanks for the video. I got my first linear actuator working thanks to you
@MuhammadAwais-jh2dy
@MuhammadAwais-jh2dy Год назад
Sir why you use that white board?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
I did that video a long time ago, what white board?
@alicehenderson5445
@alicehenderson5445 3 года назад
Code isn't working
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
What error are you getting?
Далее
Maybe a little TOO much gel 😂
00:12
Просмотров 12 млн
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Просмотров 3,6 млн
Linear Actuators 101
19:44
Просмотров 772 тыс.
How to control Actuator using Arduino - Robojax
24:15
How To Control Linear Actuators with 12 VDC Relays
4:45
How to control a DC motor with an encoder
9:30
Просмотров 427 тыс.
Linear Actuators 101 - for Woodworkers
15:32
Просмотров 826 тыс.
APPLE дают это нам БЕСПЛАТНО!
1:01
Просмотров 772 тыс.