Shop OBEX P1 Docs P2 Docs Learn Events
Convert PWM from DX8 to simple on off with BS2? — Parallax Forums

Convert PWM from DX8 to simple on off with BS2?

LAMBERTechLAMBERTech Posts: 1
edited 2012-12-07 11:12 in General Discussion
Hi Everyone,

I recently built a DJI Hexacopter for attaining aerial video for customers and would like to expand my on board control beyond the PWM to servo control that I have now. For instance, the arms are surrounded by LED lights, I would like to be able to turn these on or off mid flight without having a servo pushing a button. Can I use a BS2 to receive the PWM from the Spektrum receiver and convert it to simple on/offs?

Thanks,
Rob Lambert


IMG_6185.jpg
1024 x 683 - 71K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-07 10:05
    It should work. You could use a PULSIN statement in a tight loop to sample the PWM pulses, then check to see if the pulse width exceeds some threshold (probably 1.5ms or more). If so, the program would turn on an I/O pin, otherwise it would turn off the I/O pin. You'd need some kind of switching transistor to turn the LEDs on and off (see Nuts and Volts Column #6 for details).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-07 11:12
    Rob,

    There's a whole lot that can be done with a RC signal.

    I Mike said you can monitor the pulses and turn things on and off based on the pulse length. It also possible to bypass the pulses completely. Many newer radios, including the Spektrum radios, have microcontrollers to convert serial data to pulses. It's possible to tap directly into this serial signal and get information about all the chanels with a single microcontroller pin. You can also do the same thing on the transmitter end and use a serial signal to produce the desired tranmission instead of using the remote's buttons and joysticks.

    I removed the small transmitter PCB from an RTF microheli and used it with a Propeller chip to fly a RC helicopter using a Wii Nunchuck. I used the Nunchuck's joystick data for roll and pitch control and the accelerometer data for throttle and yaw (this doesn't make a helicopter any easier to fly).

    At the risk of getting erco mad at me (again) I really recommend you take a look at what the Propeller chip can do. (This isn't the Basic Stamp forum after all.:smile:) The Propeller is a great microcontroller to use with RC gear.

    BTW, I've added some LEDs to my hexacopter. Here's a link to forum post about it.
Sign In or Register to comment.