Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes

Lowest voltage applicable on AREF pin on Uno and Mega

According to the datasheet (page 375) the minimum voltage you are allowed to have as a reference voltage for the ADC is 1V.
Majenko's user avatar
  • 105k
4 votes
Accepted

Audio sampling and serial communication

You calculation of the data rate is wrong: Serial.println() adds CRLF (i.e. "\r\n") to terminate the line, That's 2 bytes, not one. Each byte is sent by the serial port as one start bit, followed by ...
Edgar Bonet's user avatar
  • 43.3k
4 votes
Accepted

How to determine when a sensor's output signal changes significantly?

There is no simple and universal way of deciding what is to be considered a “significant” change. My recommendation would be to create an algorithm by playing with the data on your computer: Upload a ...
Edgar Bonet's user avatar
  • 43.3k
3 votes

Arduino Uno - Analog Circuit Simulator

Here is the one which is closest to be useful for your question Link: https://markmegarry.github.io/AVR8js-Falstad/ Try it out for yourself It is very slow though.
ArduinoFan's user avatar
  • 1,059
3 votes

Library to set internal analog gain of the Arduino?

I would recommend you to check Nick Gammon's example on using the analog comparator by means of configuring the relevant flag bits of registers in the ATmega328. Sample code from the link, by Nick: ...
Enric Blanco's user avatar
  • 2,114
3 votes

ADC with better performance

ADS7835 from Texas Instrument. can be interfaced with Arduino Mega or Raspberry Pi It is interfaced through SPI, 12 bit data, and up to 500kHz throughput rate.
duck's user avatar
  • 1,258
3 votes

Dealing with a Signal Source

There's an easy way to achieve reading multiple pushbuttons using single analog input. All you need to do is create some voltage dividers at different voltages which can be read using analogRead. The ...
Siddharth Kothari's user avatar
2 votes

How to interpret analog values sent to Arduino from line scanner?

First, a preliminary note: according to the datasheet, the only time you need a delay in your program is after reading the whole array and before sending the next sync pulse. All the other timing ...
Edgar Bonet's user avatar
  • 43.3k
2 votes

ADC with better performance

I need to sample voltage at a very high rate (say for like 10000 Hz) and with a very good precision(at least 10-12 bit ADC will do). 10Ksps and 12bit-resolution adcs are fairly common for onboard ADC....
dannyf's user avatar
  • 2,770
2 votes
Accepted

Speed of reading I2C

Let's take a look at a typical function for reading this sensor. This is from the Adafruit_VCNL4010 library and is for reading the proximity: uint16_t Adafruit_VCNL4010::readProximity(void) { ...
Majenko's user avatar
  • 105k
2 votes

Reducing noise and finding sampling rate

Just to as a complement to Majenko's answer (which I second), there are a couple of flaws in your program that may be related to your problem: lowest is always zero, as it is initialized to 0 and ...
Edgar Bonet's user avatar
  • 43.3k
2 votes

Library to set internal analog gain of the Arduino?

You seem to be interested mainly in ATSAMD21. There is an application note from Atmel, AT11480: Analog Comparator Application Examples, which may be of interest for you. From the Getting started ...
Enric Blanco's user avatar
  • 2,114
2 votes
Accepted

Maximum frequency that can be converted with Arduino Uno?

First of all, the ADC on the Uno is 10 bits, not 12. The naive approach of having analogRead() in a tight loop can give you up to 8.9 kS/s (112 µs per sample), but you won't be able to ...
Edgar Bonet's user avatar
  • 43.3k
2 votes

Increasing range of a DC-offset signal (software)

You can't magic more resolution out of thin air (well, you can, but it slows down your sampling - you would "oversample" and average a number of sequential samples). Instead you need to boost your ...
Majenko's user avatar
  • 105k
2 votes
Accepted

Sampling rate of multiple analog pins on Arduino

1) You only have one ADC on board and all the pins run through a mux. You can only read one pin at time. If you're willing to give up some resolution then you might can read a little faster but it ...
Delta_G's user avatar
  • 3,324
