Questions tagged [analogread]

A standard Arduino function for detecting the voltage on an analog pin via ADC.

Filter by
Sorted by
Tagged with
0
votes
1answer
51 views

analogRead() doesn't read more than 500Hz

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 ...
2
votes
2answers
106 views

Arduino measuring high-voltage electric fence

I would like to know if someone has experience with measuring high voltages using an Arduino. I know you can use resistors to lower the voltage, however. I want to be able to measure the pulses of an ...
1
vote
1answer
107 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 ...
0
votes
1answer
29 views

Attiny : Is it possible to analog read on PB1?

I'm trying to read an analog input on the Attiny85 physical pin 6 (PB1, PWM), but analogRead(PB1) always returns 1023. Is it even possible to use analogRead on this pin? I'm fairly new to this so ...
1
vote
0answers
45 views

Phantom reading

my project is to control led diode and dc motor, test shield buttons, and check system run time. Testing buttons and run time i have done. Deal is with led and dc motor control. I'm getting phantom ...
0
votes
0answers
35 views

Extremely bad analog read on ESP32 while using 433MHz module

I'm currently trying to transmit data from one ESP32 to another with 433MHz modules. I also need to read some sensor readings from an Hall sensor. When the ESP32 that sends is not connected the values ...
2
votes
1answer
81 views

How to read an analog value on ESP32-CAM with the SD card reader enabled?

I use an ESP32-Cam module for a project for which I need both the SD card and the cam. According to this page, the only pins that are not in use by either the camera or the SD card reader are GPIO0, ...
1
vote
1answer
26 views

always detects same pin as HIGH even when its not connected

