0
\$\begingroup\$

I have two ATMEGA328P's. I would like to be able to send a radio wave (no data/sound/modulation, nothing, just the carrier wave) from one micro-controller and get the other micro-controller to pick it up using ADC.

So far I've been able to pick up random EMP emission with my receiver ATMEGA328P (by connecting a long wire into the ADC input). I can clearly see a unique ~6sec pattern being generated by one of the devices at my home, then it goes silent for ~5seconds and then the pattern repeats again. Seems like it's coming from the fridge or maybe neighbors, because pattern disappears as I move further away from the kitchen. So my 'antenna' is picking 'something' up.

Now I want to be able to simply generate some kind of EMP emission, that could be picked up with my receiver, but this is where I'm stuck.

I don't seem to understand how can I 'send' the wave out from the transmitter. If I simply connect the crystal (16mhz) to the ground and VCC and connect another wire (antenna) to the crystals GND pin, but nothing happens as my setup is wrong. I see that other crystals used in radio tutorials have 4 pins, one of them is antenna, so I believe I need to wire 2 pinned crystal differently?

As far as I understood, this is how the transmitter should work:

Crystal is used to generate sine wave, which in return causes the polarity on the wire/antenna to toggle, which in return produces EMP emission in the frequency of 16Mhz (in my case), this signal then get amplified. Is this correct?

My questions are:

-Crystal value/pin count - Can I use a two pinned 16Mhz crystal to generate a 16Mhz SIN wave and will I be able to pick it up with the other ATMEGA's ADC? ( I don't want to read/process the signal, I just want to be able to read it with ADC and detect it's presence )

-Antenna - I have a WIFI antenna, as far as I understood, I won't be able to use it to pick up 16Mhz frequency since it works in Ghz range, correct? How would I find out the requirements to make an antenna that would pick up this frequency (16Mhz)?

-Signal - If I'm sending a 16Mhz sin wave and my micro-controller is running at 8Mhz, it means that I won't be able to see the 'detailed sine wave', but it would appear as solid 'high' in the listener, correct?

PS: Is there a different term for 'radio wave transmission'? because all the tutorials I come across are AM/FM radio related, while I simply want to generate a 'carrier wave' that can be picked up by another controller.

Thank you for your time!

\$\endgroup\$
  • 2
    \$\begingroup\$ First, learn the difference between a crystal (2 pin) and a crystal oscillator (4 pin). The 2-pin devices are crystals, you need to build an oscillator around them. (useful search term : Colpitts oscillator) Alternatively, the ready built crystal oscillators are easier to use. \$\endgroup\$ – Brian Drummond Dec 21 '16 at 15:42
  • \$\begingroup\$ If there's nothing you do with the sine wave, there's no "transmission". If you switch it on and off, one would call that OOK (on-off-keying), and it's a special case of digital AM. \$\endgroup\$ – Marcus Müller Dec 21 '16 at 16:10
  • \$\begingroup\$ Second, learn that this is not "EMP", EMP is a pulse, you're just receiving some EM (electromagnetic) signals generated by many devices. A 16 MHz oscillator connected to an antenna generates a 16 MHz EM wave, not an EMP. No a Wifi Antenna is about 150 times too short to be useful at 16 MHz. If you want real (and useful) radio devices, use 315 or 433 MHz transmitters and receivers with your Atmega. These are very cheap and work very well. \$\endgroup\$ – Bimpelrekkie Dec 21 '16 at 16:13
  • 1
    \$\begingroup\$ Your perception of how wireless works is limited (and partly wrong) and that is OK but then don't try to make things work "your way" because that will very likely end in disappointment. Better understand and use it properly (that is where the 315 MHz and 433 MHz devices come in). \$\endgroup\$ – Bimpelrekkie Dec 21 '16 at 16:17
  • \$\begingroup\$ @FakeMoustache that's why I wanted to ask if I understood the basic concept correctly, but turns out I have a lot of learning to do first before I can get it even to the basic stage - two micro-controllers next to each other, one just sending "high". Thanks for the suggestion \$\endgroup\$ – 0x29a Dec 21 '16 at 18:00
