#pragma experiment("BRIDGE_CONNECT") #pragma experiment("MODULE_TEMPLATING") import ElectricPower import Pad from "parts/UNI_ROYAL_0805W8F1001T5E/UNI_ROYAL_0805W8F1001T5E.ato" import UNI_ROYAL_0805W8F1001T5E_package from "atopile/mounting-holes/MountingHole.py" import MountingHole from "parts/PANASONIC_EEEFK1A471AP/PANASONIC_EEEFK1A471AP.ato" import PANASONIC_EEEFK1A471AP_package from "parts/hongjiacheng_M1/hongjiacheng_M1.ato" import hongjiacheng_M1_package from "parts/hanxia_HX_PM2_54_1x8P_TP_H8_5_YQ/hanxia_HX_PM2_54_1x8P_TP_H8_5_YQ.ato" import hanxia_HX_PM2_54_1x8P_TP_H8_5_YQ_package from "parts/JST_Sales_America_B4B_PH_SM4_TB_LF__SN/JST_Sales_America_B4B_PH_SM4_TB_LF__SN.ato" import JST_Sales_America_B4B_PH_SM4_TB_LF__SN_package from "parts/JST_Sales_America_B2B_PH_SM4_TBT_LF__SN/JST_Sales_America_B2B_PH_SM4_TBT_LF__SN.ato" import JST_Sales_America_B2B_PH_SM4_TBT_LF__SN_package from "parts/SOFNG_PJ_320B/SOFNG_PJ_320B.ato" import SOFNG_PJ_320B_package # Component for the SMD 3.5mm Audio Jack component AudioJack3_5mm from SOFNG_PJ_320B_package: lcsc_id = "C22355831" signal SLEEVE ~ pin 1 # Ground signal RING ~ pin 2 # Right Channel signal TIP ~ pin 3 # Left Channel # Component for JST PH series vertical connectors component JST_PH_Vertical_2Pin from JST_Sales_America_B2B_PH_SM4_TBT_LF__SN_package: lcsc_id = "C265003" signal SPK_1 ~ pin 1 signal SPK_2 ~ pin 2 # Component for JST PH series vertical connectors component JST_PH_Vertical_4Pin from JST_Sales_America_B4B_PH_SM4_TB_LF__SN_package: lcsc_id = "C160354" signal VCC ~ pin 1 signal GND ~ pin 2 signal RX ~ pin 3 signal TX ~ pin 4 # Components for the SMD 1x8 pin sockets for the DFPlayer component DFPlayer_Socket_Left from hanxia_HX_PM2_54_1x8P_TP_H8_5_YQ_package: lcsc_id = "C46635844" signal VCC ~ pin 1 signal RX ~ pin 2 signal TX ~ pin 3 signal DAC_R ~ pin 4 signal DAC_L ~ pin 5 signal SPK_1 ~ pin 6 signal GND ~ pin 7 signal SPK_2 ~ pin 8 component DFPlayer_Socket_Right from hanxia_HX_PM2_54_1x8P_TP_H8_5_YQ_package: lcsc_id = "C46635844" signal BUSY ~ pin 1 signal USB_M ~ pin 2 signal USB_P ~ pin 3 signal ADKEY_2 ~ pin 4 signal ADKEY_1 ~ pin 5 signal IO_2 ~ pin 6 signal GND ~ pin 7 signal IO_1 ~ pin 8 component SOD123_Diode from hongjiacheng_M1_package: lcsc_id = "C18199093" component Elec_Cap_6_3x5_4 from PANASONIC_EEEFK1A471AP_package: lcsc_id = "C178529" signal plus ~ pin 1 # positive terminal signal minus ~ pin 2 # negative terminal component Resistor_SMD from UNI_ROYAL_0805W8F1001T5E_package: lcsc_id = "C17513" module FourMountingHoles: m2_no_pad1 = new MountingHole m2_no_pad2 = new MountingHole m2_no_pad3 = new MountingHole m2_no_pad4 = new MountingHole module DFPlayerCarrierBoard: # --- Signals and Power rails --- power_5v = new ElectricPower # Specify voltages on power rails power_5v.voltage = 5.1V +/- 3% # --- Components --- # DFPlayer Mini module instance # dfplayer = new DFPlayer_Mini # dfplayer.exclude_from_bom = True # Exclude from BOM since it's a module # Sockets for DFPlayer Mini df_header_left = new DFPlayer_Socket_Left df_header_right = new DFPlayer_Socket_Right # Diode for dropout protection (cathode to VCC) power_protection_diode = new hongjiacheng_M1_package # Capacitor for power filtering (electrolytic, 470uF, 10V) power_filter_cap = new Elec_Cap_6_3x5_4 # Input Connector (Power and UART) uart_connector = new JST_PH_Vertical_4Pin # 1k Ohm series resistor for the DFPlayer's RX line for 5V tolerance. rx_protection_resistor = new Resistor_SMD # Output Connectors speaker_connector = new JST_PH_Vertical_2Pin stereo_out_jack = new AudioJack3_5mm # --- Mechanical Mounting Holes --- mounting_holes = new FourMountingHoles # --- Connections --- # 1. Power Supply Circuit uart_connector.VCC ~ power_5v.vcc uart_connector.GND ~ power_5v.gnd # 2. DFPlayer Power and Ground Connections, diode and capacitor # Diode for dropout protection (cathode to VCC) uart_connector.VCC ~ power_protection_diode.A power_protection_diode.K ~ df_header_left.VCC # Capacitor for power filtering (electrolytic, 470uF, 10V) df_header_left.VCC ~ power_filter_cap.plus power_5v.gnd ~ power_filter_cap.minus # Connect another ground pin power_5v.gnd ~ df_header_right.GND power_5v.gnd ~ df_header_left.GND # 3. UART Serial Connection uart_connector.RX ~ rx_protection_resistor.1; rx_protection_resistor.2 ~ df_header_left.RX # Connect UART RX through resistor uart_connector.TX ~ df_header_left.TX # TX (direct connection) # 4. Speaker Output Connection speaker_connector.SPK_1 ~ df_header_left.SPK_1 speaker_connector.SPK_2 ~ df_header_left.SPK_2 # 5. Stereo Line Out Connection stereo_out_jack.TIP ~ df_header_left.DAC_L stereo_out_jack.RING ~ df_header_left.DAC_R stereo_out_jack.SLEEVE ~ power_5v.gnd