Questions tagged [adc]

An analog-to-digital converter (ADC) is a device that converts a continuous signal to a series of digital numbers. Prefer tag [aliasing], if appropriate.

An ADC samples a continuously variable physical quantity (eg light, sound, position, voltage, etc) and periodically outputs a digital value for it.

444 questions
5
votes
2 answers

Calibrating STM32 ADC (VREFINT)

I'm trying to read VDDA on an STM32F042 microcontroller. I'm getting unexpected results with VDD at 3.29V. I must be missing something fundamental. output: VREFINT=1917; VREFINT_CAL=1524; VDDA=2623 mV VREFINT=1885; VREFINT_CAL=1524; VDDA=2668…
iter
  • 3,890
  • 6
  • 31
  • 52
5
votes
2 answers

STM32 ADC Continuous Conv Mode does not automatically start conversion

I am trying to configure ADC over a STM32F411RE in simple Continuous Conv Mode. I used CubeMX to generate the code based on HAL drivers and this is some parts of the generated code which intialize ADC: /* ADC1 init function */ void…
Nixmd
  • 655
  • 4
  • 10
  • 17
5
votes
2 answers

ADC only working once on ATMEGA324PA

I have some code which should read the values of a couple of ADC pins, each time around the commutator loop. static uint16_t adc0; static uint16_t adc1; void init(void) { ... hw_configure_adcs(); ... } void loop(void) { ... …
fadedbee
  • 37,386
  • 39
  • 142
  • 236
5
votes
3 answers

ADC single conversion on STM32

I'm studying ADC programming on STM32 F103x and starting with the simplest case - single conversion. The internal temperature sensor (connected to ADC1) value is measured and sending it to COM port by using USART. A target seems clear but when I…
lft
  • 113
  • 1
  • 1
  • 11
5
votes
1 answer

Reading raw audio values from ADC chip on raspberry pi

I wired up the MCP3008 ADC chip to an Electret Microphone and to my pi. I'm reading the input using bit-banging in python, and I'm getting an integer from 0-1024. I followed this tutorial to do the bit-banging:…
Jack Freeman
  • 1,374
  • 9
  • 17
4
votes
1 answer

Weird problem on STM32 ADC with Interleaved Mode

I am sampling a signal on STM32F3 Discovery board (stm32f303vct6) with two ADCs working in interleaved mode. It works great with a 200kHz 1V sine wave. But when I apply 10kHz 100mV sine wave, I see some interesting patterns. ADCs seem to convert all…
itlki
  • 51
  • 6
4
votes
1 answer

GBZ80 - ADC instructions fail test

I've been running Blarggs CPU tests through my Gameboy emulator, and the op r,r test shows that my ADC instruction is not working properly, but that ADD is. My understanding is that the only difference between the two is adding the existing carry…
Triforcer
  • 127
  • 9
4
votes
1 answer

How to obtain the highest sample rate possible in Raspbery Pi using a ADC?

I am working in a project using Raspberry Pi 3 B where I get data from a IR sensor(Sharp GP2Y0A21YK0F) through a ADC MPC3008 and display it in real-time using PyQtgraph library. The datasheet of the ADC says that at 5.0V, the sampling rate is…
Hugo Oliveira
  • 137
  • 1
  • 3
  • 8
4
votes
2 answers

How to read & accumulate sensor values at high frequency, without constantly writing to disk (RPi 2 b+, MCP3304, Python)

I am attempting to use a Raspberry Pi 2 Model B+ to read analog data on IR intensity from a photodiode via an MCP3304 (5v VDD) at a rate of ~ 10kHz three times in a row (0.1 ms between readings, or a rate of 10 ksps) once every second based on an…
drewbles
  • 55
  • 8
4
votes
2 answers

How to quit the program in while loop using push-button in PyQt

I have the following code which will start after clicking the 'Start' button in PyQt: def Start(self): import time import os import RPi.GPIO as GPIO import datetime GPIO.setmode(GPIO.BCM) DEBUG = 1 os.system('clear') # SPI port on…
lkkkk
  • 1,589
  • 4
  • 20
  • 27
3
votes
1 answer

Can you use all the ESP32's GPIO pins when the WiFi is working?

I have a weird phenomenon that when I add the WiFi library and all the settings, 2 out of 3 sensors stop working. When I remove the WiFi code it works like it used to. I have an esp32 devkit v1 board and connected 3 sensors which are photoresistor…
3
votes
1 answer

Control LED brightness by using MCP3002 Analog to Digital Converter

I'm trying to control a list of PWMLED brightness by using MCP3002 ADC and Potentiometer. My issue is when I run my script everything is functioning as expected, except the potentiometer that is connected to MCP3002 ADC, it won't adjust the…
MrYosuko
  • 47
  • 7
3
votes
1 answer

My Pressure Sensor Wont Output the Full Range of Values, Using a Raspberry Pi 3 and Python3

I have devised a circuit in which I am getting a pressure reading from a Dwyer 616kd-11-v Transducer with a Range of 0-500Pa, I am powering this with a 5v Power Supply and it shares a common ground to the Raspberry Pi. My ADC converter is a 16 Bit…
Almaas Shah
  • 115
  • 12
3
votes
1 answer

Sampling in RasPi3 and ADS1115 using Sample count or time.time()

I'm using Raspberry Pi 3 and ADS1115, my project requires me to get evenly spaced samples so as to plot and analyse. The other posts were about achieving 10k and 50k sps but I only require 500SPS and that isn't working either. Is there a way to run…
3
votes
2 answers

Individually read distinct inputs with STM32F0 ADC

STM32F072CBU microcontroller. I have multiple inputs to the ADC and would like to read them individually and separately. STMcubeMX produces boilerplate code which assumes I wish to read all of the inputs sequentially, and I have not been able to…
ctag
  • 434
  • 4
  • 14
1
2 3
29 30