# Wireless

I was always taught that electricity only travels in closed loops and will not flow if the loop is broken. So then how do antennas work? There is no loop there.

Maybe electromagnetic radiation does not fall under the definition of “electricity”.

What you were taught is true for steady (DC) currents. If there was no path for electrons to return to the source they would accumulate somewhere infinitely, which makes no sense.

It's not exactly true for alternating (AC) currents. Think about an AC source hooked up to a capacitor. Fundamentally, the capacitor is a "broken loop" because there is no direct path from one plate of the capacitor to the other. But current will still flow because energy couples through the capacitor in the form of an electric field.

Antennas would not work with DC current!

If you keep asking deeper and deeper questions eventually the only fully-correct answer will be "Maxwell's Laws". Well worth studying, but not for the faint-of-heart :) 99% of what is taught about electricity is models, simplifications, and such (quite USEFUL...don't get me wrong) that simplify some aspect of the situation such that it can be studied without Maxwell's Laws.

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

Thank you. So if I attached a wire to my arduino analog output and sent a sine wave through it, I would have a radio signal of sorts?

of sorts.......

That is why aluminum foil works on your TV and you can make WiFi antennas out of pringles cans.

look up maxwells equations for a better understanding of how the energy leaves the antenna. Mainly, time varying electrical fields (AC current) creates time varying magnetic fields and vice versa. Thus you have the self-propagating RF wave.

Yes, absolutely. It would likely couple an extremely small amount of electrical energy to an electromagnetic radiating field, but you indeed have a radio signal of sorts.

In fact if you get a 85cm length of wire and pulse an output at the highest possible speed for a 16 MHz Arduino (which would be 8 MHz...but you'll have to program the timer registers directly instead of relying upon analogWrite) you may just be able to hear it as interference at the 88 MHz frequency on an FM radio. No guarantees :)

You are probably more likely to "hear" your Arduino at AM radio frequencies but you will need a much longer wire :)

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

Maybe I'll try that. Why is the max speed for a 16mHz chip 8mHz? And even so, why would 8mhZ come out as interference on the 88mHz freq.? shouldn't I hear the interference on the 8mhz freq?

Maybe I'll try that. Why is the max speed for a 16mHz chip 8mHz?

Because the timer counters are clocked at 16MHz and thus the shortest time between output transitions is 62.5ns, a square wave repeats on every two transitions, so period is 125ns, ie 8MHz.

BTW 8mHz is 8 milli hertz, about 1 cycle every 2 minutes ;)

An efficient antenna for 8MHz would be 30 feet long - however shorter lengths will radiate the higher harmonics efficiently and interfere on many frequencies, all odd multiples of 8MHz (such as 88MHz which is 11th harmonic).

Thank you. So if I attached a wire to my arduino analog output and sent a sine wave through it, I would have a radio signal of sorts?

The 'analog output's are PWM outputs and can't produce analog output! No sinewave, only fixed frequency variable duty-cycle square wave.

Any time-varying signal radiates radio signals, however we try not to make circuits efficient at radiating unless we want them to - hence ground-planes, shielding, ferrite torroids. Signals we want to transmit are carefully filtered to be only in the desired frequency band and then sent to an efficient aerial/antenna for that frequency band.

So how could I use my arduino to output radio signals? (Nothing useful, just static interference.)

Here's a demo sketch...full instructions are inside:

It worked for me!

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

OK.... but what are those variables: (highlighted) They weren't declared. What do they do?

``````// Rugged Circuits LLC  / www.ruggedcircuits.com
// Demonstration program for using an Arduino to generate
// an FM radio frequency carrier.
//
// Designed to work with Arduino Uno/Duemilanove and Rugged
// Circuits Gator board.
//
// 1. Cut a length of wire 85cm long (33.5")
// 2. Attach the wire to digital pin 9 (D9) (also PD5 on a Gator)
// 3. Run the sketch
// 4. Bring the wire next to an FM radio tuned to 88.1 MHz. Try not to
//    touch the wire with your hands.
//
// You should hear interference, or notice that the radio signal
// is replaced by just a buzz, or perhaps silence.

void setup()
{
pinMode(9, OUTPUT); // OC1A on a Duemilanove/Gator

[glow]TCCR1A = _BV(COM1A0[/glow]); // Set CTC mode with OCR1A as TOP value, toggle OC1A on compare
[glow]TCCR1B = _BV(WGM12) | _BV(CS10)[/glow]; // Maximum clock speed
[glow]  OCR1A = 0[/glow];  // OC1A toggles every cycle
}

void loop()
{
}
``````

Also, I just found my old Shortwave radio.... Would tuning it to about 8 kHz be better? Or 16? 24?

The highlighted variables are low-level ATmega328 registers that control Timer 1. They are what you don't have to worry about if you use Arduino library functions like millis() (which uses Timer 0) or analogWrite(). But analogWrite() does not generate high-enough frequencies for this demo.

The lower the frequency you try to listen at the more energy you can couple from your wire, so it sounds like a reasonable thing to try. However, at 8 kHz you will have to reconfigure the timer to generate an 8 kHz waveform instead of an 8 MHz waveform by setting OCR1A=999 instead of OCR1A=0. Also, you will need an antenna (wire) that is some integer fraction of the wavelength, which is pretty long at 8 kHz:

wavelength = c / frequency = 3x10^8 / 8x10^3 = 37500m.

At 88 MHz (FM radio) the wavelength was 3.5m so a quarter-wave antenna is the 3.5/4=85cm length of wire suggested. You have to divide 37500m by a pretty big integer to get a reasonable length of wire, which means the antenna will not be very efficient.

But by generating a frequency right at the carrier frequency (8 kHz) instead of relying upon the 11th harmonic as in my example (8MHz * 11 --> 88 MHz FM) you will get more energy at the right frequency to start with. So it's definitely worth a shot.

-- The Quick Shield: breakout all 28 pins to quick-connect terminals

You’re right-- its 8mHz. SO my best bet would be to just use the above code at 88.1 mHz FM?

But if you really are putting out a square wave at 8 MHz, then none of the overtone/multiples fall within the FM radio band. 8-16-32-64-128 MHz.

The 11th overtone falls in the FM radio band: 11*8MHz --> 88 MHz.

I think you're listing octaves, not overtones.

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

As is Avnet Express for about \$4 less :)

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

From the above mentioned sparkfun page:

Worldwide FM band support (64-108 MHz)
Worldwide AM band support (520-1710 kHz)
SW band support (2.3-26.1 MHz)
LW band support (153-279 kHz)
Digital FM stereo decoder
RDS/RBDS processor

So We could get the 8 and 16 freq. on SW, and the 64 on FM! They should make a breakout board of that to make it a bit easier to use.