Harmonic filtering

I'm using a digital pin to create a 1khz wave. The problem is that its a square wave and it has harmonics. I can hear the harmonic on my radio even in fm band > 90mhz. I'm trying to use a passive rc low pass filter but it seems it doesn't have any affect. Is there a way to create a wave that doesn't have harmonics? Either using some filter or by software?

How are things wired up? Just a bunch of wires on a solderless breadboard? Those wires all act like antennas, so a first step is to clean up wiring.

What is the 1 KHz connected to? A 2nd step might be co-ax or twisted pair wiring to shield the emissions. Ground the shield at one end so you don't induce ground loops.

A 3rd step might be better filtering. Lower the filter frequency, add a 2nd stage of filtering, maybe add active components (op-amps) to make a sharper cutoff band/knee.
http://sim.okawa-denshi.jp/en/CRlowkeisan.htm

I'm build small transmitter between a computer and a portable terminal. I'm using a breadbroard while I'm testing the transmitter.
The harmonics interfering with the testing. The wirining is from digital and ground to the filter. co-ax is a good idea but I don't have it now. Won't the wiring still act as antenna after makeing it a circuit? Next have try 2nd stage filtering.

Yes, but the outer shield of the co-ax will contain a lot of the emissions.

Try putting some ferrite beads on the wire coming out of the digital pin, as close as possible to the pin. Beads like these will cut RF interference in the short wave and FM bands: http://www.ebay.com/itm/50-pcs-2643250302-FAIR-RITE-43-MATERIAL-SHIELDED-FERRITE-BEAD-25-300MHz-/121152377726?pt=LH_DefaultDomain_0&hash=item1c353e937e

shakki87:
I'm using a digital pin to create a 1khz wave. The problem is that its a square wave and it has harmonics. I can hear the harmonic on my radio even in fm band > 90mhz. I'm trying to use a passive rc low pass filter but it seems it doesn't have any affect. Is there a way to create a wave that doesn't have harmonics? Either using some filter or by software?

With a digital pin you have to filter in hardware afterwards. With high-speed PWM then
a LPF you can get a much better approximation to a sine wave with less critical filtering
requirements. So a 60kHz PWM through a 2kHz-cutoff LPF will fare much better than
putting a square wave through a single RC filter.

Alternatively you can use a much more performant filter (say 6+ poles) using cascaded
active filter sections, so that it has a steep cutoff just above 1kHz. However such a
filter is both expensive in components and fixed at a single frequency.

In practice if you want to generate a quality sinusoid you use a DAC and generate
enough samples to greatly reduce the error, then LPF the residual noise away.

[one last possibility: LC resonant filter - however not easy for low frequencies and have the
risk of exceeding the supply voltage at resonance]

Haven't tried the coax cable yet. I tried the 60khz with a 2khz filter but I still get harmonics on radio. 60khz pwm is still a square wave is it not? And I don't quit understand the idea behind it can you elaborate?

Can you clarify what you are doing with the 1kHz signal? What is this "small transmitter"?

I'm going to use the 1khz as a commucation signal eg morse code, fsk. The transmitter is a simple am transmitter for about 10m for now. If concered about law I dont live in US.

Tried coax cable didnt't change the situation. Still have expose some of wiring to make a connection.

EDIT: Sees that nothing works to filter harmonic. Is there any way to gererate a signal that has a frequency without harmonic?

Need to generate with a DAC so you can control the corners more.

Got it working. Insted of using filters I used a 1khz PHASE-SHIFT OSCILLATOR to create the control signal. Now i only have turn the oscillator on or off. It has some harmonics but now a rc filter works in reducing them. Thanks for the information especially the coax cable.

Got rounder corners to start then? That makes filtering easier.

Yep. Tried the oscillator on a simulator first almost a perfect sine wave.

Have you looked at the output with a real oscilloscope?

Not yet. I used audacity to analyse the spectrum. It showed that the signal is a 1KHz and that the harmonic attenuate. Also didn't hear any harmonic on the radio.