Changing analogWriteFrequency Breaks nrf24l01+ Wireless

Status
Not open for further replies.

Electric Potato

Well-known member
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!
 
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.
 
Status
Not open for further replies.
Back
Top