SBUS to PWM decoder on Arduino

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • НаукаНаука

Комментарии • 27

  • @jamesx7424
    @jamesx7424 3 месяца назад

    I clicked subscribe when you said, “this little chap here.” 3:10
    Thanks for the video, this answered the exact question I had about using an Arduino with sbus

  • @mariobocian8344
    @mariobocian8344 Год назад

    Atmega8 works perfectly fine. no delays

  • @ceptimus
    @ceptimus  4 дня назад

    Some Nsnos have the transmit and recieve pins swapped (D0 and D1) so try swapping the output pin (drain) of the inverting FET to the other pin. If that makes no difference, tell me the exact make amd model of receiver you're using, and I'll try to reproduce your setup and see if I can get it working. On a genuine Nano, connectionis to RX0. Make sure you have a common GND to the Nano, FET, and receiver. Some clone Nanos have the pins RX0 and TX1, mislabeled and/or swapped over compared to a genuine Nano.

  • @fdm225
    @fdm225 4 дня назад

    any suggestions on how to debug this if I do not have a oscilloscope? I have tried my reciever (FrSKY) plugged into an actual SBUS decoder and it works fine, when I plug it into the Arduino I am not seeing anything wrt movement when I plug the servo into D2 nor am I seeing the RX light on the arduino show any indication of activity. I am using a brand new OEM Nano along with 2n7000 transistors that I purchase on Amazon. Really want to get this working so that I can use it in other projects so any help would be greatly appreciated!

    • @ceptimus
      @ceptimus  4 дня назад

      Also, make sure you have a common gnd connection to the nano, FET, and receiver.

    • @fdm225
      @fdm225 4 дня назад

      @@ceptimus Thank you for the response. I checked all the connections with a multi-meter and it all comes out good. I have a common row for GND on my breadboard and everything is plugged into it (servo, arduino, receiver) as well as power. I have even tried to put the pull up resistor that you said was needed for other transistors with no luck on that as well.

    • @ceptimus
      @ceptimus  4 дня назад

      @@fdm225 What model of FrSky receiver are you using? I may have one, and if so, I can try some tests myself.

    • @fdm225
      @fdm225 4 дня назад +1

      @@ceptimus Archer RSPlus Mini, the interesting thing is I found a different library where using a soft serial port (and a serial adapter) I can print out the values and I got that to work; so I confirmed that my setup is correct from a hardware perspective. I am looking at the difference now between the two programs as the other project doesn't put the output to control servos and is only printing the values to the SoftSerial port.

    • @ceptimus
      @ceptimus  3 дня назад

      @@fdm225 Ah, I don't have any Archer receivers, nor a transmitter, so I can't test that. It does sound like a bug in my code, sensitive to some slight difference, perhaps in the timing, of the SBUS signal from the Archer, is stopping my sketch from working. I hope you have success in comparing the SBUS decode routine in the working project with mine, and fixing the faulty code in my project.

  • @The_dream_of_flying
    @The_dream_of_flying 2 года назад

    Nice, it works perfect. Thanks.

  • @antoniobertola6096
    @antoniobertola6096 11 месяцев назад

    Hi Ceptimus the decoder works excellently with servos, but does not work when I connect an esc for brushless motors. Can you help me?
    Thanks

  • @MightyFlights
    @MightyFlights Год назад

    Hi ceptimus! Thank you for sharing your excellent work!
    Any chance I can ask you to modify one of the sbus to pwm outputs to convert input 1000-2000 to output 500-2500?
    It's needed to control PAN servo to rotate to extended degree. Thank you!

  • @AV-81
    @AV-81 2 года назад

    Hey man! great project! been following this since the last video, and I have to thank you for what you're doing to help out people like me (noobs :p)
    I took a look at the sketch that you uploaded, and it is a little complex for me... since I wanted to edit the code to put some failsafes using the arduino, I was wondering if you had any luck with the bolderflight SBUS library, or any libraries of that sort... and the arduino nano/uno. I could not get it to work with the esp32 and my frsky r9mx receiver...
    If you do get anything working for the same, it'd be very helpful for me.
    Thanks :)

  • @toonversespace
    @toonversespace Год назад

    can you tell me about dji phantom 2 receiver?
    inverted sbus or normal sbus?

    • @ceptimus
      @ceptimus  Год назад

      I think it's inverted SBUS, but I'm not completely sure - I don't own any DJI equipment myself.

  • @gaminglegend6700
    @gaminglegend6700 2 года назад

    Thanks you so much can you provide the schematics of this?

    • @ceptimus
      @ceptimus  2 года назад +1

      It's very simple. Here's a rough schematic: ceptimus.co.uk/sbus2pwmSchematic.jpg If you think your battery / power supply might exceed 6V connect to the Arduino's Vin, or RAW, pin instead of VCC. Most cheap servos will also be damaged by voltages much higher than 5V.

    • @gaminglegend6700
      @gaminglegend6700 2 года назад

      @@ceptimus Thank you so much for the Code

    • @gaminglegend6700
      @gaminglegend6700 2 года назад

      and schematics

  • @easyfpv3606
    @easyfpv3606 2 года назад

    Woww nice my friend i sescruibe and like nice job. Tell me this sketcz will work on arduino onu or mega??

    • @ceptimus
      @ceptimus  2 года назад +1

      Works on Uno, Nano, Pro Mini. I've not tried it on a Mega yet.

    • @easyfpv3606
      @easyfpv3606 2 года назад

      @@ceptimus you are the best . I am many time want to know how to do the code . To make joystick of computer conecct by USB and send ppm out OR ppm out from the arduino so then i can fly all my drone or wing with the joystick , do u have idea how to make this ??? (Like windbox usb )

  • @haminurmanhamami
    @haminurmanhamami Год назад

    what transsitor you use?

    • @ceptimus
      @ceptimus  Год назад

      If you use a 2N7000 N-channel MOSFET, then no resistors are required. Or you can use any general purpose NPN transistor, such as a BC337, but you'll need two resistors - one in line with the base, and a pull-up on the collector. The resistor values aren't critical - you could use 1K for both.

  • @AmjadAlirc
    @AmjadAlirc 2 года назад

    Make pwm to sbus

    • @ceptimus
      @ceptimus  2 года назад +1

      I don't know how useful that might be, but it's an interesting coding challenge on an AtMega328 to do it with 16 (or 18) PWM channels simultaneously, and try to limit the measured pulse width inaccuracies to about 1 microsecond - that would limit any jitter to an insignificant and invisible 0.1% of the servo travel range. I've started to think about how it could be done, and if I'm sufficiently intrigued I may have a go at it: it's going to need a bit of assembler code, but the Arduino IDE can do that okay.
      It would be much easier to do it on a Pi Pico, with its faster clock speed and PIO state machines - and Pi Picos are about the same price as a clone Arduino nowadays ($5). But I prefer the challenge of doing it the hard way on an 8-bit micro running at 16MHz, that only does edge detection interrupts on groups of 8 pins. (There are also two dedicated interrupt pins, but those aren't much use when trying to do multiple PWM channels).

    • @theflyinggrip
      @theflyinggrip 29 дней назад

      @@ceptimus I want to take a rx input and pass those controls to a rc tx module…repeater essentially. Is this possible? Would you do a decode to encode or is there a way to just pass sbus through arduino or raspberry pi? Great find, cheers.