7
\$\begingroup\$
  1. Can I use a two pinned 16Mhz crystal to generate a 16Mhz SIN wave? No. A "two-pin" crystal is a passive device and cannot generate anything. But a crystal can be used in an oscillator circuit to generate an RF (Radio-Frequency) signal. You can also use a "4-pin" crystal OSCLLATOR which has the crystal AND the oscillator built into the same package. Note also that generating an RF transmission at 16 MHz is illegal in most of the planet, so you will be breaking the law and quite possibly interfering with important communication channels officially assigned to others. You cannot transmit RF signals anywhere you please
  2. Will I be able to pick it up with the other ATMEGA's ADC? Probably not. As yu have already demonstrated, there is lots of RF junk floating around in the air and without some way of discriminating WHICH RF signal your want to listen to, whatever you are sending will be buried in noise and interference. This is why you need a RECEIVER. A receiver will discriminate ("tune") between all the RF that is floating around out there. All receivers must have the ability to tune which signal they want to receive and reject everything else. RF communication would be impossible without this most critical part.
  3. Can I use a WiFi antenna for 16 MHz? No. Antennas are also "tuned" for different frequencies (wavelengths). A WiFi antenna is practially useless at 16MHz.
  4. How would I find out the requirements to make an antenna that would pick up this frequency (16Mhz)? There are many resources on the internet how to construct antennas for any given frequency. Especially Radio Amateurs ("Hams") who make their own transmitters, receives, antennas, etc. But, as already mentioned, you cannot legally transmit on 16 MHz. So you should select a legal frequency before worrying about antennas.
  5. If I'm sending a 16Mhz sin wave and my micro-controller is running at 8Mhz, it means that I won't be able to see the 'detailed sine wave', but it would appear as solid 'high' in the listener, correct? Correct. That is why nobody uses that method. Detecting the direct carrier wave with a microcontroller is completely impractical and unnecessary. As already mentioned, you need a RECEIVER to properly detect the carrier wave and produce a signal that can be used by your microcontroller.
  6. Is there a different term for 'radio wave transmission'? Yes, it is "RF" which stands for Radio Frequency. If you use the term "radio" by itself, you will find the more popular meaning of entertainment broadcasting.

It is admirable that you are experimenting with transmitting and receiving RF. However you should study more about it before trying this experiment. Especially you should research which frequencies are legal and safe for you to use in your country.

In most parts of the world there are certain frequency bands that are legal to experiment with or use without any licensing, etc. Read about the "ISM Bands" ISM is Industrial Scientific and Medical. Depending on which country you are in there are several of these bands which you can safely and legally use for experiments like yours. Ref: https://en.wikipedia.org/wiki/ISM_band

Your experiment is essentially impossible until you start using a RECEIVER circuit to properly discriminate ("tune") the signal of interest, and reject all others. Designing and building RF circuits is rather an advanced technique that requires special skills, knowledge and equipment. Many people who do already have these special skills, knowledge and equipment chose to simply buy ready-made (and tuned and tested) transmitter and receiver modules so that they can make use of RF communication without messing around with RF.

There are very inexpensive products that will do exactly what your experiment is trying to do. And on legal frequencies. For example there are matched transmitter and receiver circuit boards which sell for less than US$5 already assembled and tested, and in many cases even with free shipping to wherever you are. It is very hard to make a case for "rolling your own" transmitter and receiver when you can buy them for less than the cost of the parts.

For example, currently, there are several vendors of this matched pair of 433MHz transmitter and receiver for US$ 0.74 with free shipping.

RF transmitter and receiver kit

\$\endgroup\$
  • 1
    \$\begingroup\$ excellent answer! I agree, OP is trying to tackle too many problems at once – he should either focus on learning RF basics, then RF design principles, communication theory … basically, the full extended Ham program, or learn how to use existing transceivers (like the ones you show) \$\endgroup\$ – Marcus Müller Dec 21 '16 at 16:43
  • \$\begingroup\$ wow, thank you very much for the super detailed answer, I really appreciate it! Only reason I'm trying to do this, is because I wanted to understand how it works from the raw level and slowly build up from there, that's they only reason I haven't purchased pre-built transmitters/receivers, I just wanted to place two atmegas next to each other and see the ADC input on LCD, but it looks like I have a lot of learning to do first. I appreciate your time and help, thank you! \$\endgroup\$ – 0x29a Dec 21 '16 at 17:21
  • 1
    \$\begingroup\$ RF is complicated enough that buying the pre-built transmitter and receiver and experimenting with them is probably a better and easier way to learn how to use RF. People who have been building electronic circuits for decades would not attempt to do what you are trying. \$\endgroup\$ – Richard Crowley Dec 21 '16 at 17:39
  • \$\begingroup\$ Investigate getting a "Software Defined Radio" (SDR). The hardware part (dongle) is quite inexpensive (around US$20) and various software apps are open-source and free. This software will give you a visual representation of what is going through the air within a band of a few MHz. Look at a few SDR videos on YouTube, etc. \$\endgroup\$ – Richard Crowley Dec 22 '16 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.