Short update. During my live stream today, we played with a small TFT LCD module. I shot this short video after the stream. It demonstrates the ADC digitizing an input voltage of 4.23 volts. Notice the 4-bit DAC shows the binary search. The LCD screen shows the DAC's current voltage. At the very end, you can see it go from 4.2 to 4.5 volts briefly before it settles on 4.2 volts. Missing from this video is the comparator's output. It is ON when the DAC needs to go to a higher voltage and OFF when it needs to go lower. The entire binary search algorithm is very cool, at least to me. I'll be writing that up shortly.
Getting the project to this point took longer than I expected. The process started with understanding how we can display information on the selected LCD. After a couple of hours debugging an easy mistake (forgetting to connect VCC to anything) and playing with the Adafruit_GFX library, we had a path forward. We decided the display looked best with either 1 or 2 lines of text, with the text centered.
Display Modes
At the moment, I am thinking about the final version of vADC. It will display the output voltage in two ways:
- Single Line. In this mode, it'll show the actual voltage of the DAC while searching. When complete, the value shown is the "low end" of the available binary codes.
- Two Line. This mode's first line is the "low" end, and the second line is the "high" end. So if the DAC settles on 0.90V, it will display 0.9 and 1.2V to indicate the input voltage is between those two values.
Of course, as I write this, I think a third display option is the DAC voltage on line 1 and the binary code on line 2. Not sure yet. Any ideas? If so, let me know below.
Next Steps
In project-time, the next steps are to the LCD, pushbuttons, and Arduino Nano EveryArduino Nano Every to a permaboard. Then, it is time to think of an enclosure. (Which is mostly going to be brackets.) Then some more coding to round out a few more features I'd like to add. While I have the components (and PCBs), I don't think I will have time to add additional bits to the DAC before the March 15th deadline.
In write-up time, next, I'd like to talk about how the binary search works. I also need to update the schematic for the front-end because I'm now using an LM339 LM339 comparator.