pyr0ball / pyr0piezo

An AVR/ARM based piezoelectric sensor for use in ultra-precise applications
https://docs.pyroballpcbs.com/
Other
71 stars 23 forks source link

Address Arduino Code for Auto-Adjust VRef #1

Closed pyr0ball closed 5 years ago

pyr0ball commented 5 years ago

Current code for adjusting the comparator stage voltage reference is broken. Need to rework the code for adjusting the resistor ladder, or switch to using PWM + LPF

pyr0ball commented 5 years ago

Original resistor ladder functionality has been verified working. Possibly will still move to pwm/dac for more grainular control

pyr0ball commented 5 years ago

Possible code for 10-bit pwm DAC: https://www.avdweb.nl/arduino/adc-dac/fast-pwm-dac

pyr0ball commented 5 years ago

After testing, no need for 10-bit, analog write works just fine with proper filtering.

Testing (experimentation) shows best frequency response and smoothing (+7mV / -12mV) is achieved with:

10k resistor 3.3uF + 10uF SMD ceramic capacitors

image

image

image

Auto-Adjust reconfiguration can be enhanced using these topologies:

pyr0ball commented 5 years ago

Implementation fixed in https://github.com/pyr0ball/pyr0piezo/commit/2297f152071bde9b9c72eb6032e626e3b168ec5c