Тёмный

Linear Actuator Arduino Control - L298N with RC Transmitter and Receiver 

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

Linear Actuator Arduino Control using L298N Motor Control Board and RC Transmitter/Receiver
Join Science Fun on Facebook @ / sciencefun4u
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 using an RC controller. 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 • Linear Actuator Arduin... I used an L298N and a 3-button switch to control an industrial linear actuator. In this video, I use an L298N with an RC transmitter 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.
The following are affiliate links for products I used in this video. Using these links will not affect the price for your purchase but may result in a small commission for me, allowing me to keep making helpful and entertaining videos.
DumboRC X6 6 Channel RC Transmitter and Receiver ebay.to/2zbMIvF
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
Arduino GND to Breadboard GND Rail
Arduino 5V pin to Breadboard 5V Rail
RC Receiver GND to Breadboard GND Rail
RC Receiver PWR to Breadboard 5V Rail
RC Receiver Output to Arduino Pin 7

Наука

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

 

27 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@zanderschannel6416
@zanderschannel6416 3 года назад
thank you for so much help I have looked at loads of stuff on how to connect L298N to and RC Transmitter/Receiver today and this is by far the best.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Glad I could help
@randywetzler5976
@randywetzler5976 Год назад
Great video, precise and to the point! Followed your video to get my 3d printed actuator working with an RC controller which just happen to be the same DumboRC unit. Thanks for sharing!
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Glad it helped
@sanjaybhatikar
@sanjaybhatikar 3 года назад
I put an Arduino-controlled WS2811 LED strip by my little one's tent bed and gave her a keychain for on/off by RF relay. I want to use the concepts presented here so she can not only turn the lights on/off but access full capabilities of WS2811 from Dumbo controller like switching between color palettes and adjusting brightness. This is so exciting! Thank you for sharing.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Glad it was helpful!
@stevel3763
@stevel3763 2 месяца назад
Thank you! This is the information I was looking for. You laid it out very nice and explained it well! I am an RC/Arduino newbee and needed help. I did "Like" and Subscribed, I have an idea you have more great videos to learn from.
@ScienceFunInnovations
@ScienceFunInnovations 2 месяца назад
Awesome, thank you!
@mikemorris17
@mikemorris17 3 года назад
Brilliant video. I'm using an actuator to steer my electric outboard using RC. Your example was perfect. The only thing I can seem to get to work is the potentiometer feedback automatically bringing the actuator back to a mid position after the RC steering is centred.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I will be doing a video about that hopefully soon. I am waiting for my feedback actuator to arrive from China. (Of course I ordered it during their new year when they shut down for two weeks....)
@electricalcoder3025
@electricalcoder3025 4 года назад
Awesome work dude....❣️❣️
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Thank you so much 😀
@Loucaster1
@Loucaster1 3 года назад
flysky fs-i6 transmitter , receiver, arduino uno and l298n, Work perfectly to mee, Thanks a lot Science Fun, and wit your six channel transmitter, you can control a RC mini excavator whit 4 Linear Actuator, 2 motors , arduino, and 2 more L298N driver
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
It would be very fun to build an excavator or front end loader. I'll put it on my bucket list.
@hippielook
@hippielook 2 года назад
Great video, thank you for that! I have one question: How would you solve the idea of self-centering the actuator in a middle position. In detail: I would like it to steer a trolling motor. It would be great if it would just go straight when I let go.
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
I have been meaning to do that video for quite some time, but life keeps getting in the way. Hopefully I can get that one before the end of the year. Thanks for watching.
@Martin-ms4bu
@Martin-ms4bu 3 года назад
Great channel and cool projects! Just subscribed! What is the speed of the actuator you are using? I am working on a tiller pilot for my boat and I turned an actuator into a servo using gears and a potentiometer. My model looks like yours but seems to be not that fast.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I'm not sure, but I would guess about 1 in per second. Most are designed for force instead of speed, but there are some actuators out there that can go faster, like 4 inches per second. A little bit more $$ though... Thanks for watching!
@michaellodwig9495
@michaellodwig9495 4 года назад
This is awesome. I’m building a miniature boat for my kids and I’d like to use this for Rudder control. Would it be possible to have the actuator at halfway at steering neutral and then proportional extend/ retract based on steering input and return to halfway when the steering is neutral? I work in automation and instrumentation in industrial systems but I’m very new to Arduinos
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
They do make linear actuators with build in position feedback. Otherwise you could use a linear position sensor for position feedback. Perhaps that would be a good idea for a future video...
@smartmavi
@smartmavi 3 года назад
Hello, great project, thanks for sharing. I would like to know if we could write a command to steer back to the starting point after a manouver. For example, imagine you are driving a boat with an outboard engine; when you turn right, you don't want the engine to stay that way. When you release the steering, can the outboard (the actuator) can return to the starting point?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Yes you can! I will be doing a video about that in a few weeks. Stay tuned for that video.
@gerardlecomte4711
@gerardlecomte4711 2 года назад
Hi, I am French and live in France and I have 3 projects to carry out. 1st project: Build a system with tilting hatch that will be operated by a 20kg servomotor controlled by an ultrasonic presence sensor HCSR04 (for distance 4 to 25cm) I will use an Arduino UNO + shield L298P 9V External Power Supply 2nd project: Build a system with tilting hatch that will use a 12V linear Actuator, 150mm stroke, 150 mm/s speed. controlled by an ultrasonic presence sensor HCSR04 (for distance 4 to 25cm) I will use an Arduino UNO + shield L298P 12V external power supply 3rd project: Build a system that will use a 12V linear Actuator, 100mm stroke, 14 mm/s speed, controlled by a light sensor for opening a door in the morning and closing it in the evening I will use an Arduino UNO + shield L298P 12V external power supply By consulting the various tutorials available, I did not find the solution to my projects . Could you help me find the programming of my Arduino boards If you need additional renderings, I am at your disposal. Cordially
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
I hope to make more linear actuator videos soon.
@TheCj71984
@TheCj71984 Год назад
Great video could I apply this to just a switch on the controller? So either all the way in or all the way out ?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Yes you can! I have other linear actuator videos which may help you do that.
@rolis8419
@rolis8419 2 года назад
Awesome project! Can two actuators be controlled using this set up?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Yes, but they may travel at different speeds. You could always use two channels from the RC to control each one separately. Also, just did another video about actuator position control that you may be interested in.
@HAL9000-B
@HAL9000-B 9 месяцев назад
i think you could also just connect an RC DC ESC to it and control it directly without the Adruino. I use it to steer my boat :)
@ScienceFunInnovations
@ScienceFunInnovations 8 месяцев назад
Yes, could be done without the Arduino.
@mauriciotellez5241
@mauriciotellez5241 2 года назад
hi, excelent work and well explained, i have a question, ¿ how many actuators we can activate with this rc?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Depends how you want to control them, but up to 6 since this has 6 channels
@bluev88
@bluev88 3 месяца назад
I will Use it for Self made rc car. Butt Cold also work on an rc window opener for our attic 😅
@ScienceFunInnovations
@ScienceFunInnovations 3 месяца назад
Nice!
@user-kq6kw9rn3d
@user-kq6kw9rn3d 4 года назад
I always have a good fit. Does this bear a high weight like 80 or 90 kg?
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
I think this actuator is rated to 150kg.
@NickXabias
@NickXabias 3 года назад
wow cool ! is it possible to make it self center ?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
I will be doing a video about that soon. Waiting for some parts to arrive in the mail.
@NickXabias
@NickXabias 3 года назад
@@ScienceFunInnovations oooh cool. I'm working on a hydraulic steering monster truck and i try to figure out how to make it self center.
@NickXabias
@NickXabias 3 года назад
@@ScienceFunInnovations I had the idea from this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-BF_mSsvssYw.html as i can see he has a module that looks very similar to motor driver l298n, a receiver and a potentiometer hooked up to the wheels.
@LSUtiger607
@LSUtiger607 3 года назад
Is it possible to use the Arduino to read the position of the actuator?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Yes. I will be doing another video about that soon. I am waiting for some parts to arrive (may take a few weeks) then I'm planning on discussing that. Subscribe and turn on notifications so you don't miss it. Thanks for watching.
@chaithanyaprasadch3474
@chaithanyaprasadch3474 3 года назад
Hi, i just tried it flysky fs-i6 transmitter and receiver, uno and l298n. It just doesn’t work Can you please help
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
What exactly is going on? Is the Uno reading the pulse width from the receiver?
@DadHacks
@DadHacks 3 года назад
Hi! What’s the name of the product that inserts into the pin on the wiring? It looks like a black object, maybe an inch long. I’m trying to figure out what it is because when I use just the wiring, it’s too loose to stay clamped down
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Not sure which part you are referring to... part of the actuator? arduino?
@DadHacks
@DadHacks 3 года назад
@@ScienceFunInnovations it’s at 2:27 on the video. The red and black wires connect to the Arduino. It’s looks like the red and black wires have a black piece at the end the makes it easier for them to connect to the Arduino instead of just the wiring being bare
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@DadHacks dupont jumper wires. You can buy wires prebuilt with male and/or female end. You can also just buy the dupont connectors and crimper tool. Check Amazon or Ebay for pre built jumpers. Hope that helps.
@bobhodgens5096
@bobhodgens5096 3 года назад
I am using a Fly Sky FS-GT5 with an aurduino Uno and a Cytron Shield-MDD10 to control a linear actuator to extend and retract. The Cytron Shield-MDD10 can operate in a dual PWM mode and output on the Arduino pins 3 and 9 for the for the motor. According to Cytron I would use a "PWM_PWM" Command example "(PWM_PWM, 3, 9); ". Can you tell me how and where I would incorporate it into your code for the RC control?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Not familiar with that board, but I would imagine the PWM commands would just replace the AnalogWrite commands in my example.
@bobhodgens5096
@bobhodgens5096 3 года назад
@@ScienceFunInnovations OK, Thanks for the reply> Have you gone any further with the RC controls, added any functions? I am working on a project to remote control a go kart for a young disabled boy. Using Linear actuators for the steering and brakes.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@bobhodgens5096 Still waiting for some parts to arrive from China, but then I do hope to do another RC linear actuator video soon.
@jerimiahake
@jerimiahake 3 года назад
I want to make the actuator return to the original position after releasing the steering on the controller.
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
If you want it to return all the way retracted or extended, that would be easy to do. Just command it to retract or extend when in the neutral position. The built in limit switches will stop if from going too far. If you are trying to stop somewhere in the middle, you would need some sort of position indicator to provide feedback. Perhaps in a future video...
@chaithanyaprasadch3474
@chaithanyaprasadch3474 4 года назад
Great work👍👍 can you help me with controlling linear acurator with 3 position switch (CH4)
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
Something like this? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qLltghqVrvI.html
@chaithanyaprasadch3474
@chaithanyaprasadch3474 4 года назад
Science Fun yeah 😊 thanks👍
@chaithanyaprasadch3474
@chaithanyaprasadch3474 4 года назад
Can you please help me converting the arduino program from analog joystick to Rc joystick (flysky fs-i6) right gimbal(auto centre) 👇👇👇👇👇👇. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-cYIL5gxRogM.html
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
@@chaithanyaprasadch3474 Are you trying to match the position of the slide with the position of the joystick? Or are you simply trying to make it go left when pushed left and go right when pressed right? Same travel speed or variable travel speed based on joystick position? You may want to check out my easydriver video and my RC library on my channel.
@chaithanyaprasadch3474
@chaithanyaprasadch3474 4 года назад
@Science Fun i want to match the position of slide with the joystick
@boykeification
@boykeification 3 года назад
how about not using arduino,just use tiny servo module board? can we?and how to wiring the cables?thanks
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
It would depend on the current rating of the board. Linear actuators can pull a lot of amps depending on the load. Even the L298N can only handle low loads.
@redrighthandarts
@redrighthandarts 5 месяцев назад
So how would you make it self center?
@ScienceFunInnovations
@ScienceFunInnovations 4 месяца назад
I have another video about that. Check it out. Thanks!
@ramaaditiahadikusuma7523
@ramaaditiahadikusuma7523 2 года назад
how much current is required to drive the linear actuator using the L298N motor driver?
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Depends on the actuator and voltage. The L298N can only handle medium loads. I am now using the BTS7960 for my actuator projects. I can handle much more current.
@MichaelRHead-zv2zf
@MichaelRHead-zv2zf 3 года назад
what if i want it to work like a servo? any help with that?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Yes. I am waiting for a new actuator to arrive from China (might take 3-4 weeks), then I'm planning on doing a video about that.
@MichaelRHead-zv2zf
@MichaelRHead-zv2zf 3 года назад
@@ScienceFunInnovations are you buying one with a feedback pot already installed or are you adding one? i looked at the ones with the feedback already installed and they were just to dang expensive
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
@@MichaelRHead-zv2zf Yes, I'm getting one with an internal pot. You can also get an external pot (I'll show it in the video as well) which can save some money.
@martinsmith5014
@martinsmith5014 3 месяца назад
How could I do this using the BTS 7860?
@ScienceFunInnovations
@ScienceFunInnovations 3 месяца назад
The BTS is very similar except that it doesn't have 5V power supply. Perhaps soon I will do a video using one. Thanks!
@tommilner5415
@tommilner5415 4 года назад
hye i am using one of these for my project that I'm making could you explain the basics a bit more
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
If you haven't seen it already...this video may help: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qLltghqVrvI.html. Do you have any specific questions? Thanks!
@tommilner5415
@tommilner5415 4 года назад
@@ScienceFunInnovations if i did a remote control to three actuators what would everything look like can you help me out
@ScienceFunInnovations
@ScienceFunInnovations 4 года назад
@@tommilner5415 I am assuming you would want to control all 3 separately? You would need to use 3 channels of the RC and 2 motor control boards (the L298N can control 2 actuators). If you just want extend and retract, you can use digitalWrite, which is easier like in the video with 3 buttons. If you want speed control you would need 6 PWM pins and copy what I did in the RC video 3 times. Does that help?
@tommilner5415
@tommilner5415 4 года назад
@@ScienceFunInnovationsso I need 3 - 4 actuators that have work separately on the remote control so all they need to do is connect to a receiver which I was planning on using an Uno and 4 relays with a receiver with 6 channels so I have room if I need anymore. Does this sound like it could work? thank you Tom Milner
@skmkh6964
@skmkh6964 2 года назад
If I want motor work , Example motor movie 30 turn . This code can control with motor .
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Not sure that this code would work for that, it would need to be modified.
@takebuis1
@takebuis1 3 года назад
Hi, What a great video! It was very helpful to understand some basics. I have a little project of my own trying to do exactly as in your video but not with an RC remote, but a simple potmeter. I tried to rework your code to make it work but since I don't know what i'm doing yet it doesn't work. Can you help me out? this is what I turned it into: const int pot = A0; //connect to POTMETER channel A0 const int Extend = 10; //Connect to L298N Pin In1 const int Retract = 9; //Connect to L298N Pin In2 int val; void setup() { pinMode(pot, INPUT); pinMode(Extend, OUTPUT); pinMode(Retract, OUTPUT); digitalWrite(Extend, LOW); digitalWrite(Retract, LOW); } void loop() { if (val = 500) { analogWrite(Extend,0); analogWrite(Retract,0); } if (val > 520) { analogWrite(Extend,0); analogWrite(Retract,map(val,520, 1023, 51, 255)); } if (val < 500) { analogWrite(Extend,map(val,500, 0, 51, 255)); analogWrite(Retract,0); } delay(100); }
@takebuis1
@takebuis1 3 года назад
Hey, never mind my question, I figured it out and got it working!!
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Glad you got it to work!
@takebuis1
@takebuis1 3 года назад
@@ScienceFunInnovations Thanks, too bad I later blew up my L298N by trying out an additional code to add some buttons that would need to override the POT meter. I suspect that not using the PULL_UP function caused the actuator to move back and forth until the L298N got so hot it damaged internally.....
@aizakkitoty9154
@aizakkitoty9154 2 года назад
Hi. Im trying to do the same system with a potentiometer but i never did an arduino so it s a bit complicated.
@sashankkairatee
@sashankkairatee 2 месяца назад
Hello sir I need your help please help me 🙏
@ScienceFunInnovations
@ScienceFunInnovations 2 месяца назад
What is the problem?
@sashankkairatee
@sashankkairatee 2 месяца назад
@@ScienceFunInnovations sir i am working on my dream project so i need your help please help me sir
@indycoltfan4208
@indycoltfan4208 3 года назад
Can you please explain this in English?
@ScienceFunInnovations
@ScienceFunInnovations 3 года назад
Too much tech jargon???
@indycoltfan4208
@indycoltfan4208 3 года назад
@@ScienceFunInnovations I'm trying to do this on an airplane controller. So-far I've been told 3 different ways to do it. Your way is making my head hurt.... lol
@albon4038
@albon4038 Год назад
hi do you have any contact platform for pm. Email or Facebook?
@ScienceFunInnovations
@ScienceFunInnovations Год назад
sciencefunbiz@gmail.com
Далее
How to control a DC motor with an encoder
9:30
Просмотров 427 тыс.
Arduino in a commercial product?
7:17
Просмотров 19 тыс.
iPhone 15 Pro в реальной жизни
24:07
Просмотров 449 тыс.
АЙФОН Г0ВН0
0:54
Просмотров 1,3 млн
#engineering #diy #amazing #electronic #fyp
0:59
Просмотров 2,2 млн