diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000000000000000000000000000000000..fa370586604656b1b4b386d4af41bf5f1067412e --- /dev/null +++ b/.envrc @@ -0,0 +1,5 @@ +# shellcheck shell=bash + +strict_env + +PATH_add scripts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8340c174917cfac2f69f880ddca4ca8e1340eb63 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# macOS +.DS_Store + +# KiCad +/schematic/*-backups/ + +# User-specific configuration +/src/settings.toml + +# vim swap files +*~ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000000000000000000000000000000000..ee33faf47a114875e3b6fd893597df992c42052b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "printWidth": 100, + "tabWidth": 2, + "singleQuote": true, + "bracketSameLine": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..5ffd9705edf850875d404282d365f12a2397903e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.analysis.diagnosticSeverityOverrides": { + "reportMissingImports": "none", + "reportMissingModuleSource": "none", + "reportShadowedImports": "none" + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6b987ead96f93bee793c2e54a28f66aaac61ffc5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 James Ide + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index f95ae39a1c7d2c74fde8a775c947dbf907c5c7e9..1c94a2180a00e34ac33010936eef4b3a9c401c59 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,53 @@ -# ucc-door-sensor +This project was originally sourced from https://github.com/ide/pico-door-sensor/blob/main/src/code.py. +We've modified it for our purposes, so the changes are committed here. +This currently talks to an MQTT broker set up via HomeAssistant on a VM called mqtt-test. +This should probably change in the future, but considering this specifically calls into HomeAssistant it will need more major changes to detangle it. +Alternatively we can continue to run an entire HomeAssistantOS VM just to run a very lightweight MQTT broker. +This current setup is just a temporary solution.... right? - [GPO] 2024-09-18 +## Pico W Garage Door Sensor -## Getting started +Get notified when your garage door's been left open. This sensor uses the Raspberry Pi Pico W and CircuitPython and requires Home Assistant with MQTT set up. -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +## Hardware -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +The Raspberry Pi Pico W is powered by a standard 5V USB Micro B power supply. -## Add your files +GPIO 22 is pulled up to 3.3V with a 10K ohm resistor. This external pull-up resistor is stronger than the Pico's internal pull-up resistors that can be configured on the GPIO pins and helps reduce the effects of ESD on the long wires from the Pico to the reed switch. GPIO 22 also has an optional 1K ohm current-limiting resistor (even a lower value like 100 ohms is fine) to protect it from shorting to ground in case it is misconfigured as an output pin. -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +Why GPIO 22? It doesn't have any alternative function like SPI, I2C, or ADC. This leaves all the other GPIO pins free if you want to attach a screen or other peripherals to your Pico. -``` -cd existing_repo -git remote add origin https://gitlab.ucc.asn.au/UCC/ucc-door-sensor.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.ucc.asn.au/UCC/ucc-door-sensor/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** +You could add a small capacitor to debounce the reed switch in hardware but this project debounces the GPIO pin in software. -# Editing this README +### Schematic -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. + -## Suggestions for a good README +### BOM -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +| Reference | Part description | Example part # | +|-----------|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| R1 | 1K ohm current-limiting resistor (optional) | [CF14JT1K00](https://www.digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT1K00/1741314) | +| R2 | 1K ohm pull-up resistor | [CF14JT10K0](https://www.digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT10K0/1741265) | +| SW1 | SPST NC reed switch | [59140-4-S-02-F](https://www.digikey.com/en/products/detail/littelfuse-inc/59140-4-S-02-F/4780045) and [57140-000](https://www.digikey.com/en/products/detail/littelfuse-inc/57140-000/43978) | +| U1 | Raspberry Pi Pico W | [04025C104KAT2A](https://www.digikey.com/en/products/detail/kyocera-avx/04025C104KAT2A/6564238) | +| | USB Micro B power supply (5V@1A is plenty) | | +| | Stranded copper wire, 22-24 AWG (long enough to reach your garage door from the Pico and back) | | +## Software -## Name -Choose a self-explaining name for your project. +Install CircuitPython 8 on your Pico W using [a .uf2 file](https://circuitpython.org/board/raspberry_pi_pico_w/) from the CircuitPython website. -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +Create settings.toml under src or directly in your CIRCUITPY drive and define the following environment variables: +```toml +CIRCUITPY_WIFI_SSID = "your Wi-Fi access point's name" +CIRCUITPY_WIFI_PASSWORD = "your Wi-Fi password" -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +MQTT_HOSTNAME = "your MQTT broker's hostname" +MQTT_USERNAME = "the username to use with your MQTT broker" +MQTT_PASSWORD = "the password to use with your MQTT broker" -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. +WIFI_HOSTNAME = "garagesensor" +``` -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +There are convenient scripts under the `scripts` directory for deploying software to your Pico W and connecting to its REPL. Only macOS is supported. diff --git a/assets/icon-1024.avif b/assets/icon-1024.avif new file mode 100644 index 0000000000000000000000000000000000000000..31a20b087a5e66cf844b99736cc4ef986d7e85a9 Binary files /dev/null and b/assets/icon-1024.avif differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..a6dfcce63a74ae9063879c9b5c6a5bd8fa3aa8c4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +adafruit_debouncer==2.0.8 +adafruit_logging==5.2.5 +adafruit_ticks==1.0.13 +adafruit_minimqtt==7.5.6 diff --git a/schematic/Pico W Garage Door Sensor.kicad_prl b/schematic/Pico W Garage Door Sensor.kicad_prl new file mode 100644 index 0000000000000000000000000000000000000000..c83ee3e3bd740d5c287b48db8f0aba0323da03e8 --- /dev/null +++ b/schematic/Pico W Garage Door Sensor.kicad_prl @@ -0,0 +1,75 @@ +{ + "board": { + "active_layer": 0, + "active_layer_preset": "", + "auto_track_width": true, + "hidden_nets": [], + "high_contrast_mode": 0, + "net_color_mode": 1, + "opacity": { + "pads": 1.0, + "tracks": 1.0, + "vias": 1.0, + "zones": 0.6 + }, + "ratsnest_display_mode": 0, + "selection_filter": { + "dimensions": true, + "footprints": true, + "graphics": true, + "keepouts": true, + "lockedItems": true, + "otherItems": true, + "pads": true, + "text": true, + "tracks": true, + "vias": true, + "zones": true + }, + "visible_items": [ + 0, + 1, + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 32, + 33, + 34, + 35, + 36 + ], + "visible_layers": "fffffff_ffffffff", + "zone_display_mode": 0 + }, + "meta": { + "filename": "Pico W Garage Door Sensor.kicad_prl", + "version": 3 + }, + "project": { + "files": [] + } +} diff --git a/schematic/Pico W Garage Door Sensor.kicad_pro b/schematic/Pico W Garage Door Sensor.kicad_pro new file mode 100644 index 0000000000000000000000000000000000000000..690fd8d4f9235430cc630c1f3b6b985010bfa1b5 --- /dev/null +++ b/schematic/Pico W Garage Door Sensor.kicad_pro @@ -0,0 +1,326 @@ +{ + "board": { + "design_settings": { + "defaults": { + "board_outline_line_width": 0.1, + "copper_line_width": 0.2, + "copper_text_size_h": 1.5, + "copper_text_size_v": 1.5, + "copper_text_thickness": 0.3, + "other_line_width": 0.15, + "silk_line_width": 0.15, + "silk_text_size_h": 1.0, + "silk_text_size_v": 1.0, + "silk_text_thickness": 0.15 + }, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "rules": { + "min_copper_edge_clearance": 0.0, + "solder_mask_clearance": 0.0, + "solder_mask_min_width": 0.0 + }, + "track_widths": [], + "via_dimensions": [] + }, + "layer_presets": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "erc": { + "erc_exclusions": [], + "meta": { + "version": 0 + }, + "pin_map": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 2 + ], + [ + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ], + [ + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 2, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ] + ], + "rule_severities": { + "bus_definition_conflict": "error", + "bus_entry_needed": "error", + "bus_label_syntax": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "warning", + "multiple_net_names": "warning", + "net_not_bus_member": "warning", + "no_connect_connected": "warning", + "no_connect_dangling": "warning", + "pin_not_connected": "error", + "pin_not_driven": "error", + "pin_to_pin": "warning", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "Pico W Garage Door Sensor.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12.0, + "clearance": 0.2, + "diff_pair_gap": 0.25, + "diff_pair_via_gap": 0.25, + "diff_pair_width": 0.2, + "line_style": 0, + "microvia_diameter": 0.3, + "microvia_drill": 0.1, + "name": "Default", + "pcb_color": "rgba(0, 0, 0, 0.000)", + "schematic_color": "rgba(0, 0, 0, 0.000)", + "track_width": 0.25, + "via_diameter": 0.8, + "via_drill": 0.4, + "wire_width": 6.0 + } + ], + "meta": { + "version": 2 + }, + "net_colors": null + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "specctra_dsn": "", + "step": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "drawing": { + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "", + "ngspice": { + "fix_include_paths": true, + "fix_passive_vals": false, + "meta": { + "version": 0 + }, + "model_mode": 0, + "workbook_filename": "" + }, + "page_layout_descr_file": "", + "plot_directory": "", + "spice_adjust_passive_values": false, + "spice_external_command": "spice \"%I\"", + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "cb0df74b-abe3-4edc-836e-8346f3166762", + "" + ] + ], + "text_variables": {} +} diff --git a/schematic/Pico W Garage Door Sensor.kicad_sch b/schematic/Pico W Garage Door Sensor.kicad_sch new file mode 100644 index 0000000000000000000000000000000000000000..7fa5ab0b8f885c0a9af213e206ba0923f0d4ac2c --- /dev/null +++ b/schematic/Pico W Garage Door Sensor.kicad_sch @@ -0,0 +1,595 @@ +(kicad_sch (version 20211123) (generator eeschema) + + (uuid cb0df74b-abe3-4edc-836e-8346f3166762) + + (paper "A4") + + (lib_symbols + (symbol "Device:R_US" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "R" (id 0) (at 2.54 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R_US" (id 1) (at -2.54 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at 1.016 -0.254 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "R res resistor" (id 4) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Resistor, US symbol" (id 5) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_fp_filters" "R_*" (id 6) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "R_US_0_1" + (polyline + (pts + (xy 0 -2.286) + (xy 0 -2.54) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 2.286) + (xy 0 2.54) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 -0.762) + (xy 1.016 -1.143) + (xy 0 -1.524) + (xy -1.016 -1.905) + (xy 0 -2.286) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 0.762) + (xy 1.016 0.381) + (xy 0 0) + (xy -1.016 -0.381) + (xy 0 -0.762) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 0 2.286) + (xy 1.016 1.905) + (xy 0 1.524) + (xy -1.016 1.143) + (xy 0 0.762) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + ) + (symbol "R_US_1_1" + (pin passive line (at 0 3.81 270) (length 1.27) + (name "~" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin passive line (at 0 -3.81 90) (length 1.27) + (name "~" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "RPi_Pico:PicoW" (pin_names (offset 1.016)) (in_bom yes) (on_board yes) + (property "Reference" "U" (id 0) (at -13.97 27.94 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "PicoW" (id 1) (at 0 19.05 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "RPi_PicoW:RPi_Pico_SMD_TH" (id 2) (at 0 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "PicoW_0_0" + (text "Raspberry Pi" (at 0 21.59 0) + (effects (font (size 1.27 1.27))) + ) + ) + (symbol "PicoW_0_1" + (rectangle (start -15.24 26.67) (end 15.24 -26.67) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type background)) + ) + ) + (symbol "PicoW_1_1" + (pin bidirectional line (at -17.78 24.13 0) (length 2.54) + (name "GPIO0" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 1.27 0) (length 2.54) + (name "GPIO7" (effects (font (size 1.27 1.27)))) + (number "10" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -1.27 0) (length 2.54) + (name "GPIO8" (effects (font (size 1.27 1.27)))) + (number "11" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -3.81 0) (length 2.54) + (name "GPIO9" (effects (font (size 1.27 1.27)))) + (number "12" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "13" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -8.89 0) (length 2.54) + (name "GPIO10" (effects (font (size 1.27 1.27)))) + (number "14" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -11.43 0) (length 2.54) + (name "GPIO11" (effects (font (size 1.27 1.27)))) + (number "15" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -13.97 0) (length 2.54) + (name "GPIO12" (effects (font (size 1.27 1.27)))) + (number "16" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -16.51 0) (length 2.54) + (name "GPIO13" (effects (font (size 1.27 1.27)))) + (number "17" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "18" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -21.59 0) (length 2.54) + (name "GPIO14" (effects (font (size 1.27 1.27)))) + (number "19" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 21.59 0) (length 2.54) + (name "GPIO1" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -24.13 0) (length 2.54) + (name "GPIO15" (effects (font (size 1.27 1.27)))) + (number "20" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -24.13 180) (length 2.54) + (name "GPIO16" (effects (font (size 1.27 1.27)))) + (number "21" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -21.59 180) (length 2.54) + (name "GPIO17" (effects (font (size 1.27 1.27)))) + (number "22" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "23" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -16.51 180) (length 2.54) + (name "GPIO18" (effects (font (size 1.27 1.27)))) + (number "24" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -13.97 180) (length 2.54) + (name "GPIO19" (effects (font (size 1.27 1.27)))) + (number "25" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -11.43 180) (length 2.54) + (name "GPIO20" (effects (font (size 1.27 1.27)))) + (number "26" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -8.89 180) (length 2.54) + (name "GPIO21" (effects (font (size 1.27 1.27)))) + (number "27" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -6.35 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "28" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -3.81 180) (length 2.54) + (name "GPIO22" (effects (font (size 1.27 1.27)))) + (number "29" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "3" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 -1.27 180) (length 2.54) + (name "RUN" (effects (font (size 1.27 1.27)))) + (number "30" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 1.27 180) (length 2.54) + (name "GPIO26_ADC0" (effects (font (size 1.27 1.27)))) + (number "31" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 3.81 180) (length 2.54) + (name "GPIO27_ADC1" (effects (font (size 1.27 1.27)))) + (number "32" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 6.35 180) (length 2.54) + (name "AGND" (effects (font (size 1.27 1.27)))) + (number "33" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 8.89 180) (length 2.54) + (name "GPIO28_ADC2" (effects (font (size 1.27 1.27)))) + (number "34" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 11.43 180) (length 2.54) + (name "ADC_VREF" (effects (font (size 1.27 1.27)))) + (number "35" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 13.97 180) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "36" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 16.51 180) (length 2.54) + (name "3V3_EN" (effects (font (size 1.27 1.27)))) + (number "37" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "38" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 21.59 180) (length 2.54) + (name "VSYS" (effects (font (size 1.27 1.27)))) + (number "39" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 16.51 0) (length 2.54) + (name "GPIO2" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 24.13 180) (length 2.54) + (name "VBUS" (effects (font (size 1.27 1.27)))) + (number "40" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at -2.54 -29.21 90) (length 2.54) + (name "SWCLK" (effects (font (size 1.27 1.27)))) + (number "41" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 0 -29.21 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "42" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 2.54 -29.21 90) (length 2.54) + (name "SWDIO" (effects (font (size 1.27 1.27)))) + (number "43" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 13.97 0) (length 2.54) + (name "GPIO3" (effects (font (size 1.27 1.27)))) + (number "5" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 11.43 0) (length 2.54) + (name "GPIO4" (effects (font (size 1.27 1.27)))) + (number "6" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 8.89 0) (length 2.54) + (name "GPIO5" (effects (font (size 1.27 1.27)))) + (number "7" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "8" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 3.81 0) (length 2.54) + (name "GPIO6" (effects (font (size 1.27 1.27)))) + (number "9" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "Switch:SW_Reed_Opener" (pin_numbers hide) (pin_names (offset 0) hide) (in_bom yes) (on_board yes) + (property "Reference" "SW" (id 0) (at 0 2.54 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "SW_Reed_Opener" (id 1) (at 0 -2.54 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "reed magnetic switch" (id 4) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "reed switch, default-closed" (id 5) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "SW_Reed_Opener_0_0" + (arc (start -2.159 1.397) (mid -3.556 0) (end -2.159 -1.397) + (stroke (width 0.254) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy -2.54 0) + (xy 1.27 0.254) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy -2.159 -1.397) + (xy 2.286 -1.397) + ) + (stroke (width 0.254) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 2.159 1.397) + (xy -2.159 1.397) + ) + (stroke (width 0.254) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (polyline + (pts + (xy 2.54 0) + (xy -1.27 -0.254) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + (arc (start 2.159 -1.397) (mid 3.556 0) (end 2.159 1.397) + (stroke (width 0.254) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + ) + (symbol "SW_Reed_Opener_0_1" + (rectangle (start -1.1684 0.0508) (end -0.8636 -0.2032) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type outline)) + ) + (rectangle (start 0.889 0.1778) (end 1.143 -0.0762) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type outline)) + ) + ) + (symbol "SW_Reed_Opener_1_1" + (pin passive line (at -5.08 0 0) (length 2.54) + (name "1" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin passive line (at 5.08 0 180) (length 2.54) + (name "2" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "#PWR" (id 0) (at 0 -6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 0 -3.81 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "power-flag" (id 4) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (id 5) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "GND_0_1" + (polyline + (pts + (xy 0 0) + (xy 0 -1.27) + (xy 1.27 -1.27) + (xy 0 -2.54) + (xy -1.27 -1.27) + (xy 0 -1.27) + ) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type none)) + ) + ) + (symbol "GND_1_1" + (pin power_in line (at 0 0 270) (length 0) hide + (name "GND" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + ) + ) + ) + + (junction (at 120.65 95.25) (diameter 0) (color 0 0 0 0) + (uuid 3413a5fd-904c-4181-bde2-b5c0feb692d2) + ) + + (wire (pts (xy 120.65 90.17) (xy 120.65 95.25)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid 0036840e-c9fc-42a8-9326-3d5edf7982cd) + ) + (wire (pts (xy 151.13 95.25) (xy 151.13 100.33)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid 183d891e-8c0b-4117-808f-3f9b64b7438b) + ) + (wire (pts (xy 115.57 95.25) (xy 120.65 95.25)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid 9ab444e2-e35e-4ea1-848e-cb86742718cb) + ) + (wire (pts (xy 120.65 77.47) (xy 120.65 82.55)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid a2c47712-ae64-4695-9fb5-3b030e2fdc15) + ) + (wire (pts (xy 105.41 95.25) (xy 107.95 95.25)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid adc598bd-ea36-4ec5-bc43-86bc8ef55c73) + ) + (wire (pts (xy 105.41 77.47) (xy 120.65 77.47)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid b3708f6a-da6b-4dc7-a70c-a890cce8340d) + ) + (wire (pts (xy 120.65 95.25) (xy 140.97 95.25)) + (stroke (width 0) (type default) (color 0 0 0 0)) + (uuid de4e1540-20d9-484b-942b-b598b107a4e5) + ) + + (text "NC reed switch is open when\ngarage door is closed" (at 133.35 86.36 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 9a3e4e68-5d11-4c7d-ba10-608201bff32a) + ) + + (symbol (lib_id "power:GND") (at 151.13 100.33 0) (unit 1) + (in_bom yes) (on_board yes) (fields_autoplaced) + (uuid 13396061-3cb4-4afc-8717-1b56b16f41f3) + (property "Reference" "#PWR?" (id 0) (at 151.13 106.68 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 151.13 104.7734 0)) + (property "Footprint" "" (id 2) (at 151.13 100.33 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 151.13 100.33 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid bf62229b-bc45-42ae-b0c7-749ed03a6041)) + ) + + (symbol (lib_id "Switch:SW_Reed_Opener") (at 146.05 95.25 0) (unit 1) + (in_bom yes) (on_board yes) (fields_autoplaced) + (uuid 328b38ef-a2b7-4ab3-a0eb-7a1179ab24c0) + (property "Reference" "SW1" (id 0) (at 146.05 90.1532 0)) + (property "Value" "NC Reed Switch" (id 1) (at 146.05 92.6901 0)) + (property "Footprint" "" (id 2) (at 146.05 95.25 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 146.05 95.25 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 3cfbddd0-a0f9-4c0b-a87b-1f38d0415582)) + (pin "2" (uuid 61d050f0-b297-4b1e-a188-34dee27bfb1f)) + ) + + (symbol (lib_id "Device:R_US") (at 111.76 95.25 90) (unit 1) + (in_bom yes) (on_board yes) (fields_autoplaced) + (uuid 57f2749f-6f43-4221-9891-3f16c9653421) + (property "Reference" "R1" (id 0) (at 111.76 90.6612 90)) + (property "Value" "1K" (id 1) (at 111.76 93.1981 90)) + (property "Footprint" "" (id 2) (at 112.014 94.234 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 111.76 95.25 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid dfbbcc88-656b-4e9f-b848-0deb9a55da80)) + (pin "2" (uuid 3b9ab267-5f31-473a-80f2-98fb9eae99e4)) + ) + + (symbol (lib_id "Device:R_US") (at 120.65 86.36 0) (unit 1) + (in_bom yes) (on_board yes) (fields_autoplaced) + (uuid a0ef99f4-b182-456e-8021-4d063f5cf58a) + (property "Reference" "R2" (id 0) (at 122.301 85.5253 0) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Value" "10K" (id 1) (at 122.301 88.0622 0) + (effects (font (size 1.27 1.27)) (justify left)) + ) + (property "Footprint" "" (id 2) (at 121.666 86.614 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 120.65 86.36 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid fcaf14ea-2d58-43bc-b8a5-c51080db4ea1)) + (pin "2" (uuid 9f54183f-6997-408f-973a-d315822080f0)) + ) + + (symbol (lib_id "RPi_Pico:PicoW") (at 87.63 91.44 0) (unit 1) + (in_bom yes) (on_board yes) (fields_autoplaced) + (uuid fe1fdc39-9600-4d6c-856f-ef0e5f68b7ee) + (property "Reference" "U1" (id 0) (at 87.63 61.1972 0)) + (property "Value" "PicoW" (id 1) (at 87.63 63.7341 0)) + (property "Footprint" "RPi_PicoW:RPi_Pico_SMD_TH" (id 2) (at 87.63 91.44 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 87.63 91.44 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid d2c2524e-7e5d-4262-8732-cd2725e92bcb)) + (pin "10" (uuid f899974b-e7b6-4c12-9729-273c9a7d06b6)) + (pin "11" (uuid fc2d16da-ff11-4b35-8533-e687355d0d51)) + (pin "12" (uuid 057f3f50-8f2a-44bf-bba1-d611fce6ebab)) + (pin "13" (uuid 0f461d3d-7b16-4542-9085-bf97f3a6f972)) + (pin "14" (uuid 290a9e07-1d3e-4a37-b020-a7ddfd53556c)) + (pin "15" (uuid d744439f-00a9-4ffb-a365-4128b4853e8e)) + (pin "16" (uuid 3a1f3903-a0d8-4ee2-8b15-162a73050880)) + (pin "17" (uuid afabd828-c5aa-4ee4-bc29-5fbe399fe5c8)) + (pin "18" (uuid 97e81261-fcbd-47ff-96af-f11f280173e3)) + (pin "19" (uuid f2bc3f98-35ce-4693-8929-10c0c9cb79fe)) + (pin "2" (uuid 8ab2c162-fdaf-4fdb-b5f4-03104aad845b)) + (pin "20" (uuid 9d30ff5c-2070-458e-b2c5-93d3d77d736e)) + (pin "21" (uuid def3d649-bdf3-42b2-9975-7634c80b95f2)) + (pin "22" (uuid 48474604-90b7-4a13-b7b7-34327e9412c8)) + (pin "23" (uuid bfa9200b-5007-46e8-8c8d-335a030018e1)) + (pin "24" (uuid c0ef6ba7-e599-4f48-9a0f-622134cb4045)) + (pin "25" (uuid 02f93d96-454a-45e3-b930-ecf9e436c9f1)) + (pin "26" (uuid dcc2894c-4731-4a18-930b-89ab768badfd)) + (pin "27" (uuid 93223f8c-1db4-4389-9ff5-56d442f2876a)) + (pin "28" (uuid 27bf3d67-ad90-4f7a-a9f2-ae218c440ac6)) + (pin "29" (uuid df357f67-f4be-461a-ac44-1a76a9ebf250)) + (pin "3" (uuid d6f2d2e9-416e-4bb7-a5d7-99b266aa2148)) + (pin "30" (uuid 39576288-5a9c-456f-acda-3a7a2f3a2949)) + (pin "31" (uuid 15e6c084-6275-40ae-95f1-08248a5e3b96)) + (pin "32" (uuid 168d9af8-e88a-4747-a867-b6bd1b2acdb8)) + (pin "33" (uuid db91688b-162e-492f-a5de-e87c5a9afe37)) + (pin "34" (uuid 3a2fa5aa-1d99-4524-bfbf-d1aea7703116)) + (pin "35" (uuid 0b71daa1-733c-4693-98ee-ad472c6c41f6)) + (pin "36" (uuid 7594625b-8c6c-4a69-a9f4-9f30228d0426)) + (pin "37" (uuid 7120c24e-c784-4b60-a6e9-5df3f40b272f)) + (pin "38" (uuid 2dd4d4ed-74e3-461f-b358-9bd4797dbd7d)) + (pin "39" (uuid 051f6132-3caa-4ac3-bd10-39f08fd089c6)) + (pin "4" (uuid a5686083-e8ec-4eb6-a92f-8f1697a022c6)) + (pin "40" (uuid fa447135-a3df-4ca4-b00e-389ee5aa16de)) + (pin "41" (uuid 64578fdd-b366-43bd-a506-535f47f295d0)) + (pin "42" (uuid ddb9be6a-565e-41e6-a9ca-458a7d743eec)) + (pin "43" (uuid ff103d88-43b9-4a71-a690-6be3655dfa1c)) + (pin "5" (uuid f46f0c06-52a5-46fb-8248-10a00a65f63a)) + (pin "6" (uuid 2cac45b9-ebe5-449f-8584-38d1444f8530)) + (pin "7" (uuid 4523dc41-b99a-46f1-97a9-f6ed55a53ba3)) + (pin "8" (uuid d90d43ae-7df4-43e3-baec-ad58cb3df024)) + (pin "9" (uuid 1efeaa34-bee2-4667-83c5-ede772fc7e08)) + ) + + (sheet_instances + (path "/" (page "1")) + ) + + (symbol_instances + (path "/13396061-3cb4-4afc-8717-1b56b16f41f3" + (reference "#PWR?") (unit 1) (value "GND") (footprint "") + ) + (path "/57f2749f-6f43-4221-9891-3f16c9653421" + (reference "R1") (unit 1) (value "1K") (footprint "") + ) + (path "/a0ef99f4-b182-456e-8021-4d063f5cf58a" + (reference "R2") (unit 1) (value "10K") (footprint "") + ) + (path "/328b38ef-a2b7-4ab3-a0eb-7a1179ab24c0" + (reference "SW1") (unit 1) (value "NC Reed Switch") (footprint "") + ) + (path "/fe1fdc39-9600-4d6c-856f-ef0e5f68b7ee" + (reference "U1") (unit 1) (value "PicoW") (footprint "RPi_PicoW:RPi_Pico_SMD_TH") + ) + ) +) diff --git a/schematic/RPi_Pico.kicad_sym b/schematic/RPi_Pico.kicad_sym new file mode 100644 index 0000000000000000000000000000000000000000..b5747139a4f2ddce430bb3fefef75d12052ec283 --- /dev/null +++ b/schematic/RPi_Pico.kicad_sym @@ -0,0 +1,400 @@ +(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor) + (symbol "Pico" (pin_names (offset 1.016)) (in_bom yes) (on_board yes) + (property "Reference" "U" (id 0) (at -13.97 27.94 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "Pico" (id 1) (at 0 19.05 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "RPi_Pico:RPi_Pico_SMD_TH" (id 2) (at 0 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "Pico_0_0" + (text "Raspberry Pi" (at 0 21.59 0) + (effects (font (size 1.27 1.27))) + ) + ) + (symbol "Pico_0_1" + (rectangle (start -15.24 26.67) (end 15.24 -26.67) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type background)) + ) + ) + (symbol "Pico_1_1" + (pin bidirectional line (at -17.78 24.13 0) (length 2.54) + (name "GPIO0" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 1.27 0) (length 2.54) + (name "GPIO7" (effects (font (size 1.27 1.27)))) + (number "10" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -1.27 0) (length 2.54) + (name "GPIO8" (effects (font (size 1.27 1.27)))) + (number "11" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -3.81 0) (length 2.54) + (name "GPIO9" (effects (font (size 1.27 1.27)))) + (number "12" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "13" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -8.89 0) (length 2.54) + (name "GPIO10" (effects (font (size 1.27 1.27)))) + (number "14" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -11.43 0) (length 2.54) + (name "GPIO11" (effects (font (size 1.27 1.27)))) + (number "15" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -13.97 0) (length 2.54) + (name "GPIO12" (effects (font (size 1.27 1.27)))) + (number "16" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -16.51 0) (length 2.54) + (name "GPIO13" (effects (font (size 1.27 1.27)))) + (number "17" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "18" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -21.59 0) (length 2.54) + (name "GPIO14" (effects (font (size 1.27 1.27)))) + (number "19" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 21.59 0) (length 2.54) + (name "GPIO1" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -24.13 0) (length 2.54) + (name "GPIO15" (effects (font (size 1.27 1.27)))) + (number "20" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -24.13 180) (length 2.54) + (name "GPIO16" (effects (font (size 1.27 1.27)))) + (number "21" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -21.59 180) (length 2.54) + (name "GPIO17" (effects (font (size 1.27 1.27)))) + (number "22" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "23" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -16.51 180) (length 2.54) + (name "GPIO18" (effects (font (size 1.27 1.27)))) + (number "24" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -13.97 180) (length 2.54) + (name "GPIO19" (effects (font (size 1.27 1.27)))) + (number "25" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -11.43 180) (length 2.54) + (name "GPIO20" (effects (font (size 1.27 1.27)))) + (number "26" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -8.89 180) (length 2.54) + (name "GPIO21" (effects (font (size 1.27 1.27)))) + (number "27" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -6.35 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "28" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -3.81 180) (length 2.54) + (name "GPIO22" (effects (font (size 1.27 1.27)))) + (number "29" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "3" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 -1.27 180) (length 2.54) + (name "RUN" (effects (font (size 1.27 1.27)))) + (number "30" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 1.27 180) (length 2.54) + (name "GPIO26_ADC0" (effects (font (size 1.27 1.27)))) + (number "31" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 3.81 180) (length 2.54) + (name "GPIO27_ADC1" (effects (font (size 1.27 1.27)))) + (number "32" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 6.35 180) (length 2.54) + (name "AGND" (effects (font (size 1.27 1.27)))) + (number "33" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 8.89 180) (length 2.54) + (name "GPIO28_ADC2" (effects (font (size 1.27 1.27)))) + (number "34" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 11.43 180) (length 2.54) + (name "ADC_VREF" (effects (font (size 1.27 1.27)))) + (number "35" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 13.97 180) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "36" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 16.51 180) (length 2.54) + (name "3V3_EN" (effects (font (size 1.27 1.27)))) + (number "37" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "38" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 21.59 180) (length 2.54) + (name "VSYS" (effects (font (size 1.27 1.27)))) + (number "39" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 16.51 0) (length 2.54) + (name "GPIO2" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 24.13 180) (length 2.54) + (name "VBUS" (effects (font (size 1.27 1.27)))) + (number "40" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at -2.54 -29.21 90) (length 2.54) + (name "SWCLK" (effects (font (size 1.27 1.27)))) + (number "41" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 0 -29.21 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "42" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 2.54 -29.21 90) (length 2.54) + (name "SWDIO" (effects (font (size 1.27 1.27)))) + (number "43" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 13.97 0) (length 2.54) + (name "GPIO3" (effects (font (size 1.27 1.27)))) + (number "5" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 11.43 0) (length 2.54) + (name "GPIO4" (effects (font (size 1.27 1.27)))) + (number "6" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 8.89 0) (length 2.54) + (name "GPIO5" (effects (font (size 1.27 1.27)))) + (number "7" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "8" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 3.81 0) (length 2.54) + (name "GPIO6" (effects (font (size 1.27 1.27)))) + (number "9" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "PicoW" (pin_names (offset 1.016)) (in_bom yes) (on_board yes) + (property "Reference" "U" (id 0) (at -13.97 27.94 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "PicoW" (id 1) (at 0 19.05 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "RPi_PicoW:RPi_Pico_SMD_TH" (id 2) (at 0 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "PicoW_0_0" + (text "Raspberry Pi" (at 0 21.59 0) + (effects (font (size 1.27 1.27))) + ) + ) + (symbol "PicoW_0_1" + (rectangle (start -15.24 26.67) (end 15.24 -26.67) + (stroke (width 0) (type default) (color 0 0 0 0)) + (fill (type background)) + ) + ) + (symbol "PicoW_1_1" + (pin bidirectional line (at -17.78 24.13 0) (length 2.54) + (name "GPIO0" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 1.27 0) (length 2.54) + (name "GPIO7" (effects (font (size 1.27 1.27)))) + (number "10" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -1.27 0) (length 2.54) + (name "GPIO8" (effects (font (size 1.27 1.27)))) + (number "11" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -3.81 0) (length 2.54) + (name "GPIO9" (effects (font (size 1.27 1.27)))) + (number "12" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "13" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -8.89 0) (length 2.54) + (name "GPIO10" (effects (font (size 1.27 1.27)))) + (number "14" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -11.43 0) (length 2.54) + (name "GPIO11" (effects (font (size 1.27 1.27)))) + (number "15" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -13.97 0) (length 2.54) + (name "GPIO12" (effects (font (size 1.27 1.27)))) + (number "16" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -16.51 0) (length 2.54) + (name "GPIO13" (effects (font (size 1.27 1.27)))) + (number "17" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 -19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "18" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -21.59 0) (length 2.54) + (name "GPIO14" (effects (font (size 1.27 1.27)))) + (number "19" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 21.59 0) (length 2.54) + (name "GPIO1" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 -24.13 0) (length 2.54) + (name "GPIO15" (effects (font (size 1.27 1.27)))) + (number "20" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -24.13 180) (length 2.54) + (name "GPIO16" (effects (font (size 1.27 1.27)))) + (number "21" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -21.59 180) (length 2.54) + (name "GPIO17" (effects (font (size 1.27 1.27)))) + (number "22" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "23" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -16.51 180) (length 2.54) + (name "GPIO18" (effects (font (size 1.27 1.27)))) + (number "24" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -13.97 180) (length 2.54) + (name "GPIO19" (effects (font (size 1.27 1.27)))) + (number "25" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -11.43 180) (length 2.54) + (name "GPIO20" (effects (font (size 1.27 1.27)))) + (number "26" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -8.89 180) (length 2.54) + (name "GPIO21" (effects (font (size 1.27 1.27)))) + (number "27" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 -6.35 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "28" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 -3.81 180) (length 2.54) + (name "GPIO22" (effects (font (size 1.27 1.27)))) + (number "29" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 19.05 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "3" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 -1.27 180) (length 2.54) + (name "RUN" (effects (font (size 1.27 1.27)))) + (number "30" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 1.27 180) (length 2.54) + (name "GPIO26_ADC0" (effects (font (size 1.27 1.27)))) + (number "31" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 3.81 180) (length 2.54) + (name "GPIO27_ADC1" (effects (font (size 1.27 1.27)))) + (number "32" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 17.78 6.35 180) (length 2.54) + (name "AGND" (effects (font (size 1.27 1.27)))) + (number "33" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 8.89 180) (length 2.54) + (name "GPIO28_ADC2" (effects (font (size 1.27 1.27)))) + (number "34" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 11.43 180) (length 2.54) + (name "ADC_VREF" (effects (font (size 1.27 1.27)))) + (number "35" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 13.97 180) (length 2.54) + (name "3V3" (effects (font (size 1.27 1.27)))) + (number "36" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at 17.78 16.51 180) (length 2.54) + (name "3V3_EN" (effects (font (size 1.27 1.27)))) + (number "37" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 17.78 19.05 180) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "38" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 21.59 180) (length 2.54) + (name "VSYS" (effects (font (size 1.27 1.27)))) + (number "39" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 16.51 0) (length 2.54) + (name "GPIO2" (effects (font (size 1.27 1.27)))) + (number "4" (effects (font (size 1.27 1.27)))) + ) + (pin unspecified line (at 17.78 24.13 180) (length 2.54) + (name "VBUS" (effects (font (size 1.27 1.27)))) + (number "40" (effects (font (size 1.27 1.27)))) + ) + (pin input line (at -2.54 -29.21 90) (length 2.54) + (name "SWCLK" (effects (font (size 1.27 1.27)))) + (number "41" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at 0 -29.21 90) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "42" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at 2.54 -29.21 90) (length 2.54) + (name "SWDIO" (effects (font (size 1.27 1.27)))) + (number "43" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 13.97 0) (length 2.54) + (name "GPIO3" (effects (font (size 1.27 1.27)))) + (number "5" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 11.43 0) (length 2.54) + (name "GPIO4" (effects (font (size 1.27 1.27)))) + (number "6" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 8.89 0) (length 2.54) + (name "GPIO5" (effects (font (size 1.27 1.27)))) + (number "7" (effects (font (size 1.27 1.27)))) + ) + (pin power_in line (at -17.78 6.35 0) (length 2.54) + (name "GND" (effects (font (size 1.27 1.27)))) + (number "8" (effects (font (size 1.27 1.27)))) + ) + (pin bidirectional line (at -17.78 3.81 0) (length 2.54) + (name "GPIO6" (effects (font (size 1.27 1.27)))) + (number "9" (effects (font (size 1.27 1.27)))) + ) + ) + ) +) diff --git a/schematic/RPi_Pico.pretty/RPi_PicoW_SMD_TH.kicad_mod b/schematic/RPi_Pico.pretty/RPi_PicoW_SMD_TH.kicad_mod new file mode 100644 index 0000000000000000000000000000000000000000..b37d930221abe0b3ccfa43eb4b96735682f32acb --- /dev/null +++ b/schematic/RPi_Pico.pretty/RPi_PicoW_SMD_TH.kicad_mod @@ -0,0 +1,361 @@ +(footprint "RPi_PicoW_SMD_TH" (version 20211014) (generator pcbnew) + (layer "F.Cu") + (tedit 61436715) + (descr "Through hole straight pin header, 2x20, 2.54mm pitch, double rows") + (tags "Through hole pin header THT 2x20 2.54mm double row") + (attr through_hole) + (fp_text reference "U2" (at 0 0) (layer "F.SilkS") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 9770c02b-e18f-4633-9b06-6881b94a9d1a) + ) + (fp_text value "Pico" (at 0 2.159) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 1f8f536e-7f83-43a2-a891-e9593df2b1ee) + ) + (fp_text user "GP12" (at -13.2 14.2925 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 03943a42-cf0c-45b7-a9f9-e7bed50ae524) + ) + (fp_text user "GP2" (at -12.9 -16.51 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 08138ea7-490c-46a6-8bd8-49d5c9c3e8f0) + ) + (fp_text user "GND" (at -12.8 19.05 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 08c02e4e-9e87-4f03-9cf1-25c75cbd6a8e) + ) + (fp_text user "GP17" (at 13.054 21.59 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 0bb7fb44-bbcc-4165-a5d8-83226e255c1e) + ) + (fp_text user "GP27" (at 13.054 -3.8 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 0f87a0d3-ce1f-4d01-a247-19f7a5d9d62e) + ) + (fp_text user "GP11" (at -13.2 11.7525 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 105d8994-0645-4058-abc7-7a8084b35fbe) + ) + (fp_text user "AGND" (at 13.054 -6.35 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 153942f5-a462-44fe-b3a1-0dfce1ac5bf5) + ) + (fp_text user "GP3" (at -12.8 -13.97 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 1db772c7-52bf-4cd8-9b01-4652c3413dc1) + ) + (fp_text user "GP28" (at 13.054 -9.144 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 1f7c8fdd-2117-44dc-b782-0a886ca1a349) + ) + (fp_text user "GP7" (at -12.7 -1.3 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 20384398-d3f4-4c03-86b4-20d583a1a2d8) + ) + (fp_text user "SWCLK" (at -1 7.5) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 29542bd9-09da-408c-af9c-3a12ada58e7d) + ) + (fp_text user "GND" (at -12.8 -19.05 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 37b4ea1f-8369-4610-9bb9-d7292e218f48) + ) + (fp_text user "3V3" (at 12.9 -13.9 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 38dbb038-b624-463d-a6bf-100ad7247409) + ) + (fp_text user "GND" (at 12.8 19.05 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 440e54cd-941f-4df2-968e-5d11b323961f) + ) + (fp_text user "GP13" (at -13.054 16.8325 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 467b2b4e-a3c4-435e-9d43-06f6c1bebb8f) + ) + (fp_text user "GP14" (at -13.1 21.59 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 4770ba66-8809-48b6-b935-3ba228a3cea4) + ) + (fp_text user "GP6" (at -12.8 -3.81 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 6069b06a-4d9d-428e-a0d5-d2dccf7f345c) + ) + (fp_text user "GP19" (at 13.054 13.97 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 64574606-f0a8-4fba-95df-627c7979d6c9) + ) + (fp_text user "RUN" (at 13 1.27 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 765685f7-d0fa-46fe-9852-e41ceeb8f8b1) + ) + (fp_text user "GP9" (at -12.8 3.81 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 7f4c0cdf-b27f-493f-be0a-3b69cbbee767) + ) + (fp_text user "SWDIO" (at 5.5 8) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 7f51cc35-a870-48ec-a496-9e9ea487dd98) + ) + (fp_text user "3V3_EN" (at 13.7 -17.2 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 84a1b90c-b487-4cfe-9117-3e8f314a45ba) + ) + (fp_text user "VSYS" (at 13.2 -21.59 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 89a1aedf-d33b-4b23-ae7c-9cb74038258b) + ) + (fp_text user "GP15" (at -13.054 24.13 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp 97b72add-901b-48d9-841b-59d6cf4b5f52) + ) + (fp_text user "GND" (at -12.8 -6.35 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp a117b542-a531-4d98-aec2-f361f6b43c21) + ) + (fp_text user "GND" (at 12.8 6.35 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp b96b3cc7-537f-4f00-91a9-9e30b31ada4f) + ) + (fp_text user "GND" (at 12.8 -19.05 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp ba98c835-f077-4f76-9395-e7696912c474) + ) + (fp_text user "GP26" (at 13.054 -1.27 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp c856620b-eb0a-4d35-aa03-ff49242251d8) + ) + (fp_text user "GP4" (at -12.8 -11.43 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp cb4bc87b-030f-4081-a121-e8793ab70907) + ) + (fp_text user "GP20" (at 13.054 11.43 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp d06049b2-8b5b-47a3-918c-cd9791b8e17b) + ) + (fp_text user "GP16" (at 13.054 24.13 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp d374ace6-8636-47f3-9e58-f46ae5d861e4) + ) + (fp_text user "GP22" (at 13.054 3.81 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp d7b25f40-3ba3-4d06-9ced-639d5d19c074) + ) + (fp_text user "GP18" (at 13.054 16.51 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp d8af7e55-3384-4643-93e0-fee9e52a06d3) + ) + (fp_text user "GP8" (at -12.8 1.27 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp e5ac2217-5e6b-4f06-82e7-82b6fdea1941) + ) + (fp_text user "GP10" (at -13.054 8.89 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp e672436b-0e0a-4bb1-984f-f0c558b6f651) + ) + (fp_text user "VREF" (at 13.0675 -11.7425 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp e754f526-293f-4101-a555-8cb1630779fd) + ) + (fp_text user "GP5" (at -12.8 -8.89 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp e8498514-5e93-4d99-9b09-9a1b630e8380) + ) + (fp_text user "GP21" (at 13.054 8.9 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp ea194ace-9177-4bda-b592-60ad570ee81d) + ) + (fp_text user "GND" (at -12.8 6.35 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp ed73f421-210f-463e-8416-475f22c56ef2) + ) + (fp_text user "GP0" (at -12.8 -24.13 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp f559e54f-a3f9-4df4-b59c-cfcc907b1fed) + ) + (fp_text user "VBUS" (at 13.3 -24.2 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp f5d6ede0-46ad-4eff-b838-3945a401caa2) + ) + (fp_text user "GP1" (at -12.9 -21.6 45) (layer "F.SilkS") + (effects (font (size 0.8 0.8) (thickness 0.15))) + (tstamp fef82338-3ae3-4332-a6e4-066fcb6cc2f6) + ) + (fp_text user "Copper Keepouts shown on Dwgs layer" (at 0.1 -30.2) (layer "Cmts.User") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 32e6e0eb-d034-4567-9b38-1567746a6d90) + ) + (fp_text user "${REFERENCE}" (at 0 0 180) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 6e38957b-39f3-4f36-9e4f-a337632a7ed6) + ) + (fp_line (start 1.1 25.5) (end 1.5 25.5) (layer "F.SilkS") (width 0.12) (tstamp 0200f769-0e20-49ce-9a54-c8f6445ff072)) + (fp_line (start 10.5 -12.9) (end 10.5 -12.5) (layer "F.SilkS") (width 0.12) (tstamp 0f893b53-0fa2-4ac2-99d8-5fa9e26b921c)) + (fp_line (start 10.5 -15.4) (end 10.5 -15) (layer "F.SilkS") (width 0.12) (tstamp 154b56bd-b8d0-4a7d-a540-602fd011bdf2)) + (fp_line (start -10.5 12.5) (end -10.5 12.9) (layer "F.SilkS") (width 0.12) (tstamp 1c7799b2-7df3-4942-aa4d-e05eef0c8337)) + (fp_line (start 10.5 10) (end 10.5 10.4) (layer "F.SilkS") (width 0.12) (tstamp 26418ada-878b-4b11-a98a-a4f3266c07b5)) + (fp_line (start -10.5 2.3) (end -10.5 2.7) (layer "F.SilkS") (width 0.12) (tstamp 3327a932-5e03-4aa6-8362-81785ea92525)) + (fp_line (start 10.5 4.9) (end 10.5 5.3) (layer "F.SilkS") (width 0.12) (tstamp 35682d85-1b72-4b49-a989-596b09b5a55d)) + (fp_line (start 10.5 2.3) (end 10.5 2.7) (layer "F.SilkS") (width 0.12) (tstamp 38c3ea8b-f37e-49af-9f8b-696a922b0a81)) + (fp_line (start 10.5 25.5) (end 3.7 25.5) (layer "F.SilkS") (width 0.12) (tstamp 3b9e8302-7ef9-4cfb-be1f-36056a3426f4)) + (fp_line (start -10.5 10) (end -10.5 10.4) (layer "F.SilkS") (width 0.12) (tstamp 3dce5a07-beb5-42b7-a8d2-c3be0a18a557)) + (fp_line (start -10.5 4.9) (end -10.5 5.3) (layer "F.SilkS") (width 0.12) (tstamp 42589d9e-02db-4a0f-86dc-45d67956db2d)) + (fp_line (start 10.5 -20.5) (end 10.5 -20.1) (layer "F.SilkS") (width 0.12) (tstamp 4e9f8182-42dc-4160-88f0-44ba0a2e613c)) + (fp_line (start -1.5 25.5) (end -1.1 25.5) (layer "F.SilkS") (width 0.12) (tstamp 57c00191-96e3-4a86-95da-4b54d1f205a8)) + (fp_line (start 10.5 20.1) (end 10.5 20.5) (layer "F.SilkS") (width 0.12) (tstamp 584f842b-34f3-443c-911a-d4cd7a8b43c4)) + (fp_line (start -10.5 -23.1) (end -10.5 -22.7) (layer "F.SilkS") (width 0.12) (tstamp 5b9e4686-aeec-4ca8-9f44-5e12d75e9a4f)) + (fp_line (start 10.5 15.1) (end 10.5 15.5) (layer "F.SilkS") (width 0.12) (tstamp 5c6db7c5-49fe-42f0-acb6-29470da129fa)) + (fp_line (start 10.5 -5.3) (end 10.5 -4.9) (layer "F.SilkS") (width 0.12) (tstamp 5fcdf2b5-3521-4ae3-bc59-3621daf28711)) + (fp_line (start -10.5 -0.2) (end -10.5 0.2) (layer "F.SilkS") (width 0.12) (tstamp 61e3aa6d-3d36-4f65-95c1-b733035c5512)) + (fp_line (start -10.5 -20.5) (end -10.5 -20.1) (layer "F.SilkS") (width 0.12) (tstamp 621a5f33-e941-45fe-b868-d1e6f62c0a90)) + (fp_line (start -10.5 20.1) (end -10.5 20.5) (layer "F.SilkS") (width 0.12) (tstamp 63623788-5140-4207-bb59-394139482a44)) + (fp_line (start 10.5 12.5) (end 10.5 12.9) (layer "F.SilkS") (width 0.12) (tstamp 6aa9ccd2-cbb1-4fb1-88ca-fdf45fa3ae37)) + (fp_line (start -10.5 -12.9) (end -10.5 -12.5) (layer "F.SilkS") (width 0.12) (tstamp 8703c751-9c77-4a40-bee8-aa848c9147d4)) + (fp_line (start 10.5 -23.1) (end 10.5 -22.7) (layer "F.SilkS") (width 0.12) (tstamp 8ac46659-5028-4e30-922a-eac266322fa4)) + (fp_line (start -10.5 -2.7) (end -10.5 -2.3) (layer "F.SilkS") (width 0.12) (tstamp 8c6ecf50-a72f-45a5-b4a3-3a1b01eadf98)) + (fp_line (start 10.5 -0.2) (end 10.5 0.2) (layer "F.SilkS") (width 0.12) (tstamp 8fdaa659-e193-400d-bdcf-eed518b6f97a)) + (fp_line (start -10.5 -10.4) (end -10.5 -10) (layer "F.SilkS") (width 0.12) (tstamp 9027d96a-52f5-476c-b81e-c82532d3dcb7)) + (fp_line (start 10.5 -2.7) (end 10.5 -2.3) (layer "F.SilkS") (width 0.12) (tstamp 9696384a-4540-4194-989f-c35c4193e758)) + (fp_line (start 10.5 7.4) (end 10.5 7.8) (layer "F.SilkS") (width 0.12) (tstamp 9bbcb3f7-df71-4f8b-90dc-62bb6fa2b59b)) + (fp_line (start -10.5 -18) (end -10.5 -17.6) (layer "F.SilkS") (width 0.12) (tstamp a00e32da-2325-456e-94c7-5da3c664ec54)) + (fp_line (start 10.5 -7.8) (end 10.5 -7.4) (layer "F.SilkS") (width 0.12) (tstamp a48641a6-6ca8-4f12-938a-1e9d3a5e266d)) + (fp_line (start -3.7 25.5) (end -10.5 25.5) (layer "F.SilkS") (width 0.12) (tstamp a6d7f9c6-9504-4931-812e-d87c7d38a45c)) + (fp_line (start -10.5 -7.8) (end -10.5 -7.4) (layer "F.SilkS") (width 0.12) (tstamp ab7a940c-0ea8-49f0-9530-8651ca44a75c)) + (fp_line (start -10.5 22.7) (end -10.5 23.1) (layer "F.SilkS") (width 0.12) (tstamp b0eacd98-fa95-4603-9128-384589d45684)) + (fp_line (start 10.5 17.6) (end 10.5 18) (layer "F.SilkS") (width 0.12) (tstamp b0f637e7-82e9-4cb4-a540-df6b3d4c13ca)) + (fp_line (start -10.5 -25.5) (end 10.5 -25.5) (layer "F.SilkS") (width 0.12) (tstamp bf6a78b9-fbcc-4705-b189-ae12d01b3aa6)) + (fp_line (start -10.5 -15.4) (end -10.5 -15) (layer "F.SilkS") (width 0.12) (tstamp c114e22d-03b8-48d1-96fe-2d6fa7da5d79)) + (fp_line (start 10.5 -10.4) (end 10.5 -10) (layer "F.SilkS") (width 0.12) (tstamp c8421619-bfcc-4db9-9d95-17391592de97)) + (fp_line (start -7.493 -22.833) (end -7.493 -25.5) (layer "F.SilkS") (width 0.12) (tstamp cb970423-221e-4e30-a536-9504cfa9cd2b)) + (fp_line (start 10.5 22.7) (end 10.5 23.1) (layer "F.SilkS") (width 0.12) (tstamp cf70cffa-c8e4-442f-8fcf-01a3478fb9b7)) + (fp_line (start 10.5 -18) (end 10.5 -17.6) (layer "F.SilkS") (width 0.12) (tstamp d44f6fba-47c5-4941-a414-d5a75dcedee3)) + (fp_line (start -10.5 15.1) (end -10.5 15.5) (layer "F.SilkS") (width 0.12) (tstamp d50b6861-4ff1-42a1-85c6-8c0f16d1ebb2)) + (fp_line (start -10.5 -22.833) (end -7.493 -22.833) (layer "F.SilkS") (width 0.12) (tstamp e1e7b798-61ee-4fe8-b9cf-3b74b206974f)) + (fp_line (start 10.5 -25.5) (end 10.5 -25.2) (layer "F.SilkS") (width 0.12) (tstamp e2741238-d2d1-41a1-b6b7-d357e6612949)) + (fp_line (start -10.5 -5.3) (end -10.5 -4.9) (layer "F.SilkS") (width 0.12) (tstamp e41eeca2-199e-4beb-99de-6e4969131852)) + (fp_line (start -10.5 -25.5) (end -10.5 -25.2) (layer "F.SilkS") (width 0.12) (tstamp e6449a26-17f2-4fb7-b0bf-871e2e859dbf)) + (fp_line (start -10.5 17.6) (end -10.5 18) (layer "F.SilkS") (width 0.12) (tstamp e98dba53-f49e-46e7-a354-7e4e19349dc2)) + (fp_line (start -10.5 7.4) (end -10.5 7.8) (layer "F.SilkS") (width 0.12) (tstamp fdb571c0-ea0e-4113-a2a4-a2bd703e0646)) + (fp_line (start -7.1 25.5) (end -7.1 17) (layer "Dwgs.User") (width 0.12) (tstamp 28f255f6-e7cb-4ae4-897a-3fa02e5267ba)) + (fp_line (start -7.1 17) (end 7.1 17) (layer "Dwgs.User") (width 0.12) (tstamp 53581202-4de6-4ac5-afb2-e5629c4013e6)) + (fp_line (start 7.1 17) (end 7.1 25.5) (layer "Dwgs.User") (width 0.12) (tstamp 60c3cc07-2386-45a9-bd66-c863b9f22855)) + (fp_poly (pts + (xy -1.5 -9.9) + (xy -3.5 -9.9) + (xy -3.5 -11.9) + (xy -1.5 -11.9) + ) (layer "Dwgs.User") (width 0.1) (fill solid) (tstamp 6487a342-1294-43f9-bcf2-f6bcf1e5a949)) + (fp_poly (pts + (xy 3.7 -20.2) + (xy -3.7 -20.2) + (xy -3.7 -24.9) + (xy 3.7 -24.9) + ) (layer "Dwgs.User") (width 0.1) (fill solid) (tstamp 669e854c-c106-4cc2-83af-4ff887d6dcca)) + (fp_poly (pts + (xy -1.5 -14.9) + (xy -3.5 -14.9) + (xy -3.5 -16.9) + (xy -1.5 -16.9) + ) (layer "Dwgs.User") (width 0.1) (fill solid) (tstamp 885ed6c5-6a6e-4d02-8bca-95a7554d2c5e)) + (fp_poly (pts + (xy -1.5 -12.4) + (xy -3.5 -12.4) + (xy -3.5 -14.4) + (xy -1.5 -14.4) + ) (layer "Dwgs.User") (width 0.1) (fill solid) (tstamp 95dc2b5d-a634-43b0-9617-3d932b02f27b)) + (fp_line (start 11 26) (end -11 26) (layer "F.CrtYd") (width 0.12) (tstamp 1d1b2de8-50a7-4eba-bd3b-e94eea6b2633)) + (fp_line (start -11 26) (end -11 -26) (layer "F.CrtYd") (width 0.12) (tstamp 23e759c5-fa3c-4bcf-b974-5c71f5324d2f)) + (fp_line (start 11 -26) (end 11 26) (layer "F.CrtYd") (width 0.12) (tstamp a3279d11-2898-406f-bee7-c916b0881c10)) + (fp_line (start -11 -26) (end 11 -26) (layer "F.CrtYd") (width 0.12) (tstamp b034889c-ecff-4750-9dad-c7aea947e3f2)) + (fp_line (start 10.5 -25.5) (end 10.5 25.5) (layer "F.Fab") (width 0.12) (tstamp 34e7070e-5b7a-4cac-95bf-5cc9057f2070)) + (fp_line (start -10.5 -24.2) (end -9.2 -25.5) (layer "F.Fab") (width 0.12) (tstamp 72a3118c-9096-4ea3-88ce-3305a515579a)) + (fp_line (start -10.5 -25.5) (end 10.5 -25.5) (layer "F.Fab") (width 0.12) (tstamp 7d20675d-2d35-4674-8544-90076d7e03b5)) + (fp_line (start -10.5 25.5) (end -10.5 -25.5) (layer "F.Fab") (width 0.12) (tstamp d49883a0-12d2-460e-a097-191433d186d5)) + (fp_line (start 10.5 25.5) (end -10.5 25.5) (layer "F.Fab") (width 0.12) (tstamp f1c9562b-91d6-477d-9dd5-1ece50a5ba97)) + (pad "" np_thru_hole oval (at 2.725 -24) (size 1.8 1.8) (drill 1.8) (layers *.Cu *.Mask) (tstamp 8a8ed353-c8e0-485a-9070-c8deac2cc33e)) + (pad "" np_thru_hole oval (at -2.725 -24) (size 1.8 1.8) (drill 1.8) (layers *.Cu *.Mask) (tstamp 9d159fa7-ba62-43fd-995a-a5b3b530999b)) + (pad "" np_thru_hole oval (at -2.425 -20.97) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask) (tstamp b921f2b2-54c3-4c0d-9f70-641897ea6142)) + (pad "" np_thru_hole oval (at 2.425 -20.97) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask) (tstamp c900ddb8-689b-4b93-b62a-9035ad2046a5)) + (pad "1" thru_hole oval (at -8.89 -24.13) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 3c14836e-d1e0-4317-b386-5748f4f0ad4c)) + (pad "1" smd rect (at -8.89 -24.13) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp b43718f5-dc30-40be-9253-c06344cd48d2)) + (pad "2" thru_hole oval (at -8.89 -21.59) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 07820dfb-89d1-4352-b8db-059cbdf1b6ca)) + (pad "2" smd rect (at -8.89 -21.59) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 249a1a0b-52d8-48f3-9059-65666187508e)) + (pad "3" thru_hole rect (at -8.89 -19.05) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 48f08a82-ecfd-42e6-b577-730395651fd2)) + (pad "3" smd rect (at -8.89 -19.05) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp aa3b40f4-0f1d-42d4-9d37-6be4fddffc05)) + (pad "4" smd rect (at -8.89 -16.51) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 163b9e02-3cc0-43b2-9f19-59ee3ab10272)) + (pad "4" thru_hole oval (at -8.89 -16.51) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 42525cf8-0382-444e-a6a1-65547583c51d)) + (pad "5" smd rect (at -8.89 -13.97) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 510307aa-04d1-4d55-8f06-1bf5daff489c)) + (pad "5" thru_hole oval (at -8.89 -13.97) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 7733dc63-e152-48c3-9123-283e7e6e4b0e)) + (pad "6" smd rect (at -8.89 -11.43) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 614aba8c-f618-4357-ba4f-2be9cdb764ed)) + (pad "6" thru_hole oval (at -8.89 -11.43) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 913c2df8-2358-4e1c-9f1f-8208a2c2292b)) + (pad "7" thru_hole oval (at -8.89 -8.89) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 5c1e4150-f096-48e4-9c0a-0577ad9218bf)) + (pad "7" smd rect (at -8.89 -8.89) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 8e25278b-e45e-44f5-a2ba-dc072cdfc665)) + (pad "8" smd rect (at -8.89 -6.35) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 8c7661a3-1cf3-4ce2-b22f-1960844cb968)) + (pad "8" thru_hole rect (at -8.89 -6.35) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp a5ee59ed-a32d-4115-b659-b91670558b51)) + (pad "9" smd rect (at -8.89 -3.81) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 0ed453e1-fa47-43fb-b873-573ab62dba5e)) + (pad "9" thru_hole oval (at -8.89 -3.81) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp b75093d9-5390-4de1-bc9f-c37c1b3be5bf)) + (pad "10" thru_hole oval (at -8.89 -1.27) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp b8ec75be-0053-4b95-a156-a0d708b5092f)) + (pad "10" smd rect (at -8.89 -1.27) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp bb18f56f-c07e-4905-a72f-7508a4aaf3ba)) + (pad "11" thru_hole oval (at -8.89 1.27) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 2ae43cce-6524-41bf-bab8-d8f2683d2357)) + (pad "11" smd rect (at -8.89 1.27) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp ceeca828-8ea9-487d-8413-67fc2ad11278)) + (pad "12" smd rect (at -8.89 3.81) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 00eedf01-f868-45fe-a111-fb3be2341d4e)) + (pad "12" thru_hole oval (at -8.89 3.81) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp c49392f2-4df2-429e-8135-5c21c5e1382c)) + (pad "13" smd rect (at -8.89 6.35) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 590fbb12-ac01-402e-b778-947517cfe6ee)) + (pad "13" thru_hole rect (at -8.89 6.35) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 6c9d3182-b4a7-4e39-8027-db9922e3602d)) + (pad "14" thru_hole oval (at -8.89 8.89) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 02a1641e-ae45-4799-9f89-87c804222e8f)) + (pad "14" smd rect (at -8.89 8.89) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 03fc67c0-a6d9-4fce-8f43-aae1f2f8dca2)) + (pad "15" smd rect (at -8.89 11.43) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 196a01b9-9b72-491b-8502-821e660e05e5)) + (pad "15" thru_hole oval (at -8.89 11.43) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp d4f92b42-6760-4903-8118-ed963ee70cca)) + (pad "16" thru_hole oval (at -8.89 13.97) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 1ac14973-eace-4535-9713-ecee36584dab)) + (pad "16" smd rect (at -8.89 13.97) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 1cb9c272-c2d3-469e-a4c6-bbbea1d506f0)) + (pad "17" smd rect (at -8.89 16.51) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 17aedee9-50ea-4cff-bbe3-6ef8b2ea9fbd)) + (pad "17" thru_hole oval (at -8.89 16.51) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp dccd5505-6a85-4bc4-b10f-a5fa40f712c6)) + (pad "18" smd rect (at -8.89 19.05) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 6787577b-04dd-4568-b274-0c9ad31e5f4c)) + (pad "18" thru_hole rect (at -8.89 19.05) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp d312b1f8-a365-4a4c-9fed-54919508271f)) + (pad "19" thru_hole oval (at -8.89 21.59) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 52c4d482-d914-4d96-88d0-b67a01867455)) + (pad "19" smd rect (at -8.89 21.59) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 7b631c1b-343e-4d60-95fa-0ed31d3322bf)) + (pad "20" thru_hole oval (at -8.89 24.13) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 91690ac3-0915-4763-b7d5-a410c6258938)) + (pad "20" smd rect (at -8.89 24.13) (size 3.5 1.7) (drill (offset -0.9 0)) (layers "F.Cu" "F.Mask") (tstamp d539dd7d-d6c8-4a16-bfb7-4e67f395709c)) + (pad "21" smd rect (at 8.89 24.13) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 1d475a6d-2f2c-4746-a69d-39bd546073d7)) + (pad "21" thru_hole oval (at 8.89 24.13) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 6dfbdf83-6c1c-4ba6-a2ba-88f7d36efcb1)) + (pad "22" smd rect (at 8.89 21.59) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 2adac1d8-d035-4946-9fdd-4789634098c5)) + (pad "22" thru_hole oval (at 8.89 21.59) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp f75f84e1-5a68-4300-a17b-530ea7581009)) + (pad "23" thru_hole rect (at 8.89 19.05) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 22b6aa9f-cb29-425e-9296-59c2c24b93de)) + (pad "23" smd rect (at 8.89 19.05) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 6433c1c4-b5b0-485b-9ab4-bf7326fef425)) + (pad "24" thru_hole oval (at 8.89 16.51) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 7edec757-24b8-481f-a696-582c714a74a1)) + (pad "24" smd rect (at 8.89 16.51) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp c4433478-32e3-474c-b9aa-32c18a407658)) + (pad "25" smd rect (at 8.89 13.97) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 1335a61c-9225-4d54-a9de-8fb685dcbd0c)) + (pad "25" thru_hole oval (at 8.89 13.97) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp b13fd526-a8ed-4be1-b109-55f70b539f56)) + (pad "26" smd rect (at 8.89 11.43) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 61e98edf-ed4d-495c-a23b-1f3178aa250b)) + (pad "26" thru_hole oval (at 8.89 11.43) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp cc707d4a-e9fa-416d-b112-a02ab5dc05ed)) + (pad "27" thru_hole oval (at 8.89 8.89) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 85747fc6-a170-458c-b3a7-43d328a9ca22)) + (pad "27" smd rect (at 8.89 8.89) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp dc5dc4a1-a7d0-42a5-a830-7df496110069)) + (pad "28" smd rect (at 8.89 6.35) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 243193ca-7a49-487b-89fb-f73c9d0bb143)) + (pad "28" thru_hole rect (at 8.89 6.35) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp ac168c28-338b-4952-a2a4-d486d051a95b)) + (pad "29" smd rect (at 8.89 3.81) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 54bee376-9c1e-4ea7-93c9-ec734e544b43)) + (pad "29" thru_hole oval (at 8.89 3.81) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 5ed5ba52-9f14-4a9b-ab62-88877ee7e18e)) + (pad "30" thru_hole oval (at 8.89 1.27) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 7b37c693-968e-4b6f-ab86-92a6b44be2bf)) + (pad "30" smd rect (at 8.89 1.27) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp b1b9bf63-7ffe-4fea-89ac-5c816787830b)) + (pad "31" thru_hole oval (at 8.89 -1.27) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 2fcaaf16-63a9-46e8-8e86-90a13fba37ae)) + (pad "31" smd rect (at 8.89 -1.27) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 8e7cd60b-3fc9-43cb-af96-b26852cf668a)) + (pad "32" thru_hole oval (at 8.89 -3.81) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 59b65ef6-3aa2-4d5d-ac18-67dad283355e)) + (pad "32" smd rect (at 8.89 -3.81) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 663bab59-f3ee-4d37-a702-e575fb92a3d7)) + (pad "33" smd rect (at 8.89 -6.35) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 95f8b40c-fd94-47ad-adfb-bc9a376fa7bb)) + (pad "33" thru_hole rect (at 8.89 -6.35) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 9fad803b-c805-4425-af5b-472e241f1550)) + (pad "34" thru_hole oval (at 8.89 -8.89) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 10d897cd-b73e-4f5d-a656-ec910cae761f)) + (pad "34" smd rect (at 8.89 -8.89) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 362bce95-f42a-4ba9-a3ee-b2ce531c8aa5)) + (pad "35" thru_hole oval (at 8.89 -11.43) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp c57165a5-8579-4420-81b2-07425a403a72)) + (pad "35" smd rect (at 8.89 -11.43) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp e71e9a2a-2076-4135-853a-0b38d46fca16)) + (pad "36" thru_hole oval (at 8.89 -13.97) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 20b4a9fd-06c0-445f-afed-146759f2bb5b)) + (pad "36" smd rect (at 8.89 -13.97) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp ee3d621e-237d-4382-b7e3-a9fcf17e4bec)) + (pad "37" smd rect (at 8.89 -16.51) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 3817a24d-d23c-415c-b6f7-fe1dd06f5ba1)) + (pad "37" thru_hole oval (at 8.89 -16.51) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp e0b2b98e-47e3-486b-a0ec-d7330e62b063)) + (pad "38" smd rect (at 8.89 -19.05) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 1c92e6b7-9cbf-4c7a-a924-5052f9906a0f)) + (pad "38" thru_hole rect (at 8.89 -19.05) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp efa4a51f-b208-4369-8af4-36e147e1f938)) + (pad "39" smd rect (at 8.89 -21.59) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp 332867b2-3be3-4674-b436-1bcb7b34df15)) + (pad "39" thru_hole oval (at 8.89 -21.59) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp cccd4cea-c88e-4fc0-907f-447edef8bc42)) + (pad "40" smd rect (at 8.89 -24.13) (size 3.5 1.7) (drill (offset 0.9 0)) (layers "F.Cu" "F.Mask") (tstamp dc8741d5-8cc8-4f96-892f-3db0a67f653d)) + (pad "40" thru_hole oval (at 8.89 -24.13) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp f2e38f9a-9471-4d1c-a231-9b0e914557b6)) + (pad "41" thru_hole oval (at 0.5841 5.6) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp a877084f-aef7-444b-b196-c3d6fd8c99fa)) + (pad "42" thru_hole rect (at 3.1241 5.6) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 0c7737c2-9ce5-4a7e-b469-773493986cc0)) + (pad "43" thru_hole oval (at 5.6641 5.6) (size 1.7 1.7) (drill 1.02) (layers *.Cu *.Mask) (tstamp 5f92749e-d901-43e2-9830-cd67adc28c43)) +) diff --git a/schematic/schematic.png b/schematic/schematic.png new file mode 100644 index 0000000000000000000000000000000000000000..70bda68cba36ac0fed401e9207b3f8ec16fce5aa Binary files /dev/null and b/schematic/schematic.png differ diff --git a/schematic/sym-lib-table b/schematic/sym-lib-table new file mode 100644 index 0000000000000000000000000000000000000000..f7b516cb36ca10412d720fa7912bea0450ba4dfb --- /dev/null +++ b/schematic/sym-lib-table @@ -0,0 +1,3 @@ +(sym_lib_table + (lib (name "RPi_Pico")(type "KiCad")(uri "${KIPRJMOD}/RPi_Pico.kicad_sym")(options "")(descr "")) +) diff --git a/scripts/deploy b/scripts/deploy new file mode 100755 index 0000000000000000000000000000000000000000..da2b9570fe2468dcc3d62842de009eedc77492bf --- /dev/null +++ b/scripts/deploy @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +set -euo pipefail + +script_directory="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +project_directory="$script_directory/.." + +install_dependencies=false +while getopts ":d" opt; do + case $opt in + d) + install_dependencies=true + ;; + *) + ;; + esac +done + +if ! command -v rsync &> /dev/null; then + echo 'rsync is not installed on this computer. rsync is used to copy the application code to your device. Install it using the package manager you use with your OS.' + exit 1 +fi + +if ! command -v circup &> /dev/null; then + echo 'circup is not installed on this computer. circup is used to install CircuitPython dependencies on your device. Install it by following the instructions in the rshell repository at: https://github.com/adafruit/circup' + exit 1 +fi + +echo 'Detecting your CircuitPython device...' +device_path=$(python3 -c 'import circup; print(circup.find_device())') +if [ "$device_path" == 'None' ]; then + echo 'circup could not detect a connected CircuitPython device. Make sure your device is flashed with CircuitPython and connected to your computer with a USB data cable.' + exit 1 +fi +echo "Found device at $device_path" + +if [ $install_dependencies = true ] || \ + [ ! -d "$device_path/lib" ] || \ + [ -z "$(ls -A "$device_path/lib")" ]; then + echo 'Installing dependencies...' + circup install --requirement "$project_directory/requirements.txt" + echo 'Finished installing dependencies' +fi + +echo 'Copying application code...' +rsync --verbose --recursive --delete --checksum \ + --include='/._*' --exclude "/.*" \ + --exclude "/boot_out.txt" --exclude "/lib/" \ + --exclude "/log.txt" \ + "$project_directory/src/" "$device_path" +echo 'Finished copying application code' diff --git a/scripts/repl b/scripts/repl new file mode 100755 index 0000000000000000000000000000000000000000..84ebe38a5a6e9ea7ec709fe505f67dd8e1cd2363 --- /dev/null +++ b/scripts/repl @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +device=$(ls -1 -t /dev/ttyACM*) + +# Reattach to an existing session if one exists; otherwise create a new one +screen -D -R -S circuitpython "$device" 115200 diff --git a/src/boot.py b/src/boot.py new file mode 100644 index 0000000000000000000000000000000000000000..ee5b0612c2c2705a3cb422181936b223b6834fbd --- /dev/null +++ b/src/boot.py @@ -0,0 +1,5 @@ +import storage + +# Allow CircuitPython to write to its flash storage +# https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage +# storage.remount("/", readonly=False, disable_concurrent_write_protection=True) diff --git a/src/code.py b/src/code.py new file mode 100644 index 0000000000000000000000000000000000000000..0e03063ae41bdcc82a67539e007fcd1cdcdd9e8e --- /dev/null +++ b/src/code.py @@ -0,0 +1,90 @@ +import binascii +import os +import time +import traceback + +import board +import digitalio +import microcontroller +import socketpool +import supervisor +import wifi + +import adafruit_debouncer +import adafruit_logging +import adafruit_minimqtt.adafruit_minimqtt as adafruit_minimqtt + +from logging import create_logger +from mqtt import publish_homeassistant_discovery_message, publish_sensor_state_message + + +def main(logger: adafruit_logging.Logger) -> None: + led = digitalio.DigitalInOut(board.LED) + led.switch_to_output() + + switch_io = digitalio.DigitalInOut(board.GP18) + switch_io.pull = digitalio.Pull.DOWN + switch_io.switch_to_input() + switch = adafruit_debouncer.Debouncer(switch_io) + + # The switch is open when the door is closed + led.value = not switch.value + + # Connect to the Wi-Fi network + logger.info("Connecting to the local Wi-Fi network...") + wifi.radio.hostname = os.getenv("WIFI_HOSTNAME") + wifi.radio.connect( + os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD") + ) + logger.info( + "Connected to the local network: IP address = %s, router = %s, DNS server %s", + wifi.radio.ipv4_address, + wifi.radio.ipv4_gateway, + wifi.radio.ipv4_dns, + ) + pool = socketpool.SocketPool(wifi.radio) + + # Connect to the MQTT broker + logger.info("Connecting to the MQTT broker...") + mqtt = adafruit_minimqtt.MQTT( + broker=os.getenv("MQTT_HOSTNAME"), + username=os.getenv("MQTT_USERNAME"), + password=os.getenv("MQTT_PASSWORD"), + is_ssl=False, + socket_pool=pool, + ) + mqtt.logger = logger + mqtt.connect() + logger.info("Connected to the MQTT broker") + + mqtt_device_id = binascii.hexlify(microcontroller.cpu.uid).decode("utf-8") + mqtt_state_topic = f"door/ucc-door/state" + publish_homeassistant_discovery_message(mqtt, mqtt_device_id, mqtt_state_topic) + publish_sensor_state_message(mqtt, mqtt_state_topic, not switch.value) + logger.info("Advertised Home Assistant discovery message and current door state") + + logger.info("Monitoring door sensor...") + while True: + switch.update() + mqtt.loop() + + if switch.rose or switch.fell: + is_door_open = switch.value + logger.info( + "Detected the door open" if is_door_open else "Detected the door closed" + ) + led.value = is_door_open + publish_sensor_state_message(mqtt, mqtt_state_topic, is_door_open) + + +logger = create_logger() + +try: + main(logger) +except Exception as exception: + logger.critical("%s", "".join(traceback.format_exception(exception, limit=8))) + time.sleep(10) + if supervisor.runtime.usb_connected: + supervisor.reload() + else: + microcontroller.reset() diff --git a/src/logging.py b/src/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..3a9c241f3b185328c64db54df356d8dc2673034d --- /dev/null +++ b/src/logging.py @@ -0,0 +1,56 @@ +import errno +import os + +import storage +import supervisor + +import adafruit_logging + + +_LOG_SIZE_THRESHOLD_BYTES = 100 * 1024**2 + + +def create_logger() -> adafruit_logging.Logger: + """Create the root logger and configure it to print all info messages and higher to stderr. + Error messages and higher are written to a log file when the file system is writable. + """ + logger = adafruit_logging.getLogger() + logger.setLevel(adafruit_logging.INFO) + + if supervisor.runtime.usb_connected: + logger.addHandler(adafruit_logging.StreamHandler()) + else: + # The logging package prints messages with its default stream handler when the message is + # too low in severity for any of the registered handlers. This null handler accepts messages + # of all severity levels and suppresses the logger from writing high numbers of debug + # messages through the default stream handler to stderr. + logger.addHandler(adafruit_logging.NullHandler()) + + log_filename = os.getenv("LOG_FILE") + if log_filename and not storage.getmount("/").readonly: + handler = _file_handler(logger, log_filename) + handler.setLevel(adafruit_logging.ERROR) + logger.addHandler(handler) + + return logger + + +def _file_handler( + logger: adafruit_logging.Logger, log_filename: str +) -> adafruit_logging.FileHandler: + # Prevent the log file from filling the flash memory + log_file_mode = "a" + try: + size = os.stat(log_filename)[6] # st_size is at index 6 + if size >= _LOG_SIZE_THRESHOLD_BYTES: + log_file_mode = "w" + logger.info("Log file is %d bytes, creating a new log file", size) + else: + logger.info("Log file is %d bytes, appending to existing log file", size) + except OSError as error: + if error.errno != errno.ENOENT: + raise error + log_file_mode = "w" + logger.info("Log file does not exist, creating a new log file") + + return adafruit_logging.FileHandler(log_filename, mode=log_file_mode) diff --git a/src/mqtt.py b/src/mqtt.py new file mode 100644 index 0000000000000000000000000000000000000000..53b70d209544e746732347f1489f0df3c84d9f53 --- /dev/null +++ b/src/mqtt.py @@ -0,0 +1,35 @@ +import json + + +def publish_homeassistant_discovery_message( + mqtt, device_id: str, state_topic: str +) -> None: + mqtt.publish( + f"homeassistant/binary_sensor/{device_id}/config", + json.dumps( + { + "unique_id": device_id, + "name": "UCC Door", + "object_id": "door", + "device": { + "name": "UCC Door Sensor", + "identifiers": [device_id], + "model": "Raspberry Pi Pico W Door Sensor", + "manufacturer": "Raspberry Pi", + "suggested_area": "UCC Door", + }, + "device_class": "door", + "state_topic": state_topic, + } + ), + retain=True, + ) + + +def publish_sensor_state_message(mqtt, state_topic: str, sensor_state: bool) -> None: + mqtt.publish( + state_topic, + "ON" if sensor_state else "OFF", + retain=True, + qos=1, + ) diff --git a/src/template.settings.toml b/src/template.settings.toml new file mode 100644 index 0000000000000000000000000000000000000000..fbc2fc1daecae73fb524e2f78b69195a7a3e9ac5 --- /dev/null +++ b/src/template.settings.toml @@ -0,0 +1,8 @@ +CIRCUITPY_WIFI_SSID = "UCC-IoT" +CIRCUITPY_WIFI_PASSWORD = "da wifi password" + +MQTT_HOSTNAME = "da broker IP" +MQTT_USERNAME = "da broker username" +MQTT_PASSWORD = "da broker password" + +WIFI_HOSTNAME = "$(CLUB)-door"