add pinouts and schematic
This commit is contained in:
@@ -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 |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
Reference in New Issue
Block a user