2 votes

Specific noise while using arduino ADC in free running mode

If you use an ISR to retrieve the ADC result, you will need to protect the read of the variable. An interrupt may occur when reading aval in the loop(), as this is a 16-bit value and the read requires ...
Mikael Patel's user avatar
  • 7,969
2 votes
Accepted

Is defining a function improves speed rather computing average for each analog input separately

Writing the code out four times, in line, is a little bit faster than calling a function because the function call and return take some time, and the loop instructions take some time, and neither of ...
JRobert's user avatar
  • 15.3k
2 votes
Accepted

Sending analog sensor data to laptop at 1kHz via USB

As I said in a comment, your code on my Uno gives me 791.5 samples/s. This is about 1263 µs per sample: about 110 µs for analogRead(), including 104 µs for the conversion proper presumably 1000 µs ...
Edgar Bonet's user avatar
  • 43.3k
2 votes

Using internal voltage reference for sensor

The problem is that my sensor (mini solar panel) reads max value under little light and does not go beyond that level no matter how much light falls onto it in the later stage. Open voltage is not a ...
bigjosh's user avatar
  • 1,553
2 votes

RMS Voltage Value

There are multiple issues with this piece of code: Local variables, i.e. variables defined inside functions or braced blocks, are created each time the execution enters the function or block, and ...
Edgar Bonet's user avatar
  • 43.3k
1 vote

Arduino PID controller for Triac

I need some help in making the connection between the PID library and output in the code PID calculates the value of output and it is used in int dimtime = (75*output);. The aaa_PID object gets ...
Juraj's user avatar
  • 18k
1 vote
Accepted

Measure voltage changes with unknown baseline

An audio signal consists of two main components: An AC signal A DC offset What you are interested in is the AC signal, but not the DC offset. That DC offset is what is drifting in your current ...
Majenko's user avatar
  • 105k
1 vote
Accepted

Arduino Due ADC negative voltage

The best thing you can do is to simply add a DC offset to your signal. Instead of having it be 0V ±80mV, have it 1.65V ±80mv. All you need is a capacitor and two resistors: simulate this circuit &...
Majenko's user avatar
  • 105k
1 vote
Accepted

Sampling and serial transfer

Probably the serial port is too slow: Assuming 250 kbits/s, is (including 3 start/stop bits, maybe 2 in your case) in about 250000 (bits/s) / 11 (bits/byte)= about 22 KBytes/s Assuming each sample ...
Michel Keijzers's user avatar
1 vote

polynomial change of LED brightness arduino

Here is the proper way to implement a polynomial function. It's a direct application of Horner's method: // Polynomial function for output 1. static float f1(float x) { return (((8.8e-4 * x - 0....
Edgar Bonet's user avatar
  • 43.3k
1 vote

Sampling/transmission limits for USB and Arduino UNO R3

It is not possible to sample two signals at the exact same time with an Arduino Uno. The Arduino has only one ADC, so you have to sample one signal, switch channels, sample the other, switch channels ...
Edgar Bonet's user avatar
  • 43.3k
1 vote
Accepted

Optimizing ext. SPI ADC for speed and verify the speed

Don't use digitalWrite(). Don't use delay(). Don't flood your Serial connection with useless junk ("analog value =") You may also consider using lower level SPI operations instead of the SPI library, ...
Majenko's user avatar
  • 105k
1 vote

Interfacing TRRS headphone to Arduino Uno

It sounds to me as if your project is really more about what you do with the audio once you're sampling it into the Arduino and this whole "how do I get a usable signal out of a microphone" thing is ...
cjs's user avatar
  • 594
1 vote

Interfacing TRRS headphone to Arduino Uno

TRRS relates to the style of the jack plug used: Tip Ring Ring Sleeve. You still need to amplify the signal with a microphone preamp the same as your electret (in fact it will be an electret in there ...
Majenko's user avatar
  • 105k

Only top scored, non community-wiki answers of a minimum length are eligible