No Description

Fabian Peter Hammerle 88280f6c09 added make target "run" to compile & run gnuradio-companion flowchart 4 weeks ago
.gitattributes b90943a0ff added photos of arduino setup 1 month ago
.gitignore f1aff33cd1 remove unused version.h 1 month ago
20201224_135747.jpg 6164cc747a replace simple voltage divider with Y-configuration of 3 resistors to support negative voltages 1 month ago
Makefile 88280f6c09 added make target "run" to compile & run gnuradio-companion flowchart 4 weeks ago
README.md 75a55e2a5c readme: added formula for Y-configuration of 3 resistors 1 month ago
arduino-sketch.ino a5482deaeb flowchart: rename serial source block 4 weeks ago
scope.grc a5482deaeb flowchart: rename serial source block 4 weeks ago
serial_source_block.py a5482deaeb flowchart: rename serial source block 4 weeks ago

README.md

Y-configuration of resistors

V_in - V_out = I_in * R_in
V_ref - V_out = I_ref * R_ref
V_out = (I_in + I_ref) * R_gnd

I_in = (V_in - V_out) / R_in
I_ref = (V_ref - V_out) / R_ref
V_out / R_gnd = I_in + I_ref =
    = (V_in - V_out) / R_in + (V_ref - V_out) / R_ref
(V_in - V_out) / R_in = V_out / R_gnd - (V_ref - V_out) / R_ref
V_in - V_out = (V_out / R_gnd - (V_ref - V_out) / R_ref) * R_in
V_in = (V_out / R_gnd - (V_ref - V_out) / R_ref) * R_in + V_out =
     = V_out * (1 + R_in / R_gnd + R_in / R_ref) - V_ref * R_in / R_ref

for V_out=0:

V_in = -V_ref * R_in / R_ref

for V_out=Vref:

V_in = V_ref * R_in / R_gnd + V_ref

alternatives:

rgco: Multichannel Arduino Oscilloscope

The 16MHz Arduino clock is too fast for the ADC to operate properly, therefore it needs to be prescaled. Prescale factors of 1 (no prescale) to 128 can be selected. By default, the Arduino IDE sets the prescale to 128, resulting in an ADC-clock period of 128/16MHz=8 microseconds, and thus a sampling period of 13*8=104 microseconds. Many tests have shown reducing the prescale to 16 results in only a slight loss of precision, while even faster clocks result in garbage.

The Arduino ADC can be operated in single acquisition or free running mode. The standard analogRead() function does a single acquisition and returns the value when the ADC is ready. […], it is also possible to use a loop and poll for the ADIF flag which indicates that the ADC reading is complete, […]

pcscope (source)

By default, the ADC configuration of the Arduino gives samples every 116µs. So here the ADC is configured with additional lines of code to get samples faster than 85µs by setting the prescaler to 16. With this, you get ADC conversion every 20µs, […]