Questions tagged [frequency]

Defines how often something occurs, such as pulses in a digital signal, or oscillations in a radio wave.

120 questions
Filter by
Sorted by
Tagged with
1 vote
3k views

ESP32 changing frequency instead of duty cycle

Using this code on an ESP32 allows varying the duty cycle of the PWM with a fixed 5000 Hz frequency; it is working fine. How do I vary the frequency and keep the duty cycle at a fixed value? // the ...
131 views

Capturing frequency using a photodiode

I've just bought the following photodiode (here) and I am trying to make a simple Arduino circuit/code so that the photodiode is able to record an LED blinking at an arbitrary refresh rate (frequency)....
8k views

Read frequency of input in digital pins

This is a somewhat theoretical question: Let's say I have some sensor that sends digital signals to one of Arduino's digital ports. Now, I don't know the frequency it sends those signals in. For ...
1 vote
109 views

Using I2S MEMS microphone breakout (SPH0645) as frequency detector

Good day. I would like to ask for help regarding the code for my project. I am using an I2S MEMS microphone breakout (SPH0645) to my Arduino Nano 33 IoT. Here are my pin configurations LRCL to A2 of ...
38 views

Frequency problems with DIY arduino and resonator

I made a simple music program using an arduino Uno and the tone() function. It works fine. I decided to build my own circuit using a barebones AVR and upload that program. I did not know exactly what ...
441 views

Generated frequency is not as expected

This code sets a pin HIGH for 1 microsecond and then LOW for 1 microsecond. The expected frequency should be about 500 kHz. When measuring the output the frequency is about 96.4khz. Why ? int del = 1;...
223 views

Tone() generates a high pitched sound when button is released

I have a simple circuit that makes use of the tone() function to produce some sounds. I also have a button, hooked with an interrupt function, that whenever is pressed, a variable changes. Sometimes, ...
149 views

Arduino 75kHz output frequency setup

i don't know how to manipulate arduino uno or mega registers and timers to be close to 75kHz output frequency. Could you help please ?
1 vote
2k views

Changing Frequency of PWM Pin on Arduino Uno

I am trying to change the frequency of the PWM output from an Arduino Uno R3 (Been using Pin 9) to 200 Hz with a duty cycle of 20%. This is for an ESC that is connected to a 12V motor, and I know the ...
97 views

Generate a sine wave with a predefined frequency and amplitude via DAC0 or DAC1 with Arduino Due

Good Morning to everyone, I am a PhD Student in experimental fluid mechanics at the University of Naples "Federico II", Italy. I am working on Arduino Due card and i am novel in applications ...
5k views

Is it possible to generate an exact 15 kHz clock pulse using an Arduino?

I want to generate a 15 kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000 Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds, but we ...
231 views

Recognize peak in specific frequency area

