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
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(...
• 237
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 ...
• 103
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 ...
• 93
937 views

Programming standalone Atmega328p-PU with NE555N timer IC

I know I may sound a little idiotic to ask, but as I have seen in the internet that to program a standalone Atmel chip like that from of the Arduino's, you need 2 22pF ceramic capacitors and a 16mhz ...
951 views

Arduino-based mains frequency monitor

I'm looking to put together a simple mains frequency monitor based on the Arduino platform. The mains here are 250 V @ 50 Hz, but obviously these fluctuate slightly, which is the whole point of the ...
• 193
7k views

Listen for specific frequency

I’m trying to build a custom baby monitor for my wife who is deaf. It needs to detect loud noises and listen for a specific series of tones from a feeding pump our daughter uses. It will then send a ...
4k views

ATmega AVR frequency measurement with timer/counter

I've been rehashing some existing libraries I found on some obscure forums to measure a frequency on digital pin 5, using the ATmega328P/ATmega2560 Timer/Counter modules and an interrupt based ...
5k views

ArduinoUNO/MEGA, Is there a way to exceed 256 in analogWrite

I am using Arduino UNO/MEGA, I want to analogWrite(pin, val); where the value is 0-1023. How can I make that ? Thanks.
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 ...
• 195
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 ...
• 43
1k views

Is it possible to sample sound with arduino?

I have the arduino duemilanove with atMega328. The frequency is 16Mhz. I want to sample and record from the audio jack. I searched and i found if i want to record "everything - so to speak", i have ...
• 1,405
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(...
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 ...
• 87
894 views

Ensuring specific frequency at specific time?

I, at the moment am trying to come up with a simple way where I can program an Arduino to provide a step signal with a given frequency, at a specific time. The frequency has to be ramped up, and ...
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 ...
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 ...
• 31
222 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, ...
• 1,405
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 ...
• 430
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;...
4k views

Change Digispark clock speed, run at low voltage?

I have a low voltage (3.2v) application. I was hoping to use the Digispark. I have a solution using a separate Tiny85, but want to use the Digispark USB programming. To run at lower voltage I think ...
• 217
7k views

Building an adjustable low frequency PWM controller with Arduino

I am looking for a way to create an adjustable PWM controller capable of modulation frequency from 0-100 (more preferably 0-1000) Hz, duty cycle from 0-100%, and able to accept a voltage range of 5-...
• 33
210 views

How to detect if running Arduino or bare Atmega328p?

I'm building something that will mostly run on bare ATmega328p at 8 MHz (as described eg. here), but sometimes I need to run the same code on an Arduino. I need to initialize the DHT library ...
• 351
291 views

Arduino-based mains frequency monitor follow-up

Following my previous question, I'm getting closer to thinking about putting together this mains frequency monitor. I would just like to do a sanity check on my electronics before I order the ...
• 193
1k views

Arduino coding of producing frequency

Im new here. Anyone that could give a code or sample that would generate I wanted to use a frequency in range of 35k-43kHz. Please help me.
• 105
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 ...
• 121
7k views

How do i generate exact number of PWM pulses in arduino?

So my code here generates a PWM wave of 38Khz on Port B pin 7 of arduino Mega 2560 . For that I have used a prescaler of 8 and then set the ICR1 register value to 51 . I have also set the WGM10 ,WGM11,...
891 views

I have a simple project for my arduino : light some leds when i send a certain frequency from my smartphone through the jack output . For example , I play a simple audio file generated with a ...
• 23
110 views

Arduino Due custom platform for school and library installation

I have made a custom-development hardware for our school, where you can plug in an Arduino Due. It is mainly for driving all kind of motors and reading sensor signals. Therefore I added a custom SAM ...
• 23
3k views

Contoller for a stepper motor

I am currently implementing the following setup: Arduino Mega 2650 -- DRV8834 -- Stepper motor Everything works fine, however since it can provide a higher torque I want to run the stepper in half ...
• 23
981 views

Strobe Frequency Calculation, how its done?

I'm using the Arduino sketch for LED stroboscope found here: http://mehax.blogspot.co.uk/2011/02/arduino-stroboscope.html. Also below, I've inserted the loop part where this calculations are made: ...
• 21
2k views

How can I set 4 Arduino Leonardo PWM-ports between 200Hz and 1kHz?

I've noticed that I can set D9, D10, and D11 to around the timer 1 can be set to ~244Hz. However I need 4 ports that are between 200-1000Hz but I have been unable to figure out how to find the last ...
7k views

Sets of Ultrasonic frequencies using arduino uno

Is it possible to create a set of ultrasonics frequencies using only the Arduino? What code to be used? And how am I going to do for it to work? For this project I need to focus in the emitter side; ...
• 105
673 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 ...
• 21
895 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 ...
• 21
19 views

Deceleration time logger between frequencies

i need to measure the air resistance and roll resistance of a vehicle. I plan on using a toothed disc with a proximity sensor which will output a square wave signal in to an arduino. Then I will drive ...
• 21
1k views

Can I read two PWM signals and output two square waves on an UNO?

My system requires that I read two independent PWM signals (60hz) and output two corresponding square waves. These output square waves vary in frequency according to their corresponding input duty ...
• 45
267 views

How can I configure the RFM95 LoRa module to emit packets at only 'one' particular frequency?

I have created a LoRa gateway using a Pi3; I have used a RFM95 module for it. So, it is a single channel gateway, and I'm operating it at 868.1Mhz. But my LoRa node(also a RFM95, on an Arduino Uno), ...
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 ...
713 views

Arduino FFT library - Open Music Labs installation help

I downloaded the zip file of the FFT library from the below link http://wiki.openmusiclabs.com/wiki/ArduinoFFT and it now as I implement the example codes, it gives out a message which says "Error ...
• 21
480 views

How to use the timer to generate a pulse wave of the specified frequency and duty cycle

So we have the tone library, which produces a 50% duty cycle square wave of varying frequency, and analogWrite() which produces a fixed frequency wave of varying duty cycle. Is there any way to ...
• 308
811 views

Using a Hot Wheels Radar Gun with FreqPeriod library

I want to make a clone of those radar enforcement signs that look like this: I bought a Hot Wheels Radar gun that can send an analog signal to determine speed. See this thread: http://forum.arduino....
• 121
172 views

arduino mega number of simultaneous pulse inputs

I'm looking at this specification page: http://arduino.cc/en/Main/ArduinoBoardMega2560 It says there are 54 digital input pins. How many of those can be used at the same time to measure pulse input ...
• 121
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 ...
• 138
1 vote
10k views

High Frequency Sine Wave Generation

I'm new to the world of Arduino and I'm working on a wireless charging project that needs a 5.7MHz sine wave. I've tried using a Due and changing the PWM and DAC, but I can't get a clean sine wave at ...
• 11
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 ...
• 13
1 vote
2k views

Pin toggle speed

If I use direct port manipulation, what is the average number of clock cycles it takes to flip a pin on the arduino ie. void loop(){ PORTB |= 0b00010000; PORTB &= ~0b00010000; } So how ...
• 176
1 vote
1k views

Arduino Uno with crystal

Are there Arduino UNO R3s which use a crystal instead of a ceramic resonator? (Frankly, I don't understand this cheapness: if you really want to save on component cost you can run both AVRs on the ...
• 1,171
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 ...
• 287
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 ...
• 13
1 vote