kloon / OpenBeerFiller

An opensource beer filling line microcontroller
GNU General Public License v3.0
39 stars 13 forks source link

Use analogread for triggering the fill sensors #14

Closed kloon closed 4 years ago

kloon commented 4 years ago

This PR converts the current digital input triggers to analog ones for detecting if a fill sensor was triggered, this is to overcome stopping to early due to head foam on the beer.

It works by detecting the voltage between the pin that is pulled down with a resistor and v+, the value can be set in the config.h file and must be an integer between 0 and 1023, how the number is obtained is by taking the voltage of the pin, 5v in Uno's case and then dividing it by 1024 and multiplying it with the voltage.

Closes #11