Don says the altimeter that the A-4 training came with was not the right one. For learning purposes, I'm creating a new altimeter to resemble it, with digital components.
Having recently started designing with 3D printing, I plan to replace the altitude digit windows with a single OLED display, the barometer with a 128×32 OLED display, the pointer hand with a stepper motor, and the barometer adjust with a rotary encoder.
I'm trying to see if a single Arduino Nano can handle all of this. The concern is that the Rotary Encoder and the Stepper Motor might both need interrupts.
This is an implementation which works with the 2 OLED displays, and a Rotary Encoder. I had to add software to establish a second I2C system to communicate with the OLED displays, because the first I2C system connects with the driver Raspberry Pi.
| Pin | Known As | What is connected to it |
|---|---|---|
| 6 | D3 | Rotary Encoder red (input) |
| 9 | D6 | I2C Out, SDA OLED 1, SDA OLED 2 |
| 10 | D7 | I2C Out, SDC OLED 1, SDC OLED 2 |
| 21 | A2 | Rotary Encoder green (input) |
| 22 | A3 | Rotary Encoder blue (input) |
| 23 | A4 | I2C In, SDA, pulled high with 1K resistor |
| 24 | A5 | I2C In, SCL, pulled high with 1K resistor |
| 29 | Ground | Ground |
| 30 | Vin | 7 - 10 volts DC |
| Pin | Known As | What is connected to it |
|---|---|---|
| 12 | D8 | ULN2003 In1 |
| 13 | D9 | ULN2003 In2 |
| 14 | D10 | ULN2003 In3 |
| 15 | D11 | ULN2003 In4 |
| Pin | Known As | What it is connected to |
|---|---|---|
| 6 | Arduino D3 | Rotary Encoder N.O. Switch Pin 1 (Red) |
| 4 | Arduino Gnd | Rotary Encoder N.O. Switch Pin 2 (Black) |
| 21 | Arduino A2 | Rotary Encoder Channel A (Green) |
| 4 | Arduino Gnd | Rotary Encoder Common Gnd (Yellow) |
| 22 | Arduino A3 | Rotary Encoder Channel B (Blue) |
Trying to add the Stepper Motor - 28BYJ-48 to the Arduino Nano V3 (on top of the 2 OLED displays and the Rotary Encoder). Initially, it wasn't working because the Arduino Stepper library blocks. But the AccelStepper library apparently doesn't block. Unfortunately, when trying to use this, getting out of memory errors from the Arduino IDE. Can potentially free up some memory by removing unneeded characters from the MS fonts, used for the OLED displays.
2/12/2021