Im practicing with an arduino UNO board (I'm a begginer) and I'm trying to turn some LED's on depending on which analog pin is connected to 5V. Here's my code: int statusLed = 11; int out1 = 2; int ...
1
vote
0answers
29 views

Does anybodyknow how to program Muscle Sensors v3?

#include <Servo.h> const int x = 200 //Naming the servosServo Servo servo1; Servo servo2; Servo servo3; Servo servo4; Servo servo5; Servo servo6; void setup() { Serial.begin(9600); ...
4
votes
6answers
945 views

What is the most efficient voltage divider for Arduino?

I need to make voltage divider, so I could read a battery voltage up to 14.4 V. Could I use very high resistance resistors for that, so the current would be very low (to not to discharge battery)? On ...
1
vote
1answer
29 views

Analog Read dummy file

Can we use just a analog Read without storing it i hear it it a good practice to take two reads for better accuracy example: // Read extra analog inputs for (int i = 0; i < 8; i++) { // ...
2
votes
1answer
63 views

Noise in Analog Read Serial from an instrumentation amplifier(ina122p)

I am trying to read the values from a simple EMG circuit (with an INA122P) using the analogRead() and plotting in the plotter using an Arduino nano v3. I am powering the ina1222p from the 5v pin of ...
2
votes
0answers
69 views

Reliably using analogRead as a compact digitalRead

My goal is to reduce pins being used for micro-controllers with limited pins, or projects requiring a few different digital input values. How I intend to do so is by using ADC pins to gather four ...
2
votes
1answer
83 views

The analog read is not giving the correct waveform as that of an oscilloscope

I have this code that fetches analog input values from terminals A0, A1 and A2 of Arduino mega 2560. But, when I plot the data, it does not give the desired waveform. The desired waveform is parallel ...
0
votes
0answers
31 views

Connect k-type termocouple using o-amp

first of all I have to say that this is my first Arduino thing. I'm trying to connect a k-type termocouple to my Arduino using an LM2904 Oamp, Yes I know that this is not the best solution but is the ...
2
votes
2answers
75 views

printing the analogRead() functions result crashes Arduino

I have created a curcuit which reads the analog pin 3 auf the arduino nano and does other things dependant on the returned value. However I have problems regarding the analogRead() function. Whenever ...
1
vote
1answer
56 views

Extremely unstable analogRead() on Arduino Nano when powered from an external source

I'm doing a really simple project with an Arduino Nano and found a problem. The circuit is a simple temperature sensor and a tension read from an analog pin everything showed on a Nokia 5110 LCD. When ...
1
vote
1answer
94 views

Nano: All digital pins do not output anything

New user here. Using the examples provided on the Arduino IDE software I could produce melodies with a piezo buzzer, or have a blinking LED. Not anymore. No digital pin is giving anything. I can see ...
0
votes
1answer
61 views

How does supply voltage affect `analogRead()` on AVR-based microcontrollers?

I'm using an ATmega328P based Arduino to prototype reading a TMP36 temperature sensor. I will eventually move this to an ATtiny85 based board with a battery supply. Both the TMP36 and ATtiny85 have a ...
0
votes
0answers
51 views

how to write freerun analog samples to a file on MacOS

I've only just managed to get the Arduino IDE on MacOS set up with my ESP8266 board. My loop is running and I can see the lovely serial output in the Serial Monitor window in the Arduino IDE. I'm ...
0
votes
0answers
117 views

eps32 bad adc even with external adc (ADS1115)

Im trying to read an analog value with my esp32 and send it over wifi to another esp32. The wifi part works flawless, however when i try to read an analog value form the esp32 its not useable. It ...
1
vote
1answer
78 views

ADC value changing after changing Timer1 value in program

I'm writing a code where analogRead() reads ADC value from load. After reading ADC value, if it is not in range, I need to manipulate Timer1 value. Which is also getting changed. But, after changing ...
0
votes
2answers
293 views

Using SDA and SCL with analog inputs at the same time

I'm trying to build a robot arm based on Arduino UNO and PCA9685 controlled by few potentiometers. The easiest way that I figure out and find on internet is using two Arduino's, one as master and ...
1
vote
1answer
29 views

Data type explanation regarding analogRead of a photoresistor

This is a fundamental question - very new (1st post) and trying to learn. I have a photocell connected in series with a 10kOhm resistor between 5v & Gnd (to make a voltage divider) and the ...
1
vote
2answers
103 views

Why does the LEDs affect Analog Input?

So I'm working for a project to control RGB Led Strip using microphone or sound sensor with Arduino Nano. I'm using 5050 RGB Led Strip around 120 LEDs, and I control them using simple transistor ...
1
vote
0answers
44 views

How to calibrate Arduino DUE analog readings?

I am having a problem with the analog readings on my Due. On pin A4 and A5 I am measuring voltages: double vcc = 3.288 // taken on pin 75 (ADVREF) ; analogReadResolution(12); result = analogRead(A4) ...
-1
votes
0answers
39 views

Why does setting a digital pin to INPUT make one of my analogue pins into a digital input

I have connected four sensors to four of the analogue inputs and I can read the values they return just fine, it all works. However, I also need a digital input and when I set the mode of one of the ...
1
vote
1answer
917 views

DHT11 analog or digital?

I saw some projects with DHT11, some connect it with analog pin, others connect with digital pin. Is there any difference / advantage connecting to the analog?
0
votes
2answers
1k views

Binary to decimal using bitwise operators

I am trying to convert some binary data to decimal numbers. I succeeded to convert binary to hex, but now I want to do the same with binary to decimal. I want to use bitwise operators and NO array. ...
0
votes
2answers
128 views

Substitute multiple potentiometers for push buttons and single potentiometers

this is my first post here. For some time I have been struggling with a problem and would like to know if anyone has a solution to share. I am building a 4 tone sequencer, where I use 4 ...
1
vote
1answer
65 views

Is it possible to measure analog output?

I'm using PWM to control LED brightness using MOSFET, using analogWrite(pwmPin,val), while val is a 12 bit bit value. pwmPin is defined as- pinMode(pwmPin, OUTPUT); Since val changes in time due to ...
-1
votes
1answer
61 views

How to Read ADC value without Common GND ? (Possible or not !)

I want to Read external signal with the microcontroller. But the problem is that ADC does not work because the signal GND and the microcontroller are not Common, My question is, have you ...
1
vote
0answers
1k views

Using ESP32 to measure vbat

I'm using ESP32 to read an analog value of a liPo battery (3.7v-4.2v). Since ESP32 DAC's is 3.3v I'm using a voltage divider ( 2x10K resistors ), to split bat's voltage into ESP's GPIO36. So far ...
2
votes
3answers
172 views

What is the correct way to interpret the built-in Analog-to-Digital Converter output?

When using the built-in analog to digital converter of the Arduino Uno Rev 3's Atmega328P with a reference voltage of 5V, what is the appropriate function to interpret the output? There is conflicting ...
0
votes
0answers
43 views

Problem with Reading Multiple Analog Values From ESP8266 NodeMCU

I am using ESP8266 nodemcu with ADS1115, but values are totally wrong. Why this happened? Is there any solution to extends the Node MCU 8266 pins with accurate sensor values ?
1
vote
0answers
92 views

Need help in the problem with analog input readings and RTC DS3231

I have 3 analog input(0-1024). I want two outputs based on levels of analog inputs. Eg. inputs have 2 levels. for A0 at 300,digital output pin3 turns ON; and A0 at 500, digital output pin 4 turns ON. ...
1
vote
1answer
405 views

Why does the reading on the ESP32 read max, when the reading on UNO read accurately?

I have a 'Capacitive Soil Moisture Sensor' hooked up to my Uno. Very simple code. AnalogRead(MoistureSensorPin); This will return a differing value that I can work with. When applying the same code ...
0
votes
1answer
85 views

When does the ADC take the reading?

I'm experimenting with the "2 pin capacitance meter" and trying to make it more accurate. Currently I've made the Arduino read 62.5 ns intervals but this means the time for the ADC to read is taking ...
2
votes
2answers
194 views

ADC register always returning high

Regardless of whatever voltage at A0, the software is always returning high (1023) volatile unsigned char* ADmux = (unsigned char*) 0x7C; volatile unsigned char* ADCSRa = (unsigned char*) 0x7A; ...
2
votes
1answer
276 views

Measuring 12 V via voltage divider: choosing the right resistors

I want to measure a 9 V battery via one of the analog input ports of my Arduino Nano. From all the schemes of this great answer, I choose the simplest one, the voltage divider. Assuming the maximum ...
1
vote
1answer
64 views

Variable sets to 32767 - MATLAB Arduino

I am running out of ideas of what may be causing this problem, and I would appreciate some help identifying anything I am overlooking. Quick Problem Summary A variable gets set to 32767 quite often ...
4
votes
2answers
396 views

Noise on piezo analog read due to Arduino power supply

I am making a device that measures temperature and vibrations and records the values onto an SD card. It will be a standalone device. The hardware used: - Arduino Uno - PCF8523 RTC clock - MAX3186 + ...
1
vote
1answer
368 views

Specific ports on Teensy 3.6 not reading correct bit resolution using ADC library?

I have a basic circuit, where I'm reading analog values from 14 infrared receivers. I set the bit resolution to 16 but specific ports are returning 10 bit values (from 0 - 1024) instead of 16 bit ...
2
votes
2answers
514 views

ignoring potentiometer value variations

I've got a 50k potentiometer connected to an Arduino Uno. The user should adjust the hue of an Adafruit NeoPixelStrip. I've got the following code inside the loop function: int hue = analogRead(...
-1
votes
1answer
72 views

Sound sensor's output stucks to high values when I include a delay in the loop function

I use Waveshare's Sound Sensor module. I use this simple code to test the module: As you can see, the problem is that when I have a delay in the program, once the analogRead is bigger than 10 (by ...
0
votes
1answer
132 views

Mapping values from analog input giving unexpected values?

Mega 2560 I am reading in values from 3 pots then mapping them to values between 0 - 255 #define REDPIN 7 #define GREENPIN 8 #define BLUEPIN 9 int red_pot = A0; // analog pin used to connect ...
1
vote
0answers
108 views

Temperature varations using ADS1115 and voltage divider to read 12v

I have an issue with reading battery voltages of three 12 volt batteries using an ESP-01 and an ADS1115. I have been graphing the measurements and the all of the graphs have a temperature component ...
0
votes
1answer
997 views

Noisy analogRead

I'm trying to read voltage using Arduino, here's the code: float r1 = 99700; float r2 = 10004; float adc, voltage; unsigned long analog; void setup() { Serial.begin(9600); analogReference(...
1
vote
0answers
36 views

Strange cyclic errors in analogRead on Nano

I am trying to build an emergency shutdown of a gas valve based on the output of a smoke detector. It basically measures the voltage on the buzzer of the smoke detector, and if high enough, changes ...
0
votes
1answer
62 views

Playing Audio from SD - Get VU, or audio waveform

I am using the library SimpleSDAudio to play a song from my SD card to an op-amp later in the circuit. I would like to take a sample from the audio pin (possibly with a Analog read) to power some ...

1
2 3 4 5
7