Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Changing analogWriteFrequency Breaks nrf24l01+ Wireless

  1. #1

    Changing analogWriteFrequency Breaks nrf24l01+ Wireless

    Hey guys,

    This has been bugging me, I have an nrf24l01+ radio on a teensy 3.2 that runs a motor thru a tip120. The motor is speedy and responsive if I change analogWriteFrequency to something high, say 187500Hz, but the problem is it blocks any radio packets from sending/receiving while it's spinning. If I leave analogWriteFrequency at the default 488.28Hz there is no wireless problem at all, but the motor emits an audible PWM whine and spins more slowly.

    The motor is on pin 3 which as far as I can tell shares a timer only with pin 4; neither are used by the nrf. I don't think it has to do with current draw because even when sending the tip120 analogWrite values too low to move the motor, wireless still gets suspended.

    thanks for any insights!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,282
    Maybe the PWM switching is emitting RF energy that's inconsequential done 488 times per second, but too much interference at 187,500 times?

    Try a lower frequency just above the audio band, like 22 kHz? Or try slight changes in frequency, just in case you're getting unlucky that some harmonic of the PWM frequency falls right onto the radio frequency that wireless module is using.

    You have a resistor between the Teensy pin and the TIP120's base, right? Maybe try increasing it slightly, which can slow the TIP120 down. Be careful though. Too much could cause the TIP120 to only turn on partially, which you'll probably notice because it can get too hot. But driving too strong can switch faster, which emits more harmonics of the switching frequency.

    Maybe also try shielding the motor, power supply, transitor and other PWM stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •