This project involves the schematic design and PCB layout of the UI elements of an Arduino Mega controlled coffee machine. The UI elements consists of four sets of the following: a 3 digit 7 segment display, a 128x32 SSD1306 based OLED display, and a rotary encoder.
A. Discuss I2C vs. SPI, and library choice (e.g. Pins required, refresh rate, memory usage)
B. Clarify code implementation
C. Calculate power consumption to help me size a power supply
A. Schematic in an image/pdf format
B. Bill of materials
C. Compilable example code for the Arduino IDE, using either Arduino Nano or Mega
A. PCB layout files, ready to send to board house.
B. Source files (Eagle preferred, but not required)
Please see attachment for the board layout, component footprints and links to datasheets.
The “dashboard” consists of four sets of three elements each, with two sets on each PCB:
1. A three digit, common cathode 7 segment display
2. A 128x32 OLED display with SSD1306 driver
3. A incremental rotary encoder with a pushbutton, Bourns PEC
With the exception of the above, surface mount components are preferred, and should all be on the same side of the board. I’ll most likely be hand assembling the boards, so layouts and component sizes that facilitates that would be appreciated.
A ribbon cable connects the microcontroller board to PCB1, and a separate ribbon cable connects PCB1 and PCB2. If it makes more sense (/is better practice) to connect each PCB directly to the microcontroller PCB, then that’s fine too.
>> Implementation notes
These are all suggestions - I don’t know what I don’t know, so I’m open to your advice if there are better approaches.
I’d like to prioritize robustness and doing it properly, rather than trying to minimize costs. Similarly, accompanying code should be easy to understand and maintain - the code will be open source, so please take advantage of open source libraries (i.e. ledcontrol, adafruit_ssd1306,adafruit_gfx, u8glib).
The 7 segment displays could be driven by two MAX7219 (one per PCB, daisy chained), and controlled by the LedControl library.
The OLED displays are packaged as a module. They are available as SPI or I2C versions. The i2c versions all have the same i2c address, so may need an i2c multiplexer (i.e. TCA9548A) /i2c address translator (LTC4316), or another alternative I’m not aware of. I need help deciding whether to go with I2C or SPI versions. They only need to display static text for now.
The circuits for the rotary encoder should include hardware debouncing. The bourns datasheet includes a sample application circuit. I have no preference for whether it should be interrupt based, but if that provides better performance / reliability (and is the “proper way” to implement rotary encoders), then that’s fine too.
>> Example Code
The code should be packaged as a library. The library should (probably?) extend the existing OLED / 7 segment library functions so that they're addressable based on their location on the PCB (i.e. locations 0,1,2,3 from left to right). The example code should use this library to increment/decrement the value displayed on the 7 segment display using the corresponding rotary encoder. Pressing the button should toggle both the corresponding OLED and 7 segment display on and off.