====== Hardware, A4-Sim Related ====== Information for hardware components used on the A4 sim, both in use and trialed for proof of concept. ===== Arduino ===== * [[projects:a4sim:arduinonano:start|Arduino Nano V3 Micro Controller]] * [[projects:a4sim:arduinomega:start|Arduino Mega 2560 Microcontroller]] ===== DAC (Digital to Analog Converter) ===== Need to be able to output analog voltages to drive steam gauges. So will convert from a value like 3200 feet from the X-Plane simulator, to a voltage like 2.92 V, which will drive the gauge. Additionally, for higher-current, in addition to the DAC output, some connections will need a higher output. This will likely require higher current Op-Amps. https://www.adafruit.com/product/935 (DAC Chip breakout board) ==== Quad DAC (Digital to Anlog Convert) MCP4728 ==== {{a4sim:22187e.pdf|MCP4728 Data Sheet (Quad DAC)}} ===== Multiplexing TCA9548A ===== The Raspberry Pi has two outputs which are I2C, sort of like USB. In order to drive the high quantity of analog outputs, a multiplexing scheme will need to be developed, both in hardware and in software. This is because each device must have a unique address. Going to implement this multiplexer, because getting too much electrical interference with even 3 I2C devices with 3 foot cables. [[https://dronebotworkshop.com/multiple-i2c-bus/|DroneBotWorkshop]] says that using a multiplexer cuts down the interference by isolating devices on a separate I2C bus. See https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout which uses {{a4sim:hardware:pca9548a-1127514.pdf|PCA9548A}}. Note that PCA9548A and TCA9548A are equivalent, but TCA has extended power tolerances and improved power-on reset function. {{ :projects:a4sim:hardware:tca9548a-i2c-multiplexer-module-fritzing.png?200 |TCA9548A}} {{ :projects:a4sim:hardware:win_20200303_15_12_19_pro.jpg?400 |}} [2/22/2020] ===== HT16K33 LED Module ===== Purchased 3-pack of 8x8 LED modules (all red) with embedded HT16K33 multiplexer. Problem is, the code for this is from an Arduino, and the Arduino must be a Master, which won't work when the Raspberry Pi is the Master. * [[.ht16k33ledmodule:start|More HT16K33 LED Module]] * [[https://www.partsnotincluded.com/electronics/controlling-led-matrix-with-the-ht16k33/|HT16K33 Explanation and Example]] - Unclear, but the example works from Arduino Changed code that runs on Raspberry Pi to drive the HT16K33. Arduino not required for this. It does work, but could use some improvement, where it draws lines more than just a dot for the aileron/elevator intersection. Implemented by adding horizontal and vertical lines, with dimmed LEDs, but they flicker terribly at the slow testing speed. ===== Stepper Motors ===== * [[.steppers:28byj48steppermotor|28BYJ-48 Stepper Motor]] ===== Stepper Motor Driver ===== * [[.steppers:uln2003basedboard|ULN2003 Driver Board]] ===== ELEGOO 2.8 Inch TFT Touch Screen with SD Card Socket, for Uno R3 ===== {{a4sim:hardware:elegoo2.8tfttouchscreen.png |}} Includes plastic touch pen. ^Purchased|1/20/2020| ^Screen Size|2.8 inches| ^Weight|1.76 ounces| ^Model Number|EL-SM-004| ^Part Number|EL-SM-004| ^UNSPSC Code|32000000| ^UPC|746591610555| ^Resolution|240x320| ^Based on|ILI9341_V3.2| Because this display uses pin A4, and so does I2C, I'm concerned that this won't work with my I2C bus system. Ordering Arduino Mega 2560 clone, which uses different pins for I2C. [2/8/2020] * {{ a4sim:hardware:ili9341.pdf |ILI9341 TFT Data Sheet}} ===== Uctronics 0.96 Inch OLED Module 126x64 Yellow Blue I2C ===== ^Part Number: |U602602| ^I2C: |8 bit 0x78, 7 bit 0x3C, changeable to 0x7A/0x3D| ^Software Library: |https://github.com/supprot/ArducamSSD1306 (not very useful)\\ See https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples\\ and https://github.com/adafruit/Adafruit_SSD1306| ^VCC: |3.3V - 5V| ^GND|Ground| ^SCL|I2C Serial Clock (UNO: A5, MEGA: 21)| ^SDA|I2C Serial Data (UNO: A4, MEGA: 20)| ^Driver IC: |SSD1306| ^Module|UCT-602602| ^Size: |0.96| ^Coloring: |Top Line is Yellow, 3 bottom Lines are Blue| ^Resolution|128x64| ^Viewing Angle|> 160 degrees| No fonts internally, create fonts with software. Had to use "SSD1306_SWITCHCAPVCC" and 0x3C with Adafruit drivers to get it to work. ==== Pixel Values ==== Pixel values are either 1 or 0. The screen is made up of 8 rows of "pages" that are each 8 pixels high, giving a total of 64 rows of pixels. There are 2 seconds of pages on the screen. The top section contains 2 pages of yellow (value 1) or black (value 0). The bottom section contains 6 pages that are blue (value 1) or black (value 0). There is a black horizontal line that separates the top 2 pages from the 6 bottom pages. {{ :projects:a4sim:hardware:u602602.pdf |}} Data Sheet: https://www.uctronics.com/download/Amazon/U602602.pdf I use my special version of Adafruit's driver, modified to use SoftI2C (not Wire) so that I can have an alternate I2C bus. ===== Rotary Encoder (Cylewet CYT1100) ===== Purchased from Amazon, package of 5. {{ :projects:a4sim:hardware:rotaryencoder.png |}} {{ :projects:a4sim:hardware:pec11.pdf |}} The middle pin of the 3 pins is common, and the 2 pins are a Normally Open push button. Had to use Arduino **RotaryEncoder 1.3** which uses interrupts, so connects to A2 and A3. * http://www.mathertel.de/Arduino/RotaryEncoderLibrary.aspx * Using example "InterruptRotator.ino". Code is hard to follow but works. [4/21/2020] ===== OLED Module 12864 128x64 White SSD1306 ===== * [[oled128x64white|OLED Module 12864 128x64 White]] {{:projects:a4sim:hardware:51c52d_p2yl._ac_sl1000_.jpg?200|}} ===== MakerFocus 2pcs I2C OLED (Blue) ===== Uses SSD1306 driver. I use my special version of Adafruit's driver, modified to use SoftI2C (not Wire) so that I can have an alternate I2C bus. ^Part Number|MakerFocus X001L53UDD| ^Purchased from |Amazon| ^I2C Channel|0x3C (not changeable)| ^Pixels/Resolution|128x32 Like a single line| Amazon Title: MakerFocus 2pcs I2C OLED Display Module 0.91 Inch I2C SSD1306 OLED Display Module Blue I2C OLED Screen Driver DC 3.3V~5V for Arduino ==== LED Module only ==== ^Part ID|G-2832TLBFG02| ^Number of Pixels|128x32| ^Panel Size|30.0 x 11.5 x 1.2 (mm)| ^Active Area|22.384 x 5.584 (mm)| ^Pixel Pitch|0.175 x 0.175 (mm)| ^Pixel Size|0.159 u 0.159 (mm)| * {{ :projects:a4sim:hardware:a1lygvpsobl.pdf |LED Module User Manual/Datasheet}} ===== Waveshare 3.2 inch RPi LCD with Touch Controller ====== ^Full Description|Waveshare 3.2inch RPi LCD (C) 320X240 Resolution Touch Screen TFT Display Designed for Any Revision of Raspberry Pi 4 125MHz High-Speed SPI Directly-pluggable| ^Resolution|320x240 Pixel| ^Type|High-speed SPI| ^Touch|TXPT2046 Touch Controller| ^English Site|[[http://www.waveshare.com]]| ^Specific Page|[[https://www.waveshare.com/product/raspberry-pi/displays/lcd-oled/3.2inch-rpi-lcd-c.htm|3.2 RPi LCD (C)]]| Purchased from Amazon, 5/2020, noticing that purchasing directly from Waveshare directly may have saved about $5. After getting this working on the Raspberry Pi 4B, I figured out I can't use it, because it uses the GPIO pins I need to use for the Rotary Encoder. Instead, was able to use a LCD HDMI display. 7/4/2020 ====== Raspberry Pi Zero W ====== Trying to use Raspberry Pi Zero W as the back computer for the Garmin G5. Was successful porting the code from the X-Plane A4 cockpit to run instead on the Raspberry Pi 4. When it is running, it shows up to about 280% CPU utilization, with a minimum of 100% (probably from UDP Listener threads). Although the Raspberry Pi Zero W was working fine out of the box (in a kit), I lost the ability to SSH to it. So I'm reinstalling a Raspberry Pi OS on it, and starting over. Then I need to copy the code that was running on the 4B and compile. Let's see how far I get. 7/4/2020 ===== Basic setup ===== * Turn on SSH * Set up area under /home/pi/projects/XPlaneGarminG5Pi * ''git clone ssh://git@stopstogo.com/home/git/XPlaneGarminG5Pi'' ===== GL/glutfree.h ===== Tried doing a Make from within Geany. Getting this error: IconContainer.cpp:1:10: fatal error: GL/freeglut.h: No such file or directory #include Installing freeglut: sudo apt-get install freeglut3-dev Compiled. Was able to actually run the Garmin G5 on the Raspberry Pi Zero W. But it was running at about 1 frame per second. Investigating whether writing to FrameBuffer, bypassing OpenGL is feasible. ==== Cause X-Window (Raspberry Pi GUI) to repaint itself, clearing FrameBuffer writing ==== ''xrefresh -d :0'' ====== UCTronics B0106 ====== Bought a small HDMI screen to use with the Raspberry Pi 4. It comes with short HDMI-to-HDMI cables, but it is also not very useful, because it uses some of the GPIO pins as well. I need the GPIO pins for the Rotary Encoder. {{ :projects:a4sim:hardware:b0106.pdf |}} 12/16/2020 ====== Roller Micro Switch ====== {{ :projects:a4sim:hardware:61gqcmlbudl._ac_sl1010_.jpg?600 |}} {{ :projects:a4sim:hardware:61lg0cili8l._ac_sl1010_.jpg?600 |}} HiLetgo 10pcs KW12-3 Roller Lever Arm Micro Limit Switch Normally Open Close Limit Switch Black * 3D Model: https://thingiverse.com/thing:3382071 ====== Arduino As Joystick Interface ====== I haven't been working with Arduinos for a while. Recently set up MSFS 2020 with PMDG 737 and decided that controlling thrust and thrust reversers better than the default, or using my X52 was worth pursuing. I know that there are 3 kinds of Arduinos which appear to Windows as a Joystick: * Arduino Leonardo * Arduino Micro * Arduino Micro Pro It appears I purchased an Arduino Leonardo (which easier-to use pins), and a 3-pack of Arduino Micro Pro compatibles, both in 6/2021. ^Requirement^Comment^ ^Power Required|5V, but an upstream regulator may need 6.2V| ==== Notes ==== Rasperry Pi's require 3.3 V. To convert between 5V components, there is an IC which allows interfacing either up or down.