Skip to content

Commit 6802b46

Browse files
kwagyemanclaude
andcommitted
docs: Add AE3 OLED Breakout / Battery Shield + AI-friendly docs.
Documentation: - shields/ae3-oled-breakout.rst — 128x128 SSD1351 OLED, AS90R joystick via PCA9674A on I2C 4, JTAG header pinout (1.8 V), Qwiic pinout, notes on the recovery / OLED-enable switches, M1.6 mounting holes, examples that mirror the official 50-Arduino-Boards/52-Alif-Boards scripts. - shields/ae3-battery-shield.rst — HV / BAT / LV JST power inputs with output rails (3.3 V from HV; 3.0 V from BAT or LV), 100 mA Li-Po charger with PG/CHG status (green/red LEDs on P6/P7), Li-Po and LV ADC monitors on P8/P9, SD-card power switch on P11, mounting holes, sdcard + charger-status + ADC usage examples. - shields.rst — new "AE3 accessories" card grid between Modern and Legacy, plus toctree entries; mobile padding fix so the landing doesn't double-pad inside the Shibuya container on phones. AI / LLM enablement: - Enabled Shibuya's "Copy page" + Open in ChatGPT / Claude / Perplexity dropdown (show_ai_links + all three providers). - Set html_baseurl so the dropdown links and llms.txt URLs are absolute (https://docs.openmv.io/_sources/...). - Added GitHub source_type/user/repo/docs_path/version to html_context as a fallback. - Added sphinx_llms_txt extension — auto-emits /llms.txt and /llms-full.txt every build (zero per-page maintenance). - Added twitter / youtube / linkedin Shibuya footer icons. CSS: - Widen the right-column TOC to 18rem above 1280 px and let the GitHub repo widget links wrap on natural separators, so "openmv/openmv-doc" no longer breaks mid-word. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cd622f8 commit 6802b46

7 files changed

Lines changed: 427 additions & 1 deletion

File tree

docs/conf.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,22 @@
4141
"openmv_version": openmv_version,
4242
"micropython_version": micropython_version,
4343
"build_date": build_date,
44+
# Tells Shibuya where the page source lives — used as a fallback
45+
# for the "Copy page" / "Open in ChatGPT/Claude/Perplexity" links
46+
# when html_baseurl isn't set (in which case Shibuya reads from
47+
# the deployed site's /_sources/ tree instead).
48+
"source_type": "github",
49+
"source_user": "openmv",
50+
"source_repo": "openmv-doc",
51+
"source_docs_path": "/micropython/docs/",
52+
"source_version": "master",
4453
}
4554

55+
# Site root — used by sphinx-llms-txt to emit absolute URLs in
56+
# /llms.txt and by Shibuya's "Copy page" / "Open in ChatGPT" dropdown
57+
# to fetch raw page source from /_sources/.
58+
html_baseurl = "https://docs.openmv.io/"
59+
4660
# -- Landing page code examples (rendered via Pygments to match site code style) --
4761
from pygments import highlight as _pygments_highlight
4862
from pygments.lexers import PythonLexer as _PythonLexer
@@ -256,6 +270,9 @@ def _render_landing_code(src):
256270
"sphinx.ext.intersphinx",
257271
"sphinx.ext.todo",
258272
"sphinx.ext.coverage",
273+
# Auto-generates /llms.txt + /llms-full.txt during the build so LLMs
274+
# can discover and ingest the docs without any per-page maintenance.
275+
"sphinx_llms_txt",
259276
]
260277

261278
# Add any paths that contain templates here, relative to this directory.
@@ -416,9 +433,15 @@ def _render_landing_code(src):
416433
"color_mode": "auto",
417434
"github_url": "https://github.com/openmv/openmv",
418435
"discussion_url": "https://forums.openmv.io/",
436+
"twitter_url": "https://x.com/openmvcam",
437+
"youtube_url": "https://www.youtube.com/channel/UCk43Dxy_qcwwYyLsP6EWatQ",
438+
"linkedin_url": "https://www.linkedin.com/company/16193624/",
419439
"globaltoc_expand_depth": 1,
420440
"toctree_collapse": True,
421-
"show_ai_links": False,
441+
"show_ai_links": True,
442+
"open_in_chatgpt": True,
443+
"open_in_claude": True,
444+
"open_in_perplexity": True,
422445
"nav_links": [
423446
{"title": "Home", "url": "index"},
424447
{"title": "Tutorial", "url": "openmvcam/tutorial/index"},
113 KB
Loading
107 KB
Loading

docs/openmvcam/shields.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,37 @@ Modern shields
111111
</section>
112112
</div>
113113

114+
AE3 accessories
115+
---------------
116+
117+
.. raw:: html
118+
119+
<div class="omv-cards-page">
120+
<section class="omv-section">
121+
<div class="omv-grid cols-4">
122+
123+
<a class="omv-card board" href="shields/ae3-oled-breakout.html">
124+
<div class="board-thumb"><img src="../_images/ae3-oled-breakout-hero.jpg" alt="AE3 OLED Breakout"></div>
125+
<div class="board-body">
126+
<h4>AE3 OLED Breakout</h4>
127+
<p>128×128 RGB OLED, 5‑way joystick, Qwiic, and a 10‑pin ARM SWD header.</p>
128+
<span class="card-arrow">Explore →</span>
129+
</div>
130+
</a>
131+
132+
<a class="omv-card board" href="shields/ae3-battery-shield.html">
133+
<div class="board-thumb"><img src="../_images/ae3-battery-shield-hero.jpg" alt="AE3 Battery Shield"></div>
134+
<div class="board-body">
135+
<h4>AE3 Battery Shield</h4>
136+
<p>5–36 V, 1.8–5.5 V, or 3.7 V Li‑Po power for the AE3 plus an SPI microSD socket.</p>
137+
<span class="card-arrow">Explore →</span>
138+
</div>
139+
</a>
140+
141+
</div>
142+
</section>
143+
</div>
144+
114145
Legacy shields
115146
--------------
116147

@@ -245,6 +276,8 @@ Legacy shields
245276
shields/rs422-rs485-shield.rst
246277
shields/driver-shield.rst
247278
shields/relay-shield.rst
279+
shields/ae3-oled-breakout.rst
280+
shields/ae3-battery-shield.rst
248281
shields/lcd-shield.rst
249282
shields/wifi-shield.rst
250283
shields/proto-shield.rst
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
AE3 Battery Shield
2+
==================
3+
4+
The AE3 Battery Shield powers the :doc:`OpenMV AE3 </openmvcam/quickref/openmv-ae3>`
5+
from a wide range of supplies — 5–36 V, a 3.7 V Li‑Po cell, or
6+
1.8–5.5 V for 3 alkaline cells in series — and adds an SPI microSD
7+
card socket on ``P0``–``P3``. All three power inputs land on JST terminals; the
8+
shield ships with a JST‑to‑pigtail adapter for the wide input and
9+
a JST‑to‑DC‑barrel‑jack adapter for the alkaline input.
10+
11+
.. image:: ../ae3-battery-shield-hero.jpg
12+
:alt: AE3 Battery Shield
13+
:width: 400px
14+
:align: center
15+
16+
For full datasheet, photos, and ordering see the
17+
`AE3 Battery Shield product page <https://openmv.io/collections/openmv-ae3-accessories/products/openmv-ae3-battery-shield>`_.
18+
19+
Highlights
20+
----------
21+
22+
* **HV PWR** — 5–36 V, reverse‑voltage tolerant to −36 V. Powers
23+
the AE3 at **3.3 V** (up to 600 mA).
24+
* **BAT** — 3.7 V single‑cell Li‑Po. Powers the AE3 at **3.0 V**
25+
(up to 800 mA). The on‑board charger runs at a **100 mA charge
26+
current** whenever 3.3 V is available on the shield — supplied
27+
by USB, HV PWR, or 3.3 V fed to the AE3 through its Qwiic
28+
connector. A 6.25 hr safety timer caps the supported battery
29+
capacity at **625 mAh**.
30+
* **LV PWR** — 1.8–5.5 V for **3 alkaline cells in series**,
31+
reverse‑voltage tolerant to −5.5 V. Powers the AE3 at **3.0 V**
32+
(up to 800 mA).
33+
* **microSD card socket** wired to ``P0``–``P3`` over SPI, with a
34+
software‑controlled power switch on ``P11``.
35+
36+
.. note::
37+
38+
The shield ships with a case that holds the AE3 firmly against
39+
the connector. Four corner **M1.6** mounting holes let you bolt
40+
the shield down to an enclosure or fixture.
41+
42+
Pin reference
43+
-------------
44+
45+
.. csv-table::
46+
:header: "Pin", "Function"
47+
:widths: 20, 80
48+
49+
"P0", "microSD SPI **MOSI**"
50+
"P1", "microSD SPI **MISO**"
51+
"P2", "microSD SPI **SCLK**"
52+
"P3", "microSD SPI **CS**"
53+
"P6", "Charger **power‑good** (low when 3.3 V is present on the shield — USB, HV PWR, or Qwiic 3.3 V; charging only happens while this is low)"
54+
"P7", "Charger **charging** (low while the Li‑Po is being charged)"
55+
"P8", "Li‑Po battery voltage monitor — shield divides **0–5 V** down to **0–1.8 V** at the pin"
56+
"P9", "LV input voltage monitor — shield divides **0–6 V** down to **0–1.8 V** at the pin"
57+
"P11", "microSD **power enable** (drive high to power the card)"
58+
"HV PWR in", "5–36 V on a JST terminal (reverse‑voltage tolerant; JST‑to‑pigtail adapter included)"
59+
"BAT in", "3.7 V single‑cell Li‑Po on a JST terminal"
60+
"LV PWR in", "1.8–5.5 V on a JST terminal for 3 alkaline cells in series (reverse‑voltage tolerant; JST‑to‑DC‑barrel‑jack adapter included)"
61+
"3.3V rail", "Powers the AE3 and the shield's on‑board electronics"
62+
"GND rail", "Common ground"
63+
64+
Usage
65+
-----
66+
67+
Plug an AE3 onto the shield and connect any one of the three power
68+
inputs — the shield ORs the rails internally and feeds the AE3 from
69+
whichever source is present.
70+
71+
.. note::
72+
73+
With only ``BAT`` connected (no USB, HV PWR, or Qwiic 3.3 V
74+
feeding the shield), the AE3 runs at 3.0 V off the Li‑Po, the
75+
charger is idle, and both status LEDs are off.
76+
77+
The microSD socket is exposed on the AE3's SPI bus through
78+
:class:`machine.SPI` and the standard ``sdcard`` driver. Drive
79+
``P11`` high to power the card, then wrap the block device in a
80+
``VfsFat`` and mount it at ``/sdcard``::
81+
82+
import os
83+
import machine
84+
import sdcard
85+
86+
machine.Pin("P11", machine.Pin.OUT, value=1) # enable card power
87+
88+
spi = machine.SPI(0, baudrate=10_000_000)
89+
cs = machine.Pin("P3", machine.Pin.OUT, value=1)
90+
91+
sd = sdcard.SDCard(spi, cs)
92+
os.mount(os.VfsFat(sd), "/sdcard")
93+
print(os.listdir("/sdcard"))
94+
95+
Watch the charger status by reading its two status pins. ``P6``
96+
(power‑good) goes low as soon as 3.3 V is present on the shield —
97+
from USB, HV PWR, or 3.3 V fed back through the AE3's Qwiic —
98+
which is also when the charger is allowed to run. ``P7`` (charging)
99+
goes low while the Li‑Po is actually being charged. Both pins also
100+
drive on‑board status LEDs — ``P6`` lights a **green** LED, ``P7``
101+
lights a **red** LED::
102+
103+
from machine import Pin
104+
105+
pg = Pin("P6", Pin.IN, Pin.PULL_UP)
106+
chg = Pin("P7", Pin.IN, Pin.PULL_UP)
107+
108+
if not pg.value():
109+
print("Charger powered")
110+
if not chg.value():
111+
print("Battery charging")
112+
else:
113+
print("Battery full or no battery")
114+
else:
115+
print("Running off battery only")
116+
117+
Monitor the Li‑Po battery and LV input voltages on ``P8`` and
118+
``P9``. The shield divides each supply down to the AE3's 1.8 V
119+
ADC range, so scale the reading back up by the input's full‑scale
120+
range::
121+
122+
from machine import ADC
123+
import time
124+
125+
lipo = ADC("P8") # 0–5 V at the input
126+
lv = ADC("P9") # 0–6 V at the input
127+
128+
while True:
129+
# 0–1.8 V at the pin → 0–5 V on the battery rail
130+
vbat = lipo.read_u16() * 1.8 / 65535 * (5.0 / 1.8)
131+
# 0–1.8 V at the pin → 0–6 V on the LV rail
132+
vlv = lv.read_u16() * 1.8 / 65535 * (6.0 / 1.8)
133+
print("Li‑Po:", vbat, "V LV:", vlv, "V")
134+
time.sleep_ms(500)

0 commit comments

Comments
 (0)