Тёмный

Reading PWM Receiver Signal Using Arduino 

Kamran Ahmad
Подписаться 694
Просмотров 68 тыс.
50% 1

Here I show you how to decode a PWM signal coming from a Turnigy receiver using an Arduino Mega board. This program should run on any Arduino board and should be compatible with every receiver.
If you have any questions or want me to explain something else or in more detail, leave a comment.
Thanks

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

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 127   
@ezcook57
@ezcook57 8 лет назад
Nicely done. Just what I was looking for. Very much appreciate your time and effort expended in this effort.
@bbrao778
@bbrao778 3 года назад
Just what I was looking for... 👍
@dshep101
@dshep101 4 года назад
many thanks, just wanted a simple way to get my board and receiver talking and after alot of overly complex explanations your's did the trick!
@MixZTitaniumDubstep
@MixZTitaniumDubstep 8 лет назад
I'm working on an ECX Circuit model RC. What I'm trying to accomplish is: 1. convert 2 channels (aileron+rudder) into one steering channel 1a. aileron=strafe 1b. rudder=steering 1c. strafe will add difference from center of aileron then subtract that value via the Arduino clock, therefore simulating what a real car does to change lanes 2. convert 2 other channels (throttle+elevation) to one drive channel 2a. elevation is forward/backward drive 2b. throttle is maximum speed
@hilmidwiputranto6944
@hilmidwiputranto6944 8 лет назад
thank you so much, this video helps me a lot. Now i can switch my led on and off on my quadcopter using remote
@robertbuckles3596
@robertbuckles3596 5 лет назад
i have been searching for this for a very long time! EXCELLENT!!!!
@weimarvillarreal2346
@weimarvillarreal2346 5 лет назад
thank you very much I was looking for a pwm signal reader and it helped me a lot to simplify my code
@profsacin
@profsacin 8 лет назад
Well explained. Just what I was looking for to build an arduino led controller for my plane. I played the video at 1.5 speed though
@laurentmaillard1355
@laurentmaillard1355 4 года назад
2020 and still relevant ! Thank you !
@georgesmith8988
@georgesmith8988 3 года назад
Great I’ve been looking for ages for code that can read a PWM signal, thanx
@fabriciob8960
@fabriciob8960 5 лет назад
Man, myass belongs to you. THANKS a lot ! Greetings form Mexico
@AmPleanGaming
@AmPleanGaming 3 года назад
thanks bro it was too simple than i though bery very thank you
@furkankuyumcu8243
@furkankuyumcu8243 4 года назад
Thank you so much.Greetings from Turkey
@dondominic7404
@dondominic7404 3 года назад
Exactly what I was looking for. Thanks
@imales40
@imales40 3 года назад
Kamran Ahmet Very good work I tried it on Radiolink AT 10, it worked great. Thanks bro.
@dronesvisionsaeriennes
@dronesvisionsaeriennes 6 лет назад
Hi Kamran, very good explainations...i'll try it because i didn't know how to do this....good video...thank's a lot...Phil
@captainric2364
@captainric2364 4 года назад
Just what I was looking for! Thank you!
@joekirklin
@joekirklin 5 лет назад
Excellent explanation. Thank you for sharing your knowledge.
@aptoni
@aptoni 5 лет назад
Hi Ahmad, thank you so much for this tutorial. Easy to understand. Great work!
@demersonrocha
@demersonrocha 7 лет назад
Great job, can I connect a servo at the output of the arduino and veil interpreting these signals?
@Kotobuben
@Kotobuben 3 года назад
thanks a lot man, easy & quick, just what I was need!
@willridgway2513
@willridgway2513 2 года назад
Got the code to work with my Turnigy 9x! thank you
@dronesvisionsaeriennes
@dronesvisionsaeriennes 5 лет назад
Hi Kamran, i get 4 channels on my Delta8 receiverthen i add another one ( the sixth) to plug a servo..for this moment i get 5 responses on arduino serial monitor (115200 bauds )....more important i understand what the arduino do....! great thanks to you Philippe
@eletronicaparaohooby
@eletronicaparaohooby 7 лет назад
Hi friend, very well explained. But I saw a video of your previous explaining about the interruptions. I use the Arduino pulsein command, but I do not know if you already tested it with this command? It takes too long wend not a signal !! Turn off your radio and implement a messaging routine, for example, to see how long the response time takes when there is no signal. I tried to do an if check : if (digital read (channel1, HIGH)) {Time = pulsein (channel1, HIGH)} He does not accept this type of verification. There's a video explaining about the interruptions and the 4 ports. How can you post a code explaining how to read 4 physical channels in arduino ?? The other video reading ppm on a single channel is great !! Thank you
@jakubrendek8406
@jakubrendek8406 4 года назад
Please can you create a new video about sending recived pwm signals to servos ? Thanks
@dronesvisionsaeriennes
@dronesvisionsaeriennes 5 лет назад
hi Ahmad i've just discovered your video which is very interesting ...i've understand some things and i get a good result with my X8r receiver on Arduino Nano...4 channels run with your program and i get the variables about 1500 to 984 or 2050 etc... when i move the sticks on my Taranis Plus...but when i plug only with Sbus ... + on Vin ( arduino ) then - on GND ( arduino ) then the Signal from receiver to arduino i don't know exactly where i have to connect this yellow ( or orange ) wire ...and i get Nothing... thank's for your next answer Philippe
@dronesvisionsaeriennes
@dronesvisionsaeriennes 5 лет назад
hi Kamran, very good job...but is it the same wire to connect a X8R receiver with Sbus and arduino nano...? Thank's a lot
@ImperialLightandMagic
@ImperialLightandMagic 2 года назад
Hi, thank you so much for posting this video. I have a strange issue however where the arduino runs incredibly slowly if I upload this code (tried on a nano and a mega). My output println only displays about once per second. The arduino's are fine with other example sketches. Any idea what may be causing this?
@umairm.5662
@umairm.5662 6 лет назад
Nice one. Now, I have an idea how to perform it using cortex.
@longhornmopar
@longhornmopar 7 лет назад
Great video! Very clear and well-made. Thanks.
@massimilianonball
@massimilianonball 8 лет назад
Hy!! Many compliments for your tutorial. Is there a way to receive the pwm input directly in a raspberry pi, rather then an arduino board? I need the raspberry because i must use a linux distribution to make other stuff with the pwm input from the receiver of my drone's remote. Many thanks
@LeeRaven-rb4dp
@LeeRaven-rb4dp 3 года назад
Hey man,just wanted to know if are u using this to make the Arduino as a receiver?Total newbie here.
@sbpcls
@sbpcls 3 года назад
the tx you are using include a ppm out pin and a ppm in pin . on the main board inside. if you connect the tx out on the transmitter and solder a wire . can you see the same readings?
@vamshioruganti6319
@vamshioruganti6319 5 лет назад
Nice sir. Very clear explanation thnksalot. I've one doubt How to turn on led or relay useing this signal by one moment of the joystick.
@atuwa5705
@atuwa5705 5 лет назад
how did you do this? I want to control a servo motor with the PWM inputs.
@ricardrinaldo4791
@ricardrinaldo4791 4 года назад
Just what I needed, thanks. :)
@TheSateef
@TheSateef 5 лет назад
any reason why you used a double and not an int?
@Reach3DPrinters
@Reach3DPrinters 7 лет назад
Most excellent. Thanks Kamran.
@GurpreetSingh-bh3wk
@GurpreetSingh-bh3wk 4 года назад
Thanks for the video, very helpful
@MMT_Pii
@MMT_Pii 4 года назад
I love you for making this video
@ishakamrani7891
@ishakamrani7891 8 лет назад
can i genirate tow pulse signals and controle the dutu cycle of each one ? in real time ? for example the firste signle start with 5V the second start from 0 at time 0s. and thanks for eplication.
@TheF22raptorang
@TheF22raptorang 3 года назад
So easy to understand i love it
@paveldvorak8245
@paveldvorak8245 4 года назад
Super, you opened my eyes :)
@thomasalexander1563
@thomasalexander1563 7 лет назад
Amazing,,, Very rare tutorial.. This is very usefull..
@yashrathore2935
@yashrathore2935 7 лет назад
is it necessary to connect the Reciever signal pins to the PWM pins of the Arduino or it can also work by connecting with the digital pins??
@oskanooskano5507
@oskanooskano5507 3 года назад
once you get those values, how do you write them to receiver, would you be using analogwrite?
@airdesigner4053
@airdesigner4053 2 года назад
Nice video, but how can I use pwm signal to set pin High or Low?
@chefseg
@chefseg 4 года назад
Great video - thank you!
@degklump1999
@degklump1999 6 лет назад
Good instructional video! But how to translate the rc pwm signal to 0-5Volt out signal??
@Raamkrishnadas
@Raamkrishnadas 9 месяцев назад
Can I set these times as binary 1,0? Suppose 8ms high is 1 , 16ms high is 11, 8 ms low is 0. Like these.
@Anton-sz6ef
@Anton-sz6ef 5 лет назад
Can I do that with an external ADC ? I mean, I do realize it's useless to do that, but still I wanna try it out once my board comes.
@tayefmahmud9515
@tayefmahmud9515 4 года назад
can you please help by adding the "if" and "else" code in this function acoding to the value of recever
@carlosangelpatriciomartine3903
Thanks for your video. It helped me with my project.
@easyfpv3606
@easyfpv3606 2 года назад
U are the best . How we can get ppm out and make ppm in
@LUIS-yh6nd
@LUIS-yh6nd 7 лет назад
hi friend, exelent proyect! I need read the code wltoys control transmitter... can I use this program for that?
@MrRAJASEKHARi1996
@MrRAJASEKHARi1996 5 лет назад
Thank you bro ! Appreciate it.
@drb41602
@drb41602 3 года назад
For your next challenge, read a sbus receiver.
@srinivasasatya6797
@srinivasasatya6797 5 лет назад
Can you tell me how can we read the values directly from the transmitter directly and send it to another receiver like nrf24l01 or other
@SuperUnhappyman
@SuperUnhappyman 7 лет назад
im working with a coin reader that releases a pulse width after a coin is accepted could i read it if i did the same thing as you did in this video?
@lionxuser
@lionxuser 8 лет назад
this is exactly what i was lokking for, thanks a lot :)
@高东-y2f
@高东-y2f 7 лет назад
thank you very much. i use hubsan H320f transmission and RX i connect 2 channel on rx with arduino UNO as you do in your vedio.but the serial monitor shows both channel are 0 us.and when i disconnect the GND line , both channel change a lot 8000-10000.Do you know what is the matter ?
@MakerDan55
@MakerDan55 8 лет назад
Thank you for this. Can you show us how to take the input signal now that you can see it in the serial monitor and then convert it (map it) to a servo signal to send out to a servo?
@krioulai
@krioulai 3 года назад
write a simple equation that turns if from min max values into 0-100. You can ther map the 0 - 100 to a the servo using a variable
@daravind8475
@daravind8475 8 лет назад
also, pls tell me how to calculate the phase difference between these receiver signals?
@jatiwicaksono5543
@jatiwicaksono5543 4 года назад
Thank you, great tutorial !
@siddharth4662
@siddharth4662 8 лет назад
great video!!! you got a subscriber. :-)
@LucasVieira-qq5lw
@LucasVieira-qq5lw 7 лет назад
do you know how to control ppjoy or another virtual controller with these numbers? tks
@krisharris4158
@krisharris4158 7 лет назад
Thanks! Very helpful
@whathefunctr
@whathefunctr 7 лет назад
I did push the like button and sub to your channel You are awesome bro :)
@ratankamble2195
@ratankamble2195 7 лет назад
i m working on tilt arm quadcopter , so can i use this values for rotate the servos using map ()
@russellking747
@russellking747 7 лет назад
Perfect! You my friend, are subbed!
@andresgolfgti
@andresgolfgti 7 лет назад
nice job, thank you!
@atomsbaza2
@atomsbaza2 7 лет назад
If I write "myservo.writeMicroseconds(channel[0])" It will send value of PWM to other controller?
@Enzo-xw7hj
@Enzo-xw7hj 8 лет назад
Question, how do you write these PWM signals to control the servos, using the transmitter to control the servos like a knob function?
@kamranahmad6808
@kamranahmad6808 8 лет назад
Depends on what servo you are trying to control. Most servos in RC world are designed to work with PWM signal and can be connected directly to the receiver. But sometimes some calculation needs to be done before outputting to the servo, like snapping or balancing. In this case a micro controller is usually connected between the receiver and servo. This video should help ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QNq0UXsrwTY.html
@Enzo-xw7hj
@Enzo-xw7hj 8 лет назад
Is it right to say, that by connecting a microcontroller between the receiver and the servo, the Arduino code would give the servo a position? without it, the servo would be free to control base on the transmitter signal?
@Mecatronicgarage
@Mecatronicgarage 8 лет назад
Good explanation
@atech6580
@atech6580 3 года назад
How can I save and output the same signal to another pin on the board.
@whathefunctr
@whathefunctr 7 лет назад
I did it but have some problem motor is every time going to forward not going to back and the second channel ( I put the motor ) is turning to right dont turn to left (my english is very bad I am Turkish ) please help me
@yaqop8581
@yaqop8581 5 лет назад
Good vid
@SkyhanViper
@SkyhanViper 7 лет назад
thank you buddy, super easy
@ramazans8114
@ramazans8114 7 лет назад
Hello, is it possible the program it while joystick is middle position , pwm is %,0 , Down side %50 , up side %100. If possible I can remote caterpillar skidloader ;)
@atuwa5705
@atuwa5705 5 лет назад
how do I use the PWM inputs to steer a servo motor?
@AhmadFauzi-lc6dp
@AhmadFauzi-lc6dp 6 лет назад
hi kamran , can u teach me ? how make it to acces motor driver and servo on arduino with a Tx Tgy 9x . please, show me. thank's .
@HungNguyen-oz1jc
@HungNguyen-oz1jc 2 года назад
I used your code but the PWM signal does not print out like yours instead it jumps crazily from 0 -> 10000, what was the problem?
@narenku6759
@narenku6759 Год назад
hi i have the same issue did you solve it?
@jamawahid9408
@jamawahid9408 4 года назад
u have a beautiful pen
@ehsanaz1928
@ehsanaz1928 3 года назад
دمت گرم داداش
@nezbut7
@nezbut7 5 лет назад
this works well! thank you
@shanmenaka4821
@shanmenaka4821 6 лет назад
thanks a lot very help full good luck
@daravind8475
@daravind8475 8 лет назад
what is the unit of these values shown?
@tranthanhhai3239
@tranthanhhai3239 8 лет назад
I used flysky i6,, but do not get value from 1000us to 2000us range. Instead, unstable values from 80 to 10000us. Tell me the cause and how to fix it?
@Bisofication
@Bisofication 7 лет назад
Well, you don't need to fix it because it's not broken. Every company uses numbers and values that can be different from other transmitter/receiver companies.
@simpleman9441
@simpleman9441 3 года назад
Thank you Sir
@yaqubshuaib5060
@yaqubshuaib5060 5 лет назад
Sir how can I write this input signal as same as output Pls help me.
@enterabhi2941
@enterabhi2941 5 лет назад
Thanks For this....
@stavroshouiris
@stavroshouiris 5 лет назад
what's the point if you end up with these huge fluctuations, I feel as if this is an unreliable solution because of how un-precise it ends up being
@domel1410
@domel1410 Год назад
very goog very good
@fandiafrizal5363
@fandiafrizal5363 7 лет назад
thanks bro
@boubalex5846
@boubalex5846 8 лет назад
Can I take from arduino, PWM with duty cycle 20% and frequency 10Khz or 20 khz???
@kamranahmad6808
@kamranahmad6808 8 лет назад
Yes it is possible, look at www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM
@raoufsmida6220
@raoufsmida6220 7 лет назад
how can reading the impulse from the meter electronic
@imamsuryadinata5252
@imamsuryadinata5252 4 года назад
and how to output mode from arduino to receiver fs ?
@tharindudissanayaka5863
@tharindudissanayaka5863 5 лет назад
good job broh
@gustavferdman214
@gustavferdman214 7 лет назад
Thank you!
@diwaperkasa2351
@diwaperkasa2351 6 лет назад
thank dude!
@noviukx
@noviukx 5 лет назад
Change the name to "Reading Multiple PWM Signals Using Arduino" Easy to find how to read single signal, but more than one not. I skipped this video few times because i thought its about single PWM signal. Big Thanks.
@rahulghosh4289
@rahulghosh4289 5 лет назад
Thankyou
Далее
Why build an entire computer on breadboards?
28:43
Просмотров 3,1 млн
Arduino DRONE II   Part 1 receiver PWM read
10:22
Просмотров 57 тыс.
6 Horribly Common PCB Design Mistakes
10:40
Просмотров 206 тыс.
Reading PWM Values from an RC Receiver using Arduino
4:06
Op-Amps  - Using Operational Amplifiers
44:21
Просмотров 289 тыс.