I am wondering if it is possible to attach a microphone to an Arduino board and make the Arduino recognize a volume peak in a specific range of frequencies. I want it to detect a specific peak (for ...
85 views

Getting more Hz while working with 3 serial ports (IMU sensors)

im doing a university project where we use 2 IMU sensors and a SD card reader to save the data from sensors. As you will probably see from the code, we specify the sensor port we listen to, save data ...
1 vote
78 views

Help in Frequency Conversion in ArduinoRP2040

Having a bit of a problem with the Arduino Nano RP2040. I'm trying to use the onboard microphone to read the frequency of a sound and then use that variable for calculations. However, while I can get ...
274 views

What is the minimum sampling rate in ADC in Arduino due?

I am looking for a very low frequency application like below 300Hz. What is the minimum sampling rate in Arduino due? I am very new to this. I see in the datasheet that max sampling rate is 20MHz.
183 views

How to get started with writing code for a Hall Effect sensor?

One of my biggest questions concerns coding a Hall effect sensor to find wheel speed with an arduino mega. I’ve got an lcd in digital pins(7,8,9,10,11,12) and a Hall effect sensor in digital pin 2. I ...
464 views

I have a potentiometer attached to one analog port of arduino (assume A0) I'm reading the value of that using input_voltage = analogRead (A0); which is a value between 0-1023. So I want to map this ...
3k views

Generate 1khz square signal with Arduino Mega

I want to generate a 1khz square signal with an Arduino Mega. I have read the MCU contains several timers. What i want to do is to configure one of this timers. My first question is: Is there a way to ...
35 views

Synchronizing an internal frequency to an external one

In this question: Procedure for changing frequency of Nano or similar, @EdgarBonet gave a very nice method of generating timings that don't divide the system clock evenly. He also said that it would ...
241 views

Procedure for changing frequency of Nano or similar

I need to get interrupts at one of three specific rates: 1920, 2000, and 2400 per sec, at a fairly high precision (~10 ppm). I've asked about this on Electronics but I think here might be more ...
203 views

Arduino, generating smaller frequency than 31Hz

I'm controlling a car instrument panel with Arduino using the tone() function, however with Arduino Uno's minimum 31Hz frequency I can only set the speedometer at ~12mph or more. I'd like to be able ...
29k views

Maximum frequency of digital signal in Arduino Uno?

As Arduino Uno has a 16 MHz oscillator but while running program it has less frequency because some of the processing power is used for running the program. I have used the delay(1) but it is giving ...
671 views

problem on implementation of the ultrasonic circuitry

I used an Arduino Uno on my project to produce a frequency greater than 35000Hz and the output of digital pin was connected to the ultrasonic transmitter circuitry: However, it's not working on ...
912 views

ATMega4809 via Nano Every marked as 20Mhz, but does this confirm it is actually at 16Mhz?

If you go to the official Arduino Nano Every page and click the Tech Specs tab, you'll see that it lists it as running at 20Mhz. Turn On Verbose Compile However, if you go into the Arduino IDE and go ...
2k views

Why is our refresh rate consistently decreasing in logging on SD card?

The current code is used to gather the state of 12 infrared beams and log them to an SD card using the real time clock to mark the time. The code uses a switch to turn the device on and off and an LED ...
1 vote
438 views

FG Frequency output

I have bought the Brushless DC-Flat Motors Series 2610 and Pin number 6 is called FG which is defined as frequency output. I have plugged this pin into the Arduino in A0 and I have tried displaying ...
351 views

I connected a wave generator to the analog pins to read the frequencies of the waves generated. I used different frequencies of sine waves with a minimum of 0V and maximum of 5V. Whenever the voltage ...
1 vote
163 views

Changing frequency by button press

I have to up the frequency by 100 hz by button press for upto 1khz; I am stuck on using the debounce source code. The problem is every time I press button the value for "i" goes to random ...
1 vote
186 views

Time signal. Determine the presence of pulses and their duration [closed]

I want to detect the exact time signal from an FM radio station. The signal is transmitted in the form of 5 short pulses and one long one. My task is to determine the presence of a pulse in the audio ...
1 vote
2k views

What is the maximum frequency input signal that I can accurately track on a GPIO pin?

This all started with me wanting to use an Arduino to make a tachometer. This is all now working fine, but it got me wondering what the highest frequency digital signal that I could read? So I built a ...
1 vote
117 views

How the light brightness stays constant when we increase the frequency of stroboscope

Well I am trying to make a Stroboscop. I found this code at blow: and tried. It works normally. But if I increase the RPM so decrease the "strobeDelay" time, the brightness of the LEDs goes ...
1 vote
587 views

How to change the update rate in TinyGPS++?

I am working with TinyGPS++ library and Arduino-nano and I want to change the update rate. I worked before with Adafruit GPS and uses the below code for updating it. // Set the update rate GPS....
291 views

Measure audio frequency through pulse duration

Hello dear StackExchange users, i want to develop an Infrared blaster which i can plug into the headphone jack of a phone or console of choice. In order to communicate what frequency to modulate the ...
6k views

Generate 1.7 Mhz with PWM in Uno?

I have this code: void setup() { pinMode(11, OUTPUT); TCCR2B = 0; TCNT2 = 0; TCCR2A = _BV(WGM21); TCCR2A |= _BV(COM2A0); OCR2A = 249; } void loop() { soundBuzzer(); } void soundBuzzer(...
676 views

1.7 MHz generator for a water atomizer

I'm creating a controller for a small greenhouse, I have a DHT22 for measuring and two relay module that controls heating and cooling systems, and I will use a piezo to produce humidity when it goes ...
72k views

Set PWM frequency to 25 kHz

I currently can set four PWM pins to around 31 kHz with the following code: void setup() { TCCR1B = TCCR1B & B11111000 | B00000001; // Set PWM frequency for D9 & D10: pinMode(...
1k views

How to run atmega328p at 8, 4 and 1 mhz?

Instead of using the regular Arduino board I have purchased the atmega328p-pu along with this components: 22pf ceramic capacitor 10K resistor 16mhz crystal 47uF capacitor 3.3 Volts Power supply The ...
422 views

How can arduino read a frequency higher than 16Mhz?

I will like to understand how does Arduino measure a frequency. Also how does my voltmeter can measure a frequency as well. Since I am a beginner on using microcontroler I would read a frequency like ...
586 views

Turn infrared LED on and off in order to simulate an infrared signal

Note I am able to send and recieve IR signals. This question is only for purposes of learning. When using the existing library #include <IRremote.h> it is very simple to read and transmit ...
1 vote
279 views

Clock frequency VS cycle time

I am considering switching from Arduino Pro Mini 5V 16MHz to Arduino Pro Mini 3.3V 8Mhz for some project because I would like to run it with a 4.5V input power. Will the switch from 16 to 8Mhz double ...
26k views

Arduino constant clock output

I am controlling an ADC with my Arduino Uno. I would like the clock of the ADC to be the same frequency of the Arduino. Is there any way that I can have a constant clock output from one of the Arduino ...
4k views

Trouble with setting the PWM frequency for Arduino Due

I'm using Arduino Due and I set the analog read and write resolution to 12-bit for better resolution. Basically all I do is to vary PWM duty cycle by controlling analog DC input voltage from 0 to 3.3V....
63 views

Will an Arduino UNO operating at 16mHz communicate with UART / I2C with an STM32 operating at a different frequency?

I plan to connect Arduino UNO via I2C / UART with a controller based on STM32F334K8T6, whose frequency will be about 20mHz or higher. Tell me, does the difference in clock frequencies of ...
1 vote
3k views

I'm trying to read 4 analog inputs (1kHz speed). I changed the prescaler to 16 for my Arduino Leonardo according to this link. I then tried to read the analog pins and I used the following code to ...
1 vote
484 views

Timer 1 Arduino - Create 2 Timers

I’m trying to output 2 separate frequencies using 2 output pins from an Arduino using the Timer 1 library. A snippet of the code is show below. void setup() { Serial.begin(9600); pinMode(button,...
87 views

Frequency Doesn't increase when Button Is Pressed

I’m trying to output a frequency that can be increased and decreased by using 2 buttons. I’m trying to first of all configure the first button (which increases the frequency). I’m trying to also add ...
897 views

Measuring Amplitude/Frequency of sound

I need to read an analog signal at about 500-1000Hz for at least 5 seconds. I've a battery powered microphone wired into an analog and ground pin on my arduino and am trying to measure the frequency ...
553 views

Arduino Audio Recorder - Speed Correct but Wrong Pitch

I'm working on an audio recorder project on an Adafruit Adalogger with SAMD21 ARM-based processor using the Arduino IDE. The desired sampling frequency is 10 kHz, 12-bit resolution with an analog ...