Raspberry Pi - sgml/signature GitHub Wiki

Light and Motion

                          +----------------------+
                          |    Raspberry Pi      |
                          |   (Model 3/4/Zero)   |
                          +----------+-----------+
                                     |
        +----------------------------+----------------------------+
        |                            |                            |
        v                            v                            v
+----------------+         +----------------+         +----------------+
|  Motion Sensor |         |  Light Sensor  |         |      LED       |
|   HC-SR501     |         |   BH1750       |         | (GPIO + Resistor)|
+----------------+         +----------------+         +----------------+
| VCC --> 5V     |         | VCC --> 3.3V   |         | Anode --> GPIO27|
| GND --> GND    |         | GND --> GND    |         | Cathode --> GND |
| OUT --> GPIO17 |         | SDA --> GPIO2  |         | 220Ω resistor   |
|                |         | SCL --> GPIO3  |         | in series       |
+----------------+         +----------------+         +----------------+

Logic:
- Motion detected (GPIO17 HIGH)
- Ambient light below threshold (BH1750 reading LOW)
=> LED turns ON via GPIO27

Pi Modules and their Protocol Equivalents

+-------------------------------+-----------+-----------+-------+-----+------------+------------+-------------------------------------------------------------+
| Module Name                   | Network   | Interface | Voice | SMS | Wired      | Wireless   | UPC Link                                                    |
+-------------------------------+-----------+-----------+-------+-----+------------+------------+-------------------------------------------------------------+
| SIM800L                       | 2G GSM    | UART      | Yes   | Yes | UART       | No         | https://octopart.com/sim800l-simcom-49482540               |
| SIM900A                       | 2G GSM    | UART      | Yes   | Yes | UART       | No         | https://www.cestore-mm.com/product/sim900a-gsm-module/     |
| SIM5320E                      | 3G UMTS   | UART/USB  | Yes   | Yes | UART/USB   | No         | https://www.buycott.com/upc/720405627168                   |
| Quectel UC20                  | 3G UMTS   | UART/USB  | Yes   | Yes | UART/USB   | No         | https://www.top-electronics.com/en/uc20-g-module-on-adaptor-board-global |
| Quectel EC25                  | 4G LTE    | USB       | Yes   | Yes | USB        | No         | https://www.quectel.com/product/lte-ec25-series/           |
| Waveshare SIM7600X           | 4G LTE    | USB/UART  | Yes   | Yes | USB/UART   | No         | https://www.waveshare.com/SIM7600X.htm                     |
| DFRobot SIM7000E HAT         | LTE Cat-M1| UART      | No    | Yes | UART       | HAT        | https://wiki.dfrobot.com/SIM7000_Arduino_NB-IoT_LTE_GPRS_Expansion_Shield_SKU__DFR0505_DFR0572 |
| Sixfab 3G/4G LTE Base HAT    | 3G/4G LTE | USB/UART  | Yes   | Yes | USB/UART   | HAT        | https://sixfab.com/product/raspberry-pi-base-hat-3g-4g-lte-minipcie-cards/ |
| Waveshare SIM7600G-H 4G HAT  | 4G LTE    | USB/UART  | Yes   | Yes | USB/UART   | HAT        | https://www.waveshare.com/SIM7600G-H-4G-HAT.htm            |
| Dragino NB-IoT Shield        | NB-IoT    | UART      | No    | Yes | UART       | Shield     | https://www.dragino.com/products/nb-iot/item/130-nb-iot-shield.html |
+-------------------------------+-----------+-----------+-------+-----+------------+------------+-------------------------------------------------------------+

Pi Modules and their Phone Equivalents

Raspberry Pi Equivalent Part Name Model UPC UPC Database Link
Official 7" Touchscreen Display Display Assembly Note10+ 760575403605 UPC for Note10+ Display Assembly
Waveshare AMOLED Touch Panel Display Assembly Note10 880609253508 UPC for Note10 AMOLED Display
GPIO-connected stylus or capacitive pen S-Pen Note10/10+/Lite N/A Search S-Pen UPCs
LiPo battery pack (Adafruit 3.7V 2500mAh) Battery Note10 Lite N/A Search Note10 Lite Battery UPCs
Raspberry Pi 4 USB-C power input USB-C Charging Port All Models N/A Search USB-C Port UPCs
microSD card slot (boot media) SIM Tray All Models N/A Search SIM Tray UPCs
Camera Module lens housing Rear Camera Lens Cover Note10/10+ N/A Search Lens Cover UPCs
External biometric sensor via GPIO or USB Fingerprint Sensor Note10/10+ N/A Search Ultrasonic Sensor UPCs
Raspberry Pi Camera Module v2/v3 Front Camera Module Note10 Lite N/A Search Front Camera UPCs

VHDL

Using Raspberry Pi and Arduino to Experiment with Verilog, TCL, and VHDL

1. Set Up Your Development Environment

  • Raspberry Pi: Install a suitable operating system (e.g., Raspbian) and set up a code editor like VS Code.
  • Arduino: Install the Arduino IDE for writing and uploading sketches to the Arduino board.

2. Install Necessary Tools

  • Raspberry Pi: Install tools like GHDL (for VHDL), Icarus Verilog (for Verilog), and cocotb (for testing).
  • Arduino: Use the Arduino IDE for writing and uploading sketches.

3. Connect Raspberry Pi and Arduino

  • Use GPIO pins on the Raspberry Pi to connect to the Arduino. You can use a Serial Peripheral Interface (SPI) link for communication.

4. Write and Test Your Code

  • Verilog and VHDL: Write your HDL code using GHDL and Icarus Verilog on the Raspberry Pi. Use GTKWave for waveform analysis.
  • TCL: Use TCL scripts for automation and testing of your HDL code.
  • Arduino: Write sketches in the Arduino IDE and upload them to the Arduino board.

5. Simulate and Verify

  • Use GHDL and Icarus Verilog to simulate your HDL code on the Raspberry Pi.
  • Use cocotb to write and run testbenches for your HDL code.

Example Setup

Setting up GHDL on Raspberry Pi

sudo apt update
sudo apt install ghdl gtkwave
ghdl --version

## Blogs
* https://www.raspberrypi.org/blog/
* https://magpi.raspberrypi.org/
* https://blog.feedspot.com/raspberry_pi_rss_feeds/

## App Development
* https://magpi.raspberrypi.org/articles/develop-android-app-raspberry-pi
* https://www.wikihow.com/Make-a-Raspberry-Pi-Web-Server

## Data Modeling
* https://www.geeky-gadgets.com/easy-way-to-run-speedy-small-language-models-on-a-raspberry-pi/
* https://www.creativeapplications.net/python/the-case-for-a-small-language-model-generative-ai-and-authorship/
* https://www.geeky-gadgets.com/easy-way-to-run-speedy-small-language-models-on-a-raspberry-pi/

## Steam
* https://www.raspberrypi.org/blog/steam-link-raspberry-pi/

## Elixir
* https://elixir-lang.org/install.html#raspberry-pi-and-embedded-devices
* https://snapcraft.io/install/erlang/raspbian
* https://elinux.org/Erlang
* https://smist08.wordpress.com/2018/02/18/erlang-on-the-raspberry-pi/

## Circuits and Pins
* https://forums.ni.com/t5/Hobbyist-Toolkit/Digital-Input-on-Raspberry-Pi/m-p/4216081

## AntiMalware
* https://raspberrypi.stackexchange.com/questions/120179/

## Troubleshooting
* https://www.raspberrypi.org/forums/viewtopic.php?p=437084
* https://www.raspberrypi.org/documentation/configuration/led_blink_warnings.md

## Updating
* https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md

## Power Supply
* https://news.ycombinator.com/item?id=20276832
* https://raspberrypi.stackexchange.com/questions/100096/usb-powerbank-for-raspberry-pi-4
* https://www.zdnet.com/article/raspberry-pi-4-wont-work-with-some-power-cables-due-to-its-usb-c-design-flaw/

## Cooling
* https://core-electronics.com.au/tutorials/cooling-your-raspberry-pi.html
* https://www.freva.com/2019/08/26/placing-heatsinks-on-the-raspberry-pi-4/

## Security
* https://wiki.networksecuritytoolkit.org/nstwiki/index.php?title=NST_Getting_Started
* https://www.raspberrypi.org/documentation/configuration/security.md
* https://github.com/raspberrypi/noobs

## Bash Scripts
<pre>
function temperature() {
vcgencmd measure_temp
}

function cpu_gpu_memory_split() {
vcgencmd get_mem arm && vcgencmd get_mem gpu
}

function display_gpio_pinout() {
pinout
}

function list_usb_devices() {
lsusb
}

function wireless_config() {
iwconfig
}

</pre>

## References
* https://www.raspberrypi.org/documentation/configuration/
* https://wiki.christophchamp.com/index.php?title=Raspberry_Pi
* https://fizzy.cc/notes-for-raspberry-pi/
* https://archlinuxarm.org/wiki/Raspberry_Pi
* https://wiki.janforman.com/raspberrypi
* https://retropie.org.uk/forum/topic/23143/raspberry-pi-4b-4gb-and-the-sega-saturn/157
⚠️ **GitHub.com Fallback** ⚠️