DIU Version "Apple" Notes
===

###### 2020-02-13

This document is a place to discuss version "Apple" of the Driver Interface
Unit (DIU) hardware.

This is a "living" document and is subject to updates and changes as work progresses.

Overview
---

Version "Apple" of the hardware DIU is meant to create a robust version of the DIU
using off the shelf components and custom hardware in the form of "hat" for the
Raspberry Pi board.
One item the "Apple" DIU is attempting to address is to eliminate all USB connections
as there is concern that the noisy environment will 
interfere with the high speed USB connections and cause intermittent issues.

The current version of the DIU uses USB to:

* Receive touch screen events in the form of a mouse input from the screen
* Communicate with the PIU over a USB-to-RS232 interface
* Interface with the FONA clone to receive GPS data

Version "Apple" of the DIU aims to eliminate all these USB connections and replace
them by various forms of I2C, SPI or RS232 communication interfaces.

Roadmap
---

* Use a 7 inch capacitive touch display that supports mipi-dsi and some form of I2C or SPI for touchscreen events
* Use a DAC to get sound out of the I2C or PCM line of the Raspberry Pi
* Create a "hat" to:
  - house the MAX232 (or equivalent) for PIU communication
  - act as a consolidation of I2C, SPI or UART (or other peripheral management) coming in to funnel to the Raspberry Pi
  - house the 5W/15W+ amplifier

There should be a power and sensing board created that has the following features:

* Transient suppression:
  - Input range of 8V-48V
  - 2.5kV transient suppression
* Power output
  - Provide 5V 5A (25W) rail
  - Provide 12V 1A (12W) rail
* Power monitoring
  - High side voltage and amperage monitoring
  - 5V rail voltage and amperage monitoring
  - 12V rail voltage and amperage monitoring
* Accelerometer and gyroscope (**optional**)
* Barometric pressure (**optional**)
* Temperature (**optional**)
* Vibration (**optional**)
* Gas (**optional**)



TODO
---

* Determine if the FONA clone can be powered via a 3.3v power line directly instead of through USB
* Determine whether GPS data can read from the FONA clone through another interface (SPI, I2C or UART)
* Create a rough diagram of the "hat" for the Raspberry Pi
* Research a monitor replacement
  - mipi-dsi input
  - I2C or SPI touch for mouse events
  - 3.3v input
* Find a suitable 3.3v buck converter
* Find a solution for sound

References
---

* [pHAT DAC](https://shop.pimoroni.com/products/phat-dac) ([and setup](https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install))
* [7 inch display](https://shop.pimoroni.com/products/raspberry-pi-7-touchscreen-display-with-frame)
* [SIM5320A Expansion Board](https://www.amazon.com/DIYmall-Raspberry-Expansion-SIM5320A-American/dp/B06Y3N1BD6)
* [5W amplifier](amazon.com/NOYITO-PAM8406-Digital-Amplifier-Dual-Channel/dp/B07FZYK7HG/), [5W amplifier](amazon.com/Amplifier-DROK-PAM8406-Digital-Channel/dp/B077MKQJW2)
* [15W amplifier](amazon.com/HiLetgo-PAM8610-Digital-Amplifier-Channel/dp/B00WSN9S4Q)
* [MAX232 module](amazon.com/NOYITO-Module-Conversion-Arduino-communicates/dp/B07BJJ3TZR)
* [Variable Output Voltage Buck converter](amazon.com/DROK-90483-Voltage-Regulator-Converter/dp/B00C4QVTNU/)
* [KNACRO 5.3V-40V 3.3V 5A Buck Converter](amazon.com/Converter-5-3-40V-Power-Supply-Module/dp/B0792Q9ZHZ)
* [NOYITO 8V-22V to 3.3V 2A Buck Converter](amazon.com/NOYITO-Waterproof-Overcurrent-Short-Circuit-Undervoltage/dp/B07HCTNHL7/)
* [KNACRO 8V-22V to 3.3V 3A Buck Converter](amazon.com/KNACRO-Synchronous-Over-temperature-over-current-protection/dp/B07B8CRXK6/)
* [SCI16IS740/750/760](https://www.nxp.com/docs/en/data-sheet/SC16IS740_750_760.pdf) UART with I2c/SPI interface
* [ADS1015 12 bit ADC](https://www.adafruit.com/product/1083)
* [4N25S-TA1 Optoisolator](https://www.digikey.com/product-detail/en/lite-on-inc/4N25S-TA1/160-1910-1-ND/3711405)
* [WSP2110 Gas Sensor (VOC)](https://store.arduino.cc/usa/grove-hcho-sensor)
* [BMP180 Barometric/Pressure/Temperature/Altitude Sensor](https://www.adafruit.com/product/1603)
* [MQ2 Gas Sensor (LPG, i-butane, propane, methane, alcohol, hydrogen, smoke)](https://wiki.dfrobot.com/Analog_Gas_Sensor_SKU_SEN0127)
* [MPU-6050 3-Axis Accelerometer and Gyroscope](https://www.adafruit.com/product/3886)
* [FXOS8700 + FXAS21002 9-DOF Accelerometer and Magnetometer](https://www.adafruit.com/product/3463)
* [ACS732 Current Sensor](https://www.sparkfun.com/products/13679)
* [Transient Suppression Devices and Principles - Littlefuse](https://www.littelfuse.com/~/media/electronics_technical/application_notes/varistors/littelfuse_transient_suppression_devices_and_principles_application_note.pdf)
* [INA260 Power Sensor](https://www.adafruit.com/product/4226)
* [INA169 Power Sensor](https://www.adafruit.com/product/1164) ([datasheet](https://cdn-shop.adafruit.com/datasheets/ina169.pdf) [INA169-Q1](http://www.ti.com/lit/ds/symlink/ina169-q1.pdf))
* [NA169 Breakout Board Hookup Guide](https://learn.sparkfun.com/tutorials/ina169-breakout-board-hookup-guide)
