Electrical Engineering Asked on December 17, 2021
I am asking this question primarily to learn.
I have learned that Hz is the number of cycles in one second.
Taking that into consideration I have tried the following examples.
void loop() {
digitalWrite(3,HIGH); // make pin 3 have a voltage of ~ 5V
delay(500); // wait 0.5 seconds
digitalWrite(3,LOW); // make pin 3 have a voltage of ~ 0V
delay(500); // wait 0.5 seconds
}
This code has a frequency of 1 Hz because voltage is .5 seconds up and .5 down. My voltmeter shows .99999 Hz
The duty cycle is 50% because the voltage is half of the time up and half of the time down.
void loop() {
digitalWrite(3,HIGH); // make pin 3 have a voltage of ~ 5V
delay(90); // wait 0.09 seconds
digitalWrite(3,LOW); // make pin 3 have a voltage of ~ 0V
delay(10); // wait 0.01 seconds
}
This code has a frequency of 10 Hz because every cycle is .1 seconds (90 ms + 10 ms). In 10 cycles you will reach 1 second. The duty cycle of this code is 10%.
void loop() {
digitalWrite(3,HIGH); // make pin 3 have a voltage of ~ 5V
// Do not delay
digitalWrite(3,LOW); // make pin 3 have a voltage of ~ 0V
// Do not delay
}
If I run this code, my voltmeter shows a frequency of 112,000 Hz or 112 kHz:
I believe that is the highest frequency I can get. I am not delaying in between cycles. Why is it that when I google the frequency of Arduino Uno it says:
Google is probably correct and the frequency is 16 MHz for Arduino. If that is true, then how can an Arduino send a 433 MHz frequency? I want to buy this:
When I now set delay as in Example 3
, the highest frequency I could obtain was 112 kHz (with a k). How is it possible to send a 433 MHz frequency (with an M)?
The Arduino runs at 16MHz. This means that if you programmed it in assembly, each instruction would take $frac{1}{16times10^{6}} = 62.5mathrm{nS}$. You probably don't want to do assembly. The compiler is efficient enough to convert your code into assembly and then into hex.
I believe that is the highest frequency I can get
The reason why you're getting a lower frequency than 8MHz (16/2 ; 1 instruction to turn on the pin 1, instruction to turn it off) is that Arduino has a lot of overhead which makes it easier for beginners to start coding but makes the program relatively slower.
Copy and paste the following code to replace your loop() function:
loop()
{
PORTD ^= (1<<PD3);
}
No delays, just that 1 line. When I last tried it, it got me a 3MHz square wave. This is still not the predicted 8MHz. Now lets try to bypassing the loop() function by adding an infinite while loop inside it.
loop()
{
while(1)
{
PORTD ^= (1<<PD3);
}
}
Tadaa!!! You should now get the 8MHz signal.
A lot of people have already explained the 433MHz question. I just thought I should add my spiel on frequency. I'd be happy to explain what's going on in the code if you'd like
Answered by Pratik Kunkolienkar on December 17, 2021
The 433 MHz is the frequency that is produced by the radio.
The data being transferred over the radio's side band will never be as fast as the carrier signal.
If you put an oscilloscope on the radio, you will get the 433MHz signal.
Answered by Schultzie on December 17, 2021
The radio module may simple implement on/off keying. For 433MHz, the rate of data has to be low, so the sidebands fit into the 1MHz allocation.
Garage door openers are of this type.
Answered by analogsystemsrf on December 17, 2021
These "examples" seem to be questions that can be answered:
3) Toggling a pin in a loop with DigitalWrite function is slow. That is why you only get 112 kHz. The microcontroller still runs with 16 MHz clock.
4) The transmitter generates its own RF carrier wave. You can send slow data for the module to transmit.
Answered by Justme on December 17, 2021
The short answer: It doesn't.
Arduino doesn't send anything close to that high. It can only send a lower frequency (lower bitrate) signal over a 433MHz CARRIER frequency (or any other frequency for that matter) by using another device/module which generates a very high frequency (radio frequency) in order to communicate via radio waves.
The 433MHz in this case is NOT THE RATE OF DATA/BITS, but a frequency of the radio signal over which the data is transmitted/received.
Your question shows a lack of knowledge about the meaning of, and the difference between, processor clock frequencies, speed of processing, data rate, and "carrier" frequencies as the means of radio communication, so you should read and learn more about basic computer processing and its related terms, and about the means and ways of transmitting information over radio waves.
Basically, the carrier/radio frequency is modulated/changed by the information/data you want to transmit, so it is those changes that represent the information.
Based on the type of change, there are 3 basic types of modulation.
Amplitude Modulation (AM), Frequency Modulation (FM), Phase Modulation (PM).
With AM, the carrier frequency is kept stable/same, while the amplitude/power of the carrier frequency is varied to transmit information.
FM keeps the carrier amplitude the same (at maximum) while the frequency changes up and down a certain amount represent information.
PM is similar to FM, and it carries information by phase-shifting the carrier frequency.
Answered by Edin Fifić on December 17, 2021
Why is it that when I google the frequency of arduino uno it says:
16 MHz is the clock frequency of the processor, basically how fast the CPU core runs.
If that is true then how can an Arduino send a 433 MHz frequency?
You would buy a radio that transmits at 433 MHz center frequency. The speed of the CPU has no relationship to what frequency the radio transmits at. For example, in the extreme case of a fiber optic, the optical frequency is 300,000 GHz, but your CPU would still be 16 MHz.
When I set now delay on Example 3 the highest frequency I could obtain was 112 kHz (with a k). How is it possible to send a 433 MHz frequency (with an M)?
The radio datasheet should give you an idea of how to connect to it, but basically it would attach over some bus (e.g. USB) or provide you with some data signal that you would read in. What does the radio's datasheet say to do?
Answered by user1850479 on December 17, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP