add pinouts and schematic
This commit is contained in:
1 parent
8629ba2d22
commit
146c88c324
4 files changed
+173
No files matched your search
@@ -0,0 +1,78 @@
|
||||
# Baby toy → DFPlayer audio trigger
|
||||
|
||||
Interfacing a battery-powered toy's button and LED matrix (4.8V, 3×AAA,
|
||||
active-high buttons / active-low LEDs) with a DFPlayer Mini (active-low,
|
||||
3.3V-pulled trigger pins) and a Seeed XIAO nRF52840.
|
||||
|
||||
## Schematic
|
||||
|
||||

|
||||
|
||||
## Bill of materials
|
||||
|
||||
| Part | Notes |
|
||||
|---|---|
|
||||
| Toy button/LED PCB | Existing hardware. 4.8V from 3×AAA. Buttons short to +4.8V, LEDs short to GND. |
|
||||
| DFPlayer Mini | Trigger pins are active-low, internally pulled high. |
|
||||
| Seeed XIAO nRF52840 | 3.3V logic. Reads LED sense lines; optional UART link to DFPlayer for extra tracks. |
|
||||
| ULN2003A (7ch) or ULN2803A (8ch) | Through-hole DIP darlington array. Pick based on how many button lines you need; spare channels can also drive LEDs if a GPIO can't sink enough current. |
|
||||
| 100 kΩ resistors (optional) | One per button line, only if that pin floats when unpressed. |
|
||||
|
||||
## Button → DFPlayer path (via darlington array)
|
||||
|
||||
Each toy button input goes straight into a ULN200x input pin — no external
|
||||
resistor needed, it's built in (~2.7 kΩ, rated well above 4.8V). The
|
||||
corresponding output pin goes straight to a DFPlayer trigger pin.
|
||||
|
||||
| Toy button | ULN200x input (pin) | ULN200x output (pin) | DFPlayer trigger pin |
|
||||
|---|---|---|---|
|
||||
| Button 1 | IN1 (1) | OUT1 (16) | IO1 / K1 |
|
||||
| Button 2 | IN2 (2) | OUT2 (15) | IO2 / K2 |
|
||||
| Button 3 | IN3 (3) | OUT3 (14) | K3 |
|
||||
| Button 4 | IN4 (4) | OUT4 (13) | K4 |
|
||||
| ... | ... | ... | ... |
|
||||
|
||||
Input and output pins are mirrored (IN1 pairs with OUT1, not OUT7) — check
|
||||
your chip's datasheet pinout before wiring, it's easy to get backwards.
|
||||
|
||||
Pin 8 is chip GND. Pin 9 (COM) isn't needed for this application — it's
|
||||
only relevant when driving inductive loads like relays or motors.
|
||||
|
||||
## LED drive path (XIAO → toy LEDs)
|
||||
|
||||
The XIAO drives the LEDs directly (random/sequential blink pattern) — it
|
||||
doesn't sense them. The toy originally lit each LED by grounding its pin,
|
||||
so the XIAO just needs to sink that same pin to reproduce that behavior.
|
||||
|
||||
| XIAO GPIO | Driver | Toy LED pin |
|
||||
|---|---|---|
|
||||
| GPIOx | direct pin, or spare ULN200x channel | LED 1 |
|
||||
| GPIOx | direct pin, or spare ULN200x channel | LED 2 |
|
||||
| GPIOx | direct pin, or spare ULN200x channel | LED 3 |
|
||||
|
||||
If the toy board already has a current-limiting resistor in series with
|
||||
each LED (likely, since the pin was safely grounded directly before), a
|
||||
bare GPIO configured as output and driven low may be enough — check the
|
||||
LED's current draw against the nRF52840 pin's sink rating first. If it's
|
||||
too high, route that line through an unused channel on the same
|
||||
ULN2003A/2803A used for the buttons instead, same wiring pattern, just
|
||||
with the XIAO as the input source.
|
||||
|
||||
To turn an LED off, leave the pin undriven (input / Hi-Z) rather than
|
||||
driving it HIGH — at 3.3V vs. the toy's 4.8V rail, a driven-high pin may
|
||||
not fully extinguish the LED depending on its forward voltage.
|
||||
|
||||
## Common ground
|
||||
|
||||
Toy battery GND, ULN200x GND (pin 8), DFPlayer GND, and XIAO GND must all
|
||||
be tied together. Without a shared ground reference, none of the switching
|
||||
above works.
|
||||
|
||||
## Notes
|
||||
|
||||
- **Floating button lines**: if a button pin doesn't idle at a defined
|
||||
level when unpressed, add a 100 kΩ pull-down per line to prevent
|
||||
spurious triggers.
|
||||
- **Optional UART link**: the XIAO can also drive the DFPlayer directly
|
||||
over UART for tracks beyond what the hardware trigger pins support,
|
||||
independent of the darlington-array trigger path above.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
@@ -0,0 +1,95 @@
|
||||
<svg width="900" height="410" viewBox="0 0 900 410" xmlns="http://www.w3.org/2000/svg" font-family="Helv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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALine truncated
|
||||
<defs>
|
||||
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1 1L8 5L1 9" fill="none" stroke="#333" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<rect x="0" y="0" width="900" height="410" fill="#ffffff"/>
|
||||
|
||||
<!-- Row 1: button trigger path -->
|
||||
<g>
|
||||
<rect x="40" y="40" width="190" height="70" rx="8" fill="#FDF0E3" stroke="#D97706" stroke-width="1.2"/>
|
||||
<text x="135" y="70" text-anchor="middle" font-size="14" font-weight="600" fill="#7A4A0A">Toy button matrix</text>
|
||||
<text x="135" y="90" text-anchor="middle" font-size="12" fill="#7A4A0A">Shorts pin to +4.8V</text>
|
||||
</g>
|
||||
|
||||
<line x1="230" y1="75" x2="270" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow)"/>
|
||||
|
||||
<g>
|
||||
<rect x="270" y="40" width="230" height="70" rx="8" fill="#F1F1F1" stroke="#555555" stroke-width="1.2"/>
|
||||
<text x="385" y="65" text-anchor="middle" font-size="13.5" font-weight="600" fill="#222">ULN2003A / ULN2803A</text>
|
||||
<text x="385" y="83" text-anchor="middle" font-size="12" fill="#333">darlington array</text>
|
||||
<text x="385" y="100" text-anchor="middle" font-size="11" fill="#666">open-collector, active-low out</text>
|
||||
</g>
|
||||
|
||||
<line x1="500" y1="75" x2="560" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow)"/>
|
||||
|
||||
<g>
|
||||
<rect x="560" y="40" width="190" height="70" rx="8" fill="#E8F1FB" stroke="#2563EB" stroke-width="1.2"/>
|
||||
<text x="655" y="70" text-anchor="middle" font-size="14" font-weight="600" fill="#123A73">DFPlayer Mini</text>
|
||||
<text x="655" y="90" text-anchor="middle" font-size="12" fill="#123A73">Trigger pin, pulled high</text>
|
||||
</g>
|
||||
|
||||
<!-- ground symbols row 1 -->
|
||||
<g stroke="#333" stroke-width="1.2">
|
||||
<line x1="385" y1="110" x2="385" y2="128"/>
|
||||
<line x1="373" y1="128" x2="397" y2="128"/>
|
||||
<line x1="377" y1="133" x2="393" y2="133"/>
|
||||
<line x1="381" y1="138" x2="389" y2="138"/>
|
||||
|
||||
<line x1="655" y1="110" x2="655" y2="128"/>
|
||||
<line x1="643" y1="128" x2="667" y2="128"/>
|
||||
<line x1="647" y1="133" x2="663" y2="133"/>
|
||||
<line x1="651" y1="138" x2="659" y2="138"/>
|
||||
|
||||
<line x1="135" y1="110" x2="135" y2="128"/>
|
||||
<line x1="123" y1="128" x2="147" y2="128"/>
|
||||
<line x1="127" y1="133" x2="143" y2="133"/>
|
||||
<line x1="131" y1="138" x2="139" y2="138"/>
|
||||
</g>
|
||||
|
||||
<!-- Row 2: LED drive path (XIAO -> LED, reversed flow, driven not sensed) -->
|
||||
<g>
|
||||
<rect x="40" y="220" width="190" height="70" rx="8" fill="#FDF0E3" stroke="#D97706" stroke-width="1.2"/>
|
||||
<text x="135" y="250" text-anchor="middle" font-size="14" font-weight="600" fill="#7A4A0A">Toy LED matrix</text>
|
||||
<text x="135" y="270" text-anchor="middle" font-size="12" fill="#7A4A0A">Lights when pin pulled low</text>
|
||||
</g>
|
||||
|
||||
<line x1="270" y1="255" x2="230" y2="255" stroke="#333" stroke-width="1.2" marker-end="url(#arrow)"/>
|
||||
|
||||
<g>
|
||||
<rect x="270" y="220" width="190" height="70" rx="8" fill="#F1F1F1" stroke="#555555" stroke-width="1.2"/>
|
||||
<text x="365" y="250" text-anchor="middle" font-size="13.5" font-weight="600" fill="#222">GPIO sink</text>
|
||||
<text x="365" y="268" text-anchor="middle" font-size="11" fill="#666">direct pin, or spare channel</text>
|
||||
</g>
|
||||
|
||||
<line x1="520" y1="255" x2="460" y2="255" stroke="#333" stroke-width="1.2" marker-end="url(#arrow)"/>
|
||||
|
||||
<g>
|
||||
<rect x="520" y="220" width="230" height="70" rx="8" fill="#E8F1FB" stroke="#2563EB" stroke-width="1.2"/>
|
||||
<text x="635" y="250" text-anchor="middle" font-size="14" font-weight="600" fill="#123A73">XIAO nRF52840</text>
|
||||
<text x="635" y="270" text-anchor="middle" font-size="12" fill="#123A73">Drives random/sequential blink</text>
|
||||
</g>
|
||||
|
||||
<!-- ground symbol row 2 -->
|
||||
<g stroke="#333" stroke-width="1.2">
|
||||
<line x1="635" y1="290" x2="635" y2="308"/>
|
||||
<line x1="623" y1="308" x2="647" y2="308"/>
|
||||
<line x1="627" y1="313" x2="643" y2="313"/>
|
||||
<line x1="631" y1="318" x2="639" y2="318"/>
|
||||
</g>
|
||||
|
||||
<!-- optional UART link between DFPlayer and XIAO -->
|
||||
<line x1="750" y1="75" x2="800" y2="75" stroke="#666" stroke-width="1" stroke-dasharray="4 3"/>
|
||||
<line x1="800" y1="75" x2="800" y2="255" stroke="#666" stroke-width="1" stroke-dasharray="4 3"/>
|
||||
<line x1="800" y1="255" x2="750" y2="255" stroke="#666" stroke-width="1" stroke-dasharray="4 3" marker-end="url(#arrow)"/>
|
||||
<text x="808" y="155" font-size="11" fill="#666">UART</text>
|
||||
<text x="808" y="169" font-size="11" fill="#666">(optional,</text>
|
||||
<text x="808" y="183" font-size="11" fill="#666">extra tracks)</text>
|
||||
|
||||
<!-- ground note -->
|
||||
<text x="40" y="355" font-size="12" fill="#333" font-weight="600">All ground symbols share one common node:</text>
|
||||
<text x="40" y="373" font-size="12" fill="#333">toy battery GND ↔ ULN2003 GND (pin 8) ↔ DFPlayer GND ↔ XIAO GND</text>
|
||||
<text x="40" y="393" font-size="11" fill="#888">Toy runs on 4.8V (3×AAA); DFPlayer/XIAO logic stays at their own 3.3V/5V rails throughout.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
Reference in new issue
Block a user