From a07e66f03893bee9429c7b8751bedcc8ce7f64d3 Mon Sep 17 00:00:00 2001 From: willem Date: Thu, 20 May 2021 17:07:33 +0200 Subject: [PATCH] added new PCB + leds + prox --- CAD/PCB/_autosave-clockclock.sch | 2407 ++++++++++++++++++++++++++++++ CAD/~$ESP32 Pins.xlsx | Bin 0 -> 165 bytes clockclock/.vscode/settings.json | 6 + clockclock/include/board.h | 8 +- clockclock/platformio.ini | 3 + clockclock/src/Proximity.h | 12 + clockclock/src/board.cpp | 6 + clockclock/src/buttons.cpp | 2 + clockclock/src/comms.cpp | 24 +- clockclock/src/comms.h | 5 +- clockclock/src/led.cpp | 44 + clockclock/src/led.h | 11 + clockclock/src/main.cpp | 11 + clockclock/src/motor.cpp | 7 +- clockclock/src/proximity.cpp | 70 + 15 files changed, 2600 insertions(+), 16 deletions(-) create mode 100644 CAD/PCB/_autosave-clockclock.sch create mode 100644 CAD/~$ESP32 Pins.xlsx create mode 100644 clockclock/.vscode/settings.json create mode 100644 clockclock/src/Proximity.h create mode 100644 clockclock/src/board.cpp create mode 100644 clockclock/src/led.cpp create mode 100644 clockclock/src/led.h create mode 100644 clockclock/src/proximity.cpp diff --git a/CAD/PCB/_autosave-clockclock.sch b/CAD/PCB/_autosave-clockclock.sch new file mode 100644 index 0000000..405644f --- /dev/null +++ b/CAD/PCB/_autosave-clockclock.sch @@ -0,0 +1,2407 @@ +EESchema Schematic File Version 4 +EELAYER 30 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "" +Date "" +Rev "" +Comp "" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L Driver_Motor:STSPIN220 U2 +U 1 1 60BA5CA4 +P 8950 1900 +F 0 "U2" H 8600 1250 50 0000 C CNN +F 1 "STSPIN220" H 9350 1250 50 0000 C CNN +F 2 "Package_DFN_QFN:VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm" H 9150 2650 50 0001 L CNN +F 3 "www.st.com/resource/en/datasheet/stspin220.pdf" H 9100 2150 50 0001 C CNN + 1 8950 1900 + 1 0 0 -1 +$EndComp +$Comp +L Driver_Motor:STSPIN220 U3 +U 1 1 60BA7446 +P 8950 3950 +F 0 "U3" H 8600 3300 50 0000 C CNN +F 1 "STSPIN220" H 9350 3300 50 0000 C CNN +F 2 "Package_DFN_QFN:VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm" H 9150 4700 50 0001 L CNN +F 3 "www.st.com/resource/en/datasheet/stspin220.pdf" H 9100 4200 50 0001 C CNN + 1 8950 3950 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R6 +U 1 1 60BB01AD +P 9800 4350 +F 0 "R6" H 9870 4396 50 0000 L CNN +F 1 "330mE" H 9870 4305 50 0000 L CNN +F 2 "MySymbols:R_1206_3216Metric_REVERSED" V 9730 4350 50 0001 C CNN +F 3 "~" H 9800 4350 50 0001 C CNN +F 4 "Mouser" H 9800 4350 50 0001 C CNN "supplier" +F 5 "710-561070332096" H 9800 4350 50 0001 C CNN "ordercode" + 1 9800 4350 + -1 0 0 -1 +$EndComp +$Comp +L Device:R R8 +U 1 1 60BB2E3C +P 9950 4350 +F 0 "R8" H 10020 4396 50 0000 L CNN +F 1 "330mE" H 10020 4305 50 0000 L CNN +F 2 "MySymbols:R_1206_3216Metric_REVERSED" V 9880 4350 50 0001 C CNN +F 3 "~" H 9950 4350 50 0001 C CNN +F 4 "mouser" H 9950 4350 50 0001 C CNN "supplier" +F 5 "710-561070332096" H 9950 4350 50 0001 C CNN "ordercode" + 1 9950 4350 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R5 +U 1 1 60BB457F +P 9800 2350 +F 0 "R5" H 9870 2396 50 0000 L CNN +F 1 "330mE" H 9870 2305 50 0000 L CNN +F 2 "MySymbols:R_1206_3216Metric_REVERSED" V 9730 2350 50 0001 C CNN +F 3 "~" H 9800 2350 50 0001 C CNN +F 4 "mouser" H 9800 2350 50 0001 C CNN "supplier" +F 5 "710-561070332096" H 9800 2350 50 0001 C CNN "ordercode" + 1 9800 2350 + -1 0 0 -1 +$EndComp +$Comp +L Device:R R7 +U 1 1 60BB47EF +P 9950 2350 +F 0 "R7" H 10020 2396 50 0000 L CNN +F 1 "330mE" H 10020 2305 50 0000 L CNN +F 2 "MySymbols:R_1206_3216Metric_REVERSED" V 9880 2350 50 0001 C CNN +F 3 "~" H 9950 2350 50 0001 C CNN +F 4 "mouser" H 9950 2350 50 0001 C CNN "supplier" +F 5 "710-561070332096" H 9950 2350 50 0001 C CNN "ordercode" + 1 9950 2350 + 1 0 0 -1 +$EndComp +Wire Wire Line + 9550 2100 9800 2100 +Wire Wire Line + 9800 2100 9800 2200 +Wire Wire Line + 9550 1600 9950 1600 +Wire Wire Line + 9950 1600 9950 2200 +Wire Wire Line + 9550 4150 9800 4150 +Wire Wire Line + 9800 4150 9800 4200 +Wire Wire Line + 9550 3650 9950 3650 +Wire Wire Line + 9950 3650 9950 4200 +$Comp +L power:GND #PWR0101 +U 1 1 60BB684A +P 9800 4550 +F 0 "#PWR0101" H 9800 4300 50 0001 C CNN +F 1 "GND" H 9805 4377 50 0000 C CNN +F 2 "" H 9800 4550 50 0001 C CNN +F 3 "" H 9800 4550 50 0001 C CNN + 1 9800 4550 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0102 +U 1 1 60BB70BF +P 9950 4550 +F 0 "#PWR0102" H 9950 4300 50 0001 C CNN +F 1 "GND" H 9955 4377 50 0000 C CNN +F 2 "" H 9950 4550 50 0001 C CNN +F 3 "" H 9950 4550 50 0001 C CNN + 1 9950 4550 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0103 +U 1 1 60BB74CF +P 9050 4700 +F 0 "#PWR0103" H 9050 4450 50 0001 C CNN +F 1 "GND" H 9055 4527 50 0000 C CNN +F 2 "" H 9050 4700 50 0001 C CNN +F 3 "" H 9050 4700 50 0001 C CNN + 1 9050 4700 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0104 +U 1 1 60BB79DB +P 9050 2650 +F 0 "#PWR0104" H 9050 2400 50 0001 C CNN +F 1 "GND" H 9055 2477 50 0000 C CNN +F 2 "" H 9050 2650 50 0001 C CNN +F 3 "" H 9050 2650 50 0001 C CNN + 1 9050 2650 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0105 +U 1 1 60BB7E59 +P 9800 2550 +F 0 "#PWR0105" H 9800 2300 50 0001 C CNN +F 1 "GND" H 9805 2377 50 0000 C CNN +F 2 "" H 9800 2550 50 0001 C CNN +F 3 "" H 9800 2550 50 0001 C CNN + 1 9800 2550 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0106 +U 1 1 60BB828C +P 9950 2550 +F 0 "#PWR0106" H 9950 2300 50 0001 C CNN +F 1 "GND" H 9955 2377 50 0000 C CNN +F 2 "" H 9950 2550 50 0001 C CNN +F 3 "" H 9950 2550 50 0001 C CNN + 1 9950 2550 + 1 0 0 -1 +$EndComp +Wire Wire Line + 9800 2500 9800 2550 +Wire Wire Line + 9950 2500 9950 2550 +Wire Wire Line + 9800 4500 9800 4550 +Wire Wire Line + 9950 4500 9950 4550 +$Comp +L Connector_Generic:Conn_01x04 J1 +U 1 1 60BB9569 +P 1300 7350 +F 0 "J1" H 1250 7050 50 0000 L CNN +F 1 "Conn_01x04" H 1100 6950 50 0000 L CNN +F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 1300 7350 50 0001 C CNN +F 3 "~" H 1300 7350 50 0001 C CNN + 1 1300 7350 + 1 0 0 -1 +$EndComp +$Comp +L Connector_Generic:Conn_01x04 J3 +U 1 1 60BBA03E +P 2150 7350 +F 0 "J3" H 2100 7050 50 0000 L CNN +F 1 "Conn_01x04" H 1900 6950 50 0000 L CNN +F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 2150 7350 50 0001 C CNN +F 3 "~" H 2150 7350 50 0001 C CNN + 1 2150 7350 + 1 0 0 -1 +$EndComp +$Comp +L Connector_Generic:Conn_01x04 J4 +U 1 1 60BBA98A +P 3000 7350 +F 0 "J4" H 2950 7050 50 0000 L CNN +F 1 "Conn_01x04" H 2750 6950 50 0000 L CNN +F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 3000 7350 50 0001 C CNN +F 3 "~" H 3000 7350 50 0001 C CNN + 1 3000 7350 + 1 0 0 -1 +$EndComp +$Comp +L Connector_Generic:Conn_01x04 J5 +U 1 1 60BBB19E +P 3800 7350 +F 0 "J5" H 3750 7050 50 0000 L CNN +F 1 "Conn_01x04" H 3550 6950 50 0000 L CNN +F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 3800 7350 50 0001 C CNN +F 3 "~" H 3800 7350 50 0001 C CNN + 1 3800 7350 + 1 0 0 -1 +$EndComp +Wire Wire Line + 1100 7250 1950 7250 +Wire Wire Line + 1950 7250 2800 7250 +Connection ~ 1950 7250 +Wire Wire Line + 2800 7250 3600 7250 +Connection ~ 2800 7250 +Wire Wire Line + 3600 7350 2800 7350 +Wire Wire Line + 2800 7450 3600 7450 +Wire Wire Line + 3600 7550 2800 7550 +Wire Wire Line + 2800 7550 1950 7550 +Connection ~ 2800 7550 +Wire Wire Line + 1950 7450 2800 7450 +Connection ~ 2800 7450 +Wire Wire Line + 2800 7350 1950 7350 +Connection ~ 2800 7350 +Wire Wire Line + 1950 7350 1100 7350 +Connection ~ 1950 7350 +Wire Wire Line + 1100 7450 1950 7450 +Connection ~ 1950 7450 +Wire Wire Line + 1950 7550 1100 7550 +Connection ~ 1950 7550 +Text GLabel 900 7450 0 50 Input ~ 0 +I2C_SDA +Text GLabel 900 7350 0 50 Input ~ 0 +I2C_SCL +Text GLabel 900 7250 0 50 Input ~ 0 ++5V +Text GLabel 900 7550 0 50 Input ~ 0 +GND +Wire Wire Line + 900 7550 1100 7550 +Connection ~ 1100 7550 +Wire Wire Line + 900 7450 1100 7450 +Connection ~ 1100 7450 +Wire Wire Line + 1100 7350 900 7350 +Connection ~ 1100 7350 +Wire Wire Line + 900 7250 1100 7250 +Connection ~ 1100 7250 +$Comp +L Switch:SW_DIP_x04 SW1 +U 1 1 60BCB5AC +P 2200 6300 +F 0 "SW1" H 2200 6767 50 0000 C CNN +F 1 "SW_DIP_x04" H 2200 6676 50 0000 C CNN +F 2 "Button_Switch_SMD:SW_DIP_SPSTx04_Slide_Omron_A6S-410x_W8.9mm_P2.54mm" H 2200 6300 50 0001 C CNN +F 3 "~" H 2200 6300 50 0001 C CNN +F 4 "farnell" H 2200 6300 50 0001 C CNN "supplier" +F 5 "9472037" H 2200 6300 50 0001 C CNN "ordercode" + 1 2200 6300 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0107 +U 1 1 60BCD679 +P 2650 6500 +F 0 "#PWR0107" H 2650 6250 50 0001 C CNN +F 1 "GND" H 2655 6327 50 0000 C CNN +F 2 "" H 2650 6500 50 0001 C CNN +F 3 "" H 2650 6500 50 0001 C CNN + 1 2650 6500 + 1 0 0 -1 +$EndComp +Wire Wire Line + 9050 4650 9050 4700 +Wire Wire Line + 2500 6100 2650 6100 +Wire Wire Line + 2650 6100 2650 6200 +Wire Wire Line + 2500 6200 2650 6200 +Connection ~ 2650 6200 +Wire Wire Line + 2650 6200 2650 6300 +Wire Wire Line + 2500 6300 2650 6300 +Connection ~ 2650 6300 +Wire Wire Line + 2650 6300 2650 6400 +Wire Wire Line + 2500 6400 2650 6400 +Connection ~ 2650 6400 +Wire Wire Line + 2650 6400 2650 6500 +$Comp +L power:+5V #PWR0108 +U 1 1 60BDA4A1 +P 8950 1150 +F 0 "#PWR0108" H 8950 1000 50 0001 C CNN +F 1 "+5V" H 8965 1323 50 0000 C CNN +F 2 "" H 8950 1150 50 0001 C CNN +F 3 "" H 8950 1150 50 0001 C CNN + 1 8950 1150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 8950 1150 8950 1200 +$Comp +L power:+5V #PWR0109 +U 1 1 60BDB7ED +P 8950 3200 +F 0 "#PWR0109" H 8950 3050 50 0001 C CNN +F 1 "+5V" H 8965 3373 50 0000 C CNN +F 2 "" H 8950 3200 50 0001 C CNN +F 3 "" H 8950 3200 50 0001 C CNN + 1 8950 3200 + 1 0 0 -1 +$EndComp +Wire Wire Line + 8950 3200 8950 3250 +Wire Wire Line + 8950 2600 9050 2600 +Wire Wire Line + 9050 2600 9050 2650 +Connection ~ 9050 2600 +Wire Wire Line + 8950 4650 9050 4650 +Connection ~ 9050 4650 +$Comp +L Device:R R4 +U 1 1 60BF2DDC +P 8000 4450 +F 0 "R4" V 8050 4250 50 0000 L CNN +F 1 "47K" V 8000 4350 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 7930 4450 50 0001 C CNN +F 3 "~" H 8000 4450 50 0001 C CNN + 1 8000 4450 + 0 1 -1 0 +$EndComp +$Comp +L Device:R R2 +U 1 1 60BF36D6 +P 8150 4700 +F 0 "R2" V 8220 4746 50 0000 L CNN +F 1 "47K" V 8150 4650 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 8080 4700 50 0001 C CNN +F 3 "~" H 8150 4700 50 0001 C CNN + 1 8150 4700 + 0 -1 1 0 +$EndComp +$Comp +L Device:C C2 +U 1 1 60BFA833 +P 7800 4700 +F 0 "C2" V 7850 4850 50 0000 R CNN +F 1 "22nF" V 7650 4800 50 0000 R CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 7838 4550 50 0001 C CNN +F 3 "~" H 7800 4700 50 0001 C CNN + 1 7800 4700 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 8350 4700 8300 4700 +Wire Wire Line + 8000 4700 7950 4700 +Wire Wire Line + 8150 4450 8350 4450 +Wire Wire Line + 8350 4450 8350 4700 +Wire Wire Line + 7850 4450 7600 4450 +$Comp +L power:GND #PWR0110 +U 1 1 60C01F63 +P 7600 4800 +F 0 "#PWR0110" H 7600 4550 50 0001 C CNN +F 1 "GND" H 7605 4627 50 0000 C CNN +F 2 "" H 7600 4800 50 0001 C CNN +F 3 "" H 7600 4800 50 0001 C CNN + 1 7600 4800 + -1 0 0 -1 +$EndComp +$Comp +L Device:R R3 +U 1 1 60C05757 +P 8200 2400 +F 0 "R3" V 8150 2200 50 0000 L CNN +F 1 "47K" V 8200 2300 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 8130 2400 50 0001 C CNN +F 3 "~" H 8200 2400 50 0001 C CNN + 1 8200 2400 + 0 1 -1 0 +$EndComp +$Comp +L Device:R R1 +U 1 1 60C0575D +P 8200 2650 +F 0 "R1" V 8100 2650 50 0000 L CNN +F 1 "47K" V 8200 2600 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 8130 2650 50 0001 C CNN +F 3 "~" H 8200 2650 50 0001 C CNN + 1 8200 2650 + 0 -1 1 0 +$EndComp +$Comp +L Device:C C1 +U 1 1 60C05763 +P 7850 2650 +F 0 "C1" V 7800 2800 50 0000 R CNN +F 1 "22nF" V 7700 2700 50 0000 R CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 7888 2500 50 0001 C CNN +F 3 "~" H 7850 2650 50 0001 C CNN + 1 7850 2650 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 8400 2650 8350 2650 +Wire Wire Line + 8050 2650 8000 2650 +Wire Wire Line + 8350 2400 8400 2400 +Wire Wire Line + 8400 2400 8400 2650 +Wire Wire Line + 8050 2400 7650 2400 +Wire Wire Line + 7650 2400 7650 2650 +$Comp +L power:GND #PWR0111 +U 1 1 60C05771 +P 7650 2700 +F 0 "#PWR0111" H 7650 2450 50 0001 C CNN +F 1 "GND" H 7655 2527 50 0000 C CNN +F 2 "" H 7650 2700 50 0001 C CNN +F 3 "" H 7650 2700 50 0001 C CNN + 1 7650 2700 + -1 0 0 -1 +$EndComp +Wire Wire Line + 7650 2650 7700 2650 +Wire Wire Line + 7950 3450 8450 3450 +Wire Wire Line + 8450 4150 7950 4150 +$Comp +L clockclock-rescue:Stepper_Motor_bipolar_VID28-Motor M1 +U 1 1 6071712D +P 10900 3200 +F 0 "M1" H 10800 3800 50 0000 L CNN +F 1 "Stepper_Motor_bipolar_VID28" H 10050 3000 50 0000 L CNN +F 2 "MySymbols:X40_Stepper" H 10910 3190 50 0001 C CNN +F 3 "http://www.infineon.com/dgdl/Application-Note-TLE8110EE_driving_UniPolarStepperMotor_V1.1.pdf?fileId=db3a30431be39b97011be5d0aa0a00b0" H 10910 3190 50 0001 C CNN + 1 10900 3200 + 1 0 0 1 +$EndComp +Wire Wire Line + 9550 1400 10550 1400 +Wire Wire Line + 10550 1400 10550 2300 +Wire Wire Line + 10550 2300 10600 2300 +Wire Wire Line + 10600 2500 10500 2500 +Wire Wire Line + 10500 2500 10500 1500 +Wire Wire Line + 10500 1500 9550 1500 +Wire Wire Line + 9550 1900 10450 1900 +Wire Wire Line + 10450 2700 10600 2700 +Wire Wire Line + 9550 3450 10400 3450 +Wire Wire Line + 10600 3300 10450 3300 +Wire Wire Line + 10450 3300 10450 3550 +Wire Wire Line + 10450 3550 9550 3550 +Wire Wire Line + 9550 3950 10500 3950 +Wire Wire Line + 10500 3950 10500 3500 +Wire Wire Line + 10500 3500 10600 3500 +Wire Wire Line + 10600 3700 10550 3700 +Wire Wire Line + 10550 3700 10550 4050 +Wire Wire Line + 10550 4050 9550 4050 +Wire Wire Line + 10450 1900 10450 2700 +Wire Wire Line + 10400 2000 9550 2000 +Wire Wire Line + 8450 1500 7950 1500 +Wire Wire Line + 8450 2100 7950 2100 +Wire Wire Line + 8450 3550 7950 3550 +$Comp +L Switch:SW_Push SW3 +U 1 1 60D20867 +P 4050 6400 +F 0 "SW3" H 4100 6300 50 0000 R CNN +F 1 "SW_Push" V 4005 6352 50 0001 R CNN +F 2 "Button_Switch_SMD:SW_Push_1P1T_NO_6x6mm_H9.5mm" H 4050 6600 50 0001 C CNN +F 3 "~" H 4050 6600 50 0001 C CNN + 1 4050 6400 + 1 0 0 -1 +$EndComp +$Comp +L Switch:SW_Push SW4 +U 1 1 60D21939 +P 4050 6200 +F 0 "SW4" H 4100 6400 50 0000 R CNN +F 1 "SW_Push" H 4050 6400 50 0001 R CNN +F 2 "Button_Switch_SMD:SW_Push_1P1T_NO_6x6mm_H9.5mm" H 4050 6400 50 0001 C CNN +F 3 "~" H 4050 6400 50 0001 C CNN + 1 4050 6200 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0130 +U 1 1 60D221F9 +P 4400 6450 +F 0 "#PWR0130" H 4400 6200 50 0001 C CNN +F 1 "GND" H 4405 6277 50 0000 C CNN +F 2 "" H 4400 6450 50 0001 C CNN +F 3 "" H 4400 6450 50 0001 C CNN + 1 4400 6450 + 1 0 0 -1 +$EndComp +Text GLabel 3750 6400 0 50 Input ~ 0 +BUT_PLUS +Text GLabel 3750 6200 0 50 Input ~ 0 +BUT_MIN +Wire Wire Line + 3750 6400 3850 6400 +Wire Wire Line + 3750 6200 3850 6200 +Text Notes 1950 6650 0 50 ~ 0 +Address input +$Comp +L Mechanical:MountingHole H4 +U 1 1 60DBFD5F +P 6800 7700 +F 0 "H4" H 6900 7746 50 0000 L CNN +F 1 "MountingHole" H 6900 7655 50 0000 L CNN +F 2 "MountingHole:MountingHole_4.3mm_M4" H 6800 7700 50 0001 C CNN +F 3 "~" H 6800 7700 50 0001 C CNN +F 4 "DNP" H 6800 7700 50 0001 C CNN "DNP" + 1 6800 7700 + 1 0 0 -1 +$EndComp +$Comp +L Mechanical:MountingHole H3 +U 1 1 60DC01F1 +P 6600 7700 +F 0 "H3" H 6700 7746 50 0000 L CNN +F 1 "MountingHole" H 6700 7655 50 0000 L CNN +F 2 "MountingHole:MountingHole_4.3mm_M4" H 6600 7700 50 0001 C CNN +F 3 "~" H 6600 7700 50 0001 C CNN +F 4 "DNP" H 6600 7700 50 0001 C CNN "DNP" + 1 6600 7700 + 1 0 0 -1 +$EndComp +$Comp +L Mechanical:MountingHole H2 +U 1 1 60DC072B +P 6400 7700 +F 0 "H2" H 6500 7746 50 0000 L CNN +F 1 "MountingHole" H 6500 7655 50 0000 L CNN +F 2 "MountingHole:MountingHole_4.3mm_M4" H 6400 7700 50 0001 C CNN +F 3 "~" H 6400 7700 50 0001 C CNN +F 4 "DNP" H 6400 7700 50 0001 C CNN "DNP" + 1 6400 7700 + 1 0 0 -1 +$EndComp +$Comp +L Mechanical:MountingHole H1 +U 1 1 60DC097B +P 6200 7700 +F 0 "H1" H 6300 7746 50 0000 L CNN +F 1 "MountingHole" H 6300 7655 50 0000 L CNN +F 2 "MountingHole:MountingHole_4.3mm_M4" H 6200 7700 50 0001 C CNN +F 3 "~" H 6200 7700 50 0001 C CNN +F 4 "DNP" H 6200 7700 50 0001 C CNN "DNP" + 1 6200 7700 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R10 +U 1 1 60E52DDC +P 2450 1000 +F 0 "R10" H 2520 1046 50 0000 L CNN +F 1 "1K" H 2520 955 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 2380 1000 50 0001 C CNN +F 3 "~" H 2450 1000 50 0001 C CNN +F 4 "DNP" V 2450 1000 50 0000 C CNN "DNP" + 1 2450 1000 + -1 0 0 1 +$EndComp +Text GLabel 2400 1250 0 50 Input ~ 0 +I2C_SDA +Text GLabel 2400 1350 0 50 Input ~ 0 +I2C_SCL +Wire Wire Line + 2400 1250 2450 1250 +Wire Wire Line + 2450 1250 2450 1150 +Wire Wire Line + 2400 1350 2850 1350 +Wire Wire Line + 2850 1350 2850 1150 +$Comp +L power:+3V3 #PWR0133 +U 1 1 60E8A29B +P 2450 750 +F 0 "#PWR0133" H 2450 600 50 0001 C CNN +F 1 "+3V3" H 2465 923 50 0000 C CNN +F 2 "" H 2450 750 50 0001 C CNN +F 3 "" H 2450 750 50 0001 C CNN + 1 2450 750 + 1 0 0 -1 +$EndComp +$Comp +L power:+3V3 #PWR0134 +U 1 1 60E8A8C5 +P 2850 750 +F 0 "#PWR0134" H 2850 600 50 0001 C CNN +F 1 "+3V3" H 2865 923 50 0000 C CNN +F 2 "" H 2850 750 50 0001 C CNN +F 3 "" H 2850 750 50 0001 C CNN + 1 2850 750 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2850 750 2850 850 +Wire Wire Line + 2450 750 2450 850 +$Comp +L Device:C C11 +U 1 1 60EA7EEB +P 10600 4550 +F 0 "C11" H 10715 4596 50 0000 L CNN +F 1 "100nF" H 10715 4505 50 0000 L CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 10638 4400 50 0001 C CNN +F 3 "~" H 10600 4550 50 0001 C CNN + 1 10600 4550 + -1 0 0 -1 +$EndComp +$Comp +L Device:C_Polarized C12 +U 1 1 60EA9977 +P 10850 4550 +F 0 "C12" H 10968 4596 50 0000 L CNN +F 1 "10uF" H 10968 4505 50 0000 L CNN +F 2 "Capacitor_SMD:C_Elec_4x5.4" H 10888 4400 50 0001 C CNN +F 3 "~" H 10850 4550 50 0001 C CNN +F 4 "Panasonic" H 10850 4550 50 0001 C CNN "mfr" +F 5 "MCVVT016M100CA1L" H 10850 4550 50 0001 C CNN "partnr" +F 6 "farnell" H 10850 4550 50 0001 C CNN "supplier" +F 7 "2611355" H 10850 4550 50 0001 C CNN "ordercode" + 1 10850 4550 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0135 +U 1 1 60EBB56B +P 10600 4800 +F 0 "#PWR0135" H 10600 4550 50 0001 C CNN +F 1 "GND" H 10605 4627 50 0000 C CNN +F 2 "" H 10600 4800 50 0001 C CNN +F 3 "" H 10600 4800 50 0001 C CNN + 1 10600 4800 + 1 0 0 -1 +$EndComp +Wire Wire Line + 10600 4800 10600 4700 +Wire Wire Line + 10600 4700 10850 4700 +Connection ~ 10600 4700 +Wire Wire Line + 10850 4400 10600 4400 +$Comp +L power:+5V #PWR0136 +U 1 1 60EE71DD +P 10600 4350 +F 0 "#PWR0136" H 10600 4200 50 0001 C CNN +F 1 "+5V" H 10615 4523 50 0000 C CNN +F 2 "" H 10600 4350 50 0001 C CNN +F 3 "" H 10600 4350 50 0001 C CNN + 1 10600 4350 + 1 0 0 -1 +$EndComp +Wire Wire Line + 10600 4350 10600 4400 +Connection ~ 10600 4400 +$Comp +L Device:C C9 +U 1 1 60EF8457 +P 10650 900 +F 0 "C9" H 10765 946 50 0000 L CNN +F 1 "100nF" H 10765 855 50 0000 L CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 10688 750 50 0001 C CNN +F 3 "~" H 10650 900 50 0001 C CNN + 1 10650 900 + -1 0 0 -1 +$EndComp +$Comp +L Device:C_Polarized C10 +U 1 1 60EF845D +P 10900 900 +F 0 "C10" H 11018 946 50 0000 L CNN +F 1 "10uF" H 11018 855 50 0000 L CNN +F 2 "Capacitor_SMD:C_Elec_4x5.4" H 10938 750 50 0001 C CNN +F 3 "~" H 10900 900 50 0001 C CNN +F 4 "Panasonic" H 10900 900 50 0001 C CNN "mfr" +F 5 "2611355" H 10900 900 50 0001 C CNN "ordercode" +F 6 "farnell" H 10900 900 50 0001 C CNN "supplier" + 1 10900 900 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0137 +U 1 1 60EF8463 +P 10650 1100 +F 0 "#PWR0137" H 10650 850 50 0001 C CNN +F 1 "GND" H 10655 927 50 0000 C CNN +F 2 "" H 10650 1100 50 0001 C CNN +F 3 "" H 10650 1100 50 0001 C CNN + 1 10650 1100 + 1 0 0 -1 +$EndComp +Wire Wire Line + 10650 1100 10650 1050 +Wire Wire Line + 10650 1050 10900 1050 +Connection ~ 10650 1050 +Wire Wire Line + 10900 750 10650 750 +$Comp +L power:+5V #PWR0138 +U 1 1 60EF846D +P 10650 700 +F 0 "#PWR0138" H 10650 550 50 0001 C CNN +F 1 "+5V" H 10665 873 50 0000 C CNN +F 2 "" H 10650 700 50 0001 C CNN +F 3 "" H 10650 700 50 0001 C CNN + 1 10650 700 + 1 0 0 -1 +$EndComp +Wire Wire Line + 10650 700 10650 750 +Connection ~ 10650 750 +Text Notes 2150 1450 0 50 ~ 0 +Only place once +$Comp +L Device:R R11 +U 1 1 60F388C1 +P 2850 1000 +F 0 "R11" H 2920 1046 50 0000 L CNN +F 1 "1K" H 2920 955 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 2780 1000 50 0001 C CNN +F 3 "~" H 2850 1000 50 0001 C CNN +F 4 "DNP" V 2850 1000 50 0000 C CNN "DNP" + 1 2850 1000 + -1 0 0 1 +$EndComp +Text Notes 1900 7100 0 50 ~ 0 +Board 2 board interface\n +Text Label 10100 1400 0 50 ~ 0 +MOT_A1 +Text Label 10100 1500 0 50 ~ 0 +MOT_A2 +Text Label 10100 1900 0 50 ~ 0 +MOT_A3 +Text Label 10100 2000 0 50 ~ 0 +MOT_A4 +$Comp +L Regulator_Linear:MCP1825S U5 +U 1 1 606F287A +P 9700 5700 +F 0 "U5" H 9700 5942 50 0000 C CNN +F 1 "MCP1825S" H 9700 5851 50 0000 C CNN +F 2 "Package_TO_SOT_SMD:SOT-223-3_TabPin2" H 9600 5850 50 0001 C CNN +F 3 "http://ww1.microchip.com/downloads/en/devicedoc/22056b.pdf" H 9700 5950 50 0001 C CNN +F 4 "Microchip" H 9700 5700 50 0001 C CNN "manufacturer" +F 5 "MCP1825ST-3302E/DB" H 9700 5700 50 0001 C CNN "partnr" +F 6 "farnell" H 9700 5700 50 0001 C CNN "supplier" +F 7 "2857611" H 9700 5700 50 0001 C CNN "ordercode" + 1 9700 5700 + 1 0 0 -1 +$EndComp +$Comp +L Device:C_Polarized C14 +U 1 1 606F4D9C +P 9150 5950 +F 0 "C14" H 9268 5996 50 0000 L CNN +F 1 "10uF" H 9268 5905 50 0000 L CNN +F 2 "Capacitor_SMD:C_Elec_4x5.4" H 9188 5800 50 0001 C CNN +F 3 "~" H 9150 5950 50 0001 C CNN +F 4 "Panasonic" H 9150 5950 50 0001 C CNN "mfr" +F 5 "MCVVT016M100CA1L" H 9150 5950 50 0001 C CNN "partnr" +F 6 "farnell" H 9150 5950 50 0001 C CNN "supplier" +F 7 "2611355" H 9150 5950 50 0001 C CNN "ordercode" + 1 9150 5950 + 1 0 0 -1 +$EndComp +$Comp +L Device:C_Polarized C15 +U 1 1 606F5F9E +P 10450 5950 +F 0 "C15" H 10568 5996 50 0000 L CNN +F 1 "10uF" H 10568 5905 50 0000 L CNN +F 2 "Capacitor_SMD:C_Elec_4x5.4" H 10488 5800 50 0001 C CNN +F 3 "~" H 10450 5950 50 0001 C CNN +F 4 "Panasonic" H 10450 5950 50 0001 C CNN "mfr" +F 5 "MCVVT016M100CA1L" H 10450 5950 50 0001 C CNN "partnr" +F 6 "farnell" H 10450 5950 50 0001 C CNN "supplier" +F 7 "2611355" H 10450 5950 50 0001 C CNN "ordercode" + 1 10450 5950 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0139 +U 1 1 606F6A39 +P 9150 6150 +F 0 "#PWR0139" H 9150 5900 50 0001 C CNN +F 1 "GND" H 9155 5977 50 0000 C CNN +F 2 "" H 9150 6150 50 0001 C CNN +F 3 "" H 9150 6150 50 0001 C CNN + 1 9150 6150 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0140 +U 1 1 606F6EF7 +P 9700 6150 +F 0 "#PWR0140" H 9700 5900 50 0001 C CNN +F 1 "GND" H 9705 5977 50 0000 C CNN +F 2 "" H 9700 6150 50 0001 C CNN +F 3 "" H 9700 6150 50 0001 C CNN + 1 9700 6150 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0141 +U 1 1 606F7430 +P 10450 6150 +F 0 "#PWR0141" H 10450 5900 50 0001 C CNN +F 1 "GND" H 10455 5977 50 0000 C CNN +F 2 "" H 10450 6150 50 0001 C CNN +F 3 "" H 10450 6150 50 0001 C CNN + 1 10450 6150 + 1 0 0 -1 +$EndComp +$Comp +L power:+5V #PWR0142 +U 1 1 606F776D +P 9150 5650 +F 0 "#PWR0142" H 9150 5500 50 0001 C CNN +F 1 "+5V" H 9165 5823 50 0000 C CNN +F 2 "" H 9150 5650 50 0001 C CNN +F 3 "" H 9150 5650 50 0001 C CNN + 1 9150 5650 + 1 0 0 -1 +$EndComp +$Comp +L power:+3V3 #PWR0143 +U 1 1 606F7F56 +P 10450 5650 +F 0 "#PWR0143" H 10450 5500 50 0001 C CNN +F 1 "+3V3" H 10465 5823 50 0000 C CNN +F 2 "" H 10450 5650 50 0001 C CNN +F 3 "" H 10450 5650 50 0001 C CNN + 1 10450 5650 + 1 0 0 -1 +$EndComp +$Comp +L Device:C C13 +U 1 1 606F8D66 +P 8900 5950 +F 0 "C13" H 9015 5996 50 0000 L CNN +F 1 "100nF" H 9015 5905 50 0000 L CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 8938 5800 50 0001 C CNN +F 3 "~" H 8900 5950 50 0001 C CNN + 1 8900 5950 + -1 0 0 1 +$EndComp +$Comp +L Device:C C16 +U 1 1 606F9863 +P 10850 5950 +F 0 "C16" H 10965 5996 50 0000 L CNN +F 1 "100nF" H 10965 5905 50 0000 L CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 10888 5800 50 0001 C CNN +F 3 "~" H 10850 5950 50 0001 C CNN + 1 10850 5950 + 1 0 0 -1 +$EndComp +Wire Wire Line + 9400 5700 9150 5700 +Wire Wire Line + 9150 5700 9150 5650 +Wire Wire Line + 9150 5700 8900 5700 +Wire Wire Line + 8900 5700 8900 5800 +Connection ~ 9150 5700 +Wire Wire Line + 9150 5800 9150 5700 +Wire Wire Line + 8900 6100 8900 6150 +Wire Wire Line + 8900 6150 9150 6150 +Wire Wire Line + 9150 6100 9150 6150 +Connection ~ 9150 6150 +Wire Wire Line + 9700 6150 9700 6000 +Wire Wire Line + 10450 6150 10450 6100 +Wire Wire Line + 10850 6100 10850 6150 +Wire Wire Line + 10850 6150 10450 6150 +Connection ~ 10450 6150 +Wire Wire Line + 10850 5800 10850 5700 +Wire Wire Line + 10850 5700 10450 5700 +Wire Wire Line + 10450 5650 10450 5700 +Connection ~ 10450 5700 +Wire Wire Line + 10450 5700 10000 5700 +Wire Wire Line + 10450 5700 10450 5800 +Wire Wire Line + 10600 3100 10400 3100 +Wire Wire Line + 10400 3100 10400 3450 +Wire Wire Line + 10600 2850 10400 2850 +Wire Wire Line + 10400 2850 10400 2000 +$Comp +L Device:R_Potentiometer_Trim RV1 +U 1 1 6082A9DC +P 5550 7050 +F 0 "RV1" H 5480 7096 50 0000 R CNN +F 1 "10K_TRIM" H 5480 7005 50 0000 R CNN +F 2 "Potentiometer_SMD:Potentiometer_Bourns_3214G_Horizontal" H 5550 7050 50 0001 C CNN +F 3 "~" H 5550 7050 50 0001 C CNN +F 4 "farnell" H 5550 7050 50 0001 C CNN "supplier" +F 5 "1689863RL" H 5550 7050 50 0001 C CNN "ordercode" + 1 5550 7050 + -1 0 0 -1 +$EndComp +$Comp +L Device:R R16 +U 1 1 6083CB22 +P 5550 6700 +F 0 "R16" H 5620 6746 50 0000 L CNN +F 1 "91K" H 5620 6655 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 5480 6700 50 0001 C CNN +F 3 "~" H 5550 6700 50 0001 C CNN +F 4 "farnell" H 5550 6700 50 0001 C CNN "supplier" +F 5 "2447449" H 5550 6700 50 0001 C CNN "ordercode" + 1 5550 6700 + 1 0 0 -1 +$EndComp +$Comp +L power:+5V #PWR04 +U 1 1 6083D919 +P 5550 6500 +F 0 "#PWR04" H 5550 6350 50 0001 C CNN +F 1 "+5V" H 5565 6673 50 0000 C CNN +F 2 "" H 5550 6500 50 0001 C CNN +F 3 "" H 5550 6500 50 0001 C CNN + 1 5550 6500 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR05 +U 1 1 6083DE51 +P 5550 7450 +F 0 "#PWR05" H 5550 7200 50 0001 C CNN +F 1 "GND" H 5555 7277 50 0000 C CNN +F 2 "" H 5550 7450 50 0001 C CNN +F 3 "" H 5550 7450 50 0001 C CNN + 1 5550 7450 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5550 6550 5550 6500 +$Comp +L Jumper:SolderJumper_2_Open JP1 +U 1 1 6087C975 +P 5000 6900 +F 0 "JP1" H 5000 7105 50 0000 C CNN +F 1 "SJ2_Open" H 5000 7014 50 0000 C CNN +F 2 "Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm" H 5000 6900 50 0001 C CNN +F 3 "~" H 5000 6900 50 0001 C CNN +F 4 "DNP" H 5000 6900 50 0001 C CNN "DNP" + 1 5000 6900 + 1 0 0 -1 +$EndComp +$Comp +L Device:C C3 +U 1 1 6088EC87 +P 4800 7250 +F 0 "C3" H 4915 7296 50 0000 L CNN +F 1 "100nF" H 4915 7205 50 0000 L CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 4838 7100 50 0001 C CNN +F 3 "~" H 4800 7250 50 0001 C CNN +F 4 "DNP" H 5000 7350 50 0000 C CNN "DNP" + 1 4800 7250 + -1 0 0 -1 +$EndComp +Wire Wire Line + 5250 7050 5400 7050 +Connection ~ 5250 7050 +Wire Wire Line + 5250 6900 5150 6900 +Wire Wire Line + 5250 6900 5250 7050 +Wire Wire Line + 4850 6900 4800 6900 +Wire Wire Line + 4800 6900 4800 7100 +$Comp +L power:GND #PWR01 +U 1 1 6093CBDE +P 4800 7450 +F 0 "#PWR01" H 4800 7200 50 0001 C CNN +F 1 "GND" H 4805 7277 50 0000 C CNN +F 2 "" H 4800 7450 50 0001 C CNN +F 3 "" H 4800 7450 50 0001 C CNN + 1 4800 7450 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4800 7450 4800 7400 +Text GLabel 4750 6900 0 50 Input ~ 0 +CPU_REF +Wire Wire Line + 4750 6900 4800 6900 +Connection ~ 4800 6900 +Wire Wire Line + 5550 6850 5550 6900 +Wire Wire Line + 5550 7200 5550 7450 +$Comp +L Device:R R14 +U 1 1 60ABCE88 +P 5250 6700 +F 0 "R14" H 5320 6746 50 0000 L CNN +F 1 "10K" H 5320 6655 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 5180 6700 50 0001 C CNN +F 3 "~" H 5250 6700 50 0001 C CNN +F 4 "DNP" V 5250 6700 50 0000 C CNN "DNP" + 1 5250 6700 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR03 +U 1 1 60ACDB0F +P 5250 7450 +F 0 "#PWR03" H 5250 7200 50 0001 C CNN +F 1 "GND" H 5255 7277 50 0000 C CNN +F 2 "" H 5250 7450 50 0001 C CNN +F 3 "" H 5250 7450 50 0001 C CNN + 1 5250 7450 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5250 7450 5250 7400 +Wire Wire Line + 5250 7050 5250 7100 +Wire Wire Line + 5250 6850 5250 6900 +Connection ~ 5250 6900 +$Comp +L power:+5V #PWR02 +U 1 1 60B20857 +P 5250 6500 +F 0 "#PWR02" H 5250 6350 50 0001 C CNN +F 1 "+5V" H 5265 6673 50 0000 C CNN +F 2 "" H 5250 6500 50 0001 C CNN +F 3 "" H 5250 6500 50 0001 C CNN + 1 5250 6500 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5250 6500 5250 6550 +$Comp +L clockclock-rescue:ESP32-WROOM-32-dk_RF-Transceiver-Modules MOD1 +U 1 1 60F96149 +P 5250 3750 +F 0 "MOD1" H 5900 3800 60 0000 C CNN +F 1 "ESP32-WROOM-32D" H 6100 1650 60 0000 C CNN +F 2 "digikey-footprints:ESP32-WROOM-32D" H 5450 3950 60 0001 L CNN +F 3 "https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf" H 5450 4050 60 0001 L CNN +F 4 "1904-1010-1-ND" H 5450 4150 60 0001 L CNN "Digi-Key_PN" +F 5 "ESP32-WROOM-32" H 5450 4250 60 0001 L CNN "MPN" +F 6 "RF/IF and RFID" H 5450 4350 60 0001 L CNN "Category" +F 7 "RF Transceiver Modules" H 5450 4450 60 0001 L CNN "Family" +F 8 "https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf" H 5450 4550 60 0001 L CNN "DK_Datasheet_Link" +F 9 "/product-detail/en/espressif-systems/ESP32-WROOM-32/1904-1010-1-ND/8544305" H 5450 4650 60 0001 L CNN "DK_Detail_Page" +F 10 "SMD MODULE, ESP32-D0WDQ6, 32MBIT" H 5450 4750 60 0001 L CNN "Description" +F 11 "Espressif Systems" H 5450 4850 60 0001 L CNN "Manufacturer" +F 12 "Active" H 5450 4950 60 0001 L CNN "Status" +F 13 "aliexpress" H 5250 3750 50 0001 C CNN "supplier" + 1 5250 3750 + 1 0 0 -1 +$EndComp +Text Label 4300 5450 0 50 ~ 0 +CPU_REF +Wire Wire Line + 4300 5450 4750 5450 +Text Label 4300 4150 0 50 ~ 0 +MOT_DIR0 +Text Label 4300 4250 0 50 ~ 0 +MOT_STCK0 +Text Label 4300 4450 0 50 ~ 0 +MOT_EN +Text Label 4300 4550 0 50 ~ 0 +MOT_RST0 +Text Label 4300 4750 0 50 ~ 0 +MOT_DIR1 +Text Label 4300 4850 0 50 ~ 0 +MOT_STCK1 +Text Label 4300 4950 0 50 ~ 0 +MOT_RST1 +$Comp +L Transistor_BJT:UMH3N Q1 +U 1 1 6105C9A4 +P 1150 800 +F 0 "Q1" H 1440 846 50 0000 L CNN +F 1 "UMH3N" H 1440 755 50 0000 L CNN +F 2 "Package_TO_SOT_SMD:SOT-363_SC-70-6" H 1155 360 50 0001 C CNN +F 3 "http://rohmfs.rohm.com/en/products/databook/datasheet/discrete/transistor/digital/emh3t2r-e.pdf" H 1300 800 50 0001 C CNN +F 4 "1680404" H 1150 800 50 0001 C CNN "ordercode" +F 5 "farnell" H 1150 800 50 0001 C CNN "supplier" + 1 1150 800 + 1 0 0 -1 +$EndComp +$Comp +L Transistor_BJT:UMH3N Q1 +U 2 1 6105D826 +P 1150 1350 +F 0 "Q1" H 1440 1304 50 0000 L CNN +F 1 "UMH3N" H 1440 1395 50 0000 L CNN +F 2 "Package_TO_SOT_SMD:SOT-363_SC-70-6" H 1155 910 50 0001 C CNN +F 3 "http://rohmfs.rohm.com/en/products/databook/datasheet/discrete/transistor/digital/emh3t2r-e.pdf" H 1300 1350 50 0001 C CNN +F 4 "1680404" H 1150 1350 50 0001 C CNN "ordercode" +F 5 "farnell" H 1150 1350 50 0001 C CNN "supplier" + 2 1150 1350 + 1 0 0 1 +$EndComp +Text Label 700 800 2 50 ~ 0 +DTR +Text Label 700 1350 2 50 ~ 0 +RTS +Text Label 1700 600 2 50 ~ 0 +ESP_RST +Text Label 1850 1550 2 50 ~ 0 +ESP_GPIO0 +Wire Wire Line + 700 800 750 800 +Wire Wire Line + 950 1350 750 1350 +Wire Wire Line + 1350 1000 1350 1050 +Wire Wire Line + 1350 1050 750 1250 +Wire Wire Line + 750 1250 750 1350 +Connection ~ 750 1350 +Wire Wire Line + 750 1350 700 1350 +Wire Wire Line + 1350 1150 1350 1100 +Wire Wire Line + 1350 1100 750 900 +Wire Wire Line + 750 900 750 800 +Connection ~ 750 800 +Wire Wire Line + 750 800 950 800 +Wire Wire Line + 1700 600 1350 600 +Wire Wire Line + 1850 1550 1350 1550 +$Comp +L power:GND #PWR0112 +U 1 1 6116E33E +P 5250 5950 +F 0 "#PWR0112" H 5250 5700 50 0001 C CNN +F 1 "GND" H 5255 5777 50 0000 C CNN +F 2 "" H 5250 5950 50 0001 C CNN +F 3 "" H 5250 5950 50 0001 C CNN + 1 5250 5950 + 1 0 0 -1 +$EndComp +$Comp +L power:+3V3 #PWR0113 +U 1 1 6116E5F8 +P 5450 3550 +F 0 "#PWR0113" H 5450 3400 50 0001 C CNN +F 1 "+3V3" H 5465 3723 50 0000 C CNN +F 2 "" H 5450 3550 50 0001 C CNN +F 3 "" H 5450 3550 50 0001 C CNN + 1 5450 3550 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5450 3550 5450 3650 +Wire Wire Line + 5250 5950 5250 5900 +Wire Wire Line + 5250 5900 5350 5900 +Wire Wire Line + 5350 5900 5350 5850 +Connection ~ 5250 5900 +Wire Wire Line + 5250 5900 5250 5850 +Wire Wire Line + 5350 5900 5450 5900 +Wire Wire Line + 5550 5900 5550 5850 +Connection ~ 5350 5900 +Wire Wire Line + 5450 5850 5450 5900 +Connection ~ 5450 5900 +Wire Wire Line + 5450 5900 5550 5900 +Text Label 6500 5150 2 50 ~ 0 +ADDR0 +Text Label 6500 5250 2 50 ~ 0 +ADDR1 +Text Label 6500 4950 2 50 ~ 0 +ADDR2 +Text Label 6500 5050 2 50 ~ 0 +ADDR3 +Text Label 4300 5050 0 50 ~ 0 +BUT_MIN +Text Label 4300 5350 0 50 ~ 0 +BUT_PLUS +Text Label 4300 5150 0 50 ~ 0 +I2C_SDA +Text Label 4300 5250 0 50 ~ 0 +I2C_SCL +Text Label 4300 3950 0 50 ~ 0 +ESP_GPIO0 +Wire Wire Line + 4300 3950 4750 3950 +Text Label 4300 3850 0 50 ~ 0 +ESP_RST +$Comp +L Device:R R9 +U 1 1 61211336 +P 3400 900 +F 0 "R9" V 3500 950 50 0000 L CNN +F 1 "10K" V 3500 750 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 900 50 0001 C CNN +F 3 "~" H 3400 900 50 0001 C CNN +F 4 "" V 3400 900 50 0000 C CNN "DNP" + 1 3400 900 + 0 -1 -1 0 +$EndComp +$Comp +L power:+3V3 #PWR0114 +U 1 1 61212780 +P 3200 750 +F 0 "#PWR0114" H 3200 600 50 0001 C CNN +F 1 "+3V3" H 3215 923 50 0000 C CNN +F 2 "" H 3200 750 50 0001 C CNN +F 3 "" H 3200 750 50 0001 C CNN + 1 3200 750 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3200 750 3200 900 +Wire Wire Line + 3200 900 3250 900 +Text Label 4000 900 2 50 ~ 0 +ESP_GPIO0 +Wire Wire Line + 4000 900 3550 900 +Text Label 4300 4350 0 50 ~ 0 +ESP_GPIO12 +Text Label 4300 4650 0 50 ~ 0 +ESP_GPIO15 +Wire Wire Line + 4750 4350 4300 4350 +Wire Wire Line + 4750 4650 4300 4650 +$Comp +L Device:C C4 +U 1 1 61163D10 +P 4300 1650 +F 0 "C4" H 4186 1604 50 0000 R CNN +F 1 "100nF" H 4186 1695 50 0000 R CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 4338 1500 50 0001 C CNN +F 3 "~" H 4300 1650 50 0001 C CNN + 1 4300 1650 + -1 0 0 1 +$EndComp +$Comp +L Device:R R12 +U 1 1 6125CD15 +P 3400 1100 +F 0 "R12" V 3500 1150 50 0000 L CNN +F 1 "10K" V 3500 950 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 1100 50 0001 C CNN +F 3 "~" H 3400 1100 50 0001 C CNN +F 4 "DNP" V 3400 1100 50 0000 C CNN "DNP" + 1 3400 1100 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 3250 1100 3200 1100 +Wire Wire Line + 3200 1100 3200 900 +Connection ~ 3200 900 +Text Label 4050 1100 2 50 ~ 0 +ESP_GPIO15 +Text Label 4000 1700 2 50 ~ 0 +ESP_GPIO12 +$Comp +L Device:R R18 +U 1 1 6128DF59 +P 3400 1700 +F 0 "R18" V 3500 1750 50 0000 L CNN +F 1 "10K" V 3500 1550 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 1700 50 0001 C CNN +F 3 "~" H 3400 1700 50 0001 C CNN +F 4 "DNP" V 3400 1700 50 0000 C CNN "DNP" + 1 3400 1700 + 0 -1 -1 0 +$EndComp +$Comp +L power:GND #PWR0115 +U 1 1 6128E5FA +P 3200 2150 +F 0 "#PWR0115" H 3200 1900 50 0001 C CNN +F 1 "GND" H 3205 1977 50 0000 C CNN +F 2 "" H 3200 2150 50 0001 C CNN +F 3 "" H 3200 2150 50 0001 C CNN + 1 3200 2150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3200 2150 3200 2100 +Wire Wire Line + 3200 1700 3250 1700 +Wire Wire Line + 3550 1700 4000 1700 +Text Label 4300 4050 0 50 ~ 0 +ESP_GPIO2 +Wire Wire Line + 4750 4050 4300 4050 +Text Label 4000 1900 2 50 ~ 0 +ESP_GPIO2 +$Comp +L Device:R R19 +U 1 1 612F7ED4 +P 3400 1900 +F 0 "R19" V 3500 1950 50 0000 L CNN +F 1 "10K" V 3500 1750 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 1900 50 0001 C CNN +F 3 "~" H 3400 1900 50 0001 C CNN +F 4 "DNP" V 3400 1900 50 0000 C CNN "DNP" + 1 3400 1900 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 4000 1900 3550 1900 +Wire Wire Line + 3250 1900 3200 1900 +Connection ~ 3200 1900 +Wire Wire Line + 3200 1900 3200 1700 +Wire Wire Line + 6500 4950 6150 4950 +Wire Wire Line + 6500 5050 6150 5050 +Wire Wire Line + 6500 5150 6150 5150 +Wire Wire Line + 6500 5250 6150 5250 +Text Notes 3250 -250 2 50 ~ 0 +https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection +Wire Wire Line + 4300 5250 4750 5250 +Wire Wire Line + 4750 5150 4300 5150 +Text Label 6500 4750 2 50 ~ 0 +ESP_RX +Text Label 6500 4650 2 50 ~ 0 +ESP_TX +Wire Wire Line + 6500 4650 6150 4650 +Wire Wire Line + 6500 4750 6150 4750 +Text Label 7950 4050 0 50 ~ 0 +MOT_EN +Wire Wire Line + 7950 4050 8450 4050 +Wire Wire Line + 7950 2000 8450 2000 +$Comp +L Jumper:SolderJumper_3_Open JP5 +U 1 1 614F3FB7 +P 7600 1200 +F 0 "JP5" V 7646 1267 50 0000 L CNN +F 1 "SJ3_Open" V 7555 1267 50 0000 L CNN +F 2 "Jumper:SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels" H 7600 1200 50 0001 C CNN +F 3 "~" H 7600 1200 50 0001 C CNN +F 4 "DNP" H 7600 1200 50 0001 C CNN "DNP" + 1 7600 1200 + 0 -1 -1 0 +$EndComp +$Comp +L power:GND #PWR0116 +U 1 1 614F5C4F +P 7600 1450 +F 0 "#PWR0116" H 7600 1200 50 0001 C CNN +F 1 "GND" H 7605 1277 50 0000 C CNN +F 2 "" H 7600 1450 50 0001 C CNN +F 3 "" H 7600 1450 50 0001 C CNN + 1 7600 1450 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7600 1450 7600 1400 +$Comp +L power:+5V #PWR0117 +U 1 1 61504424 +P 7600 950 +F 0 "#PWR0117" H 7600 800 50 0001 C CNN +F 1 "+5V" H 7615 1123 50 0000 C CNN +F 2 "" H 7600 950 50 0001 C CNN +F 3 "" H 7600 950 50 0001 C CNN + 1 7600 950 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7600 950 7600 1000 +Text Label 7950 1700 0 50 ~ 0 +MOT0_MODE1 +Text Label 7950 1800 0 50 ~ 0 +MOT0_MODE2 +$Comp +L Jumper:SolderJumper_3_Open JP4 +U 1 1 6156DB0E +P 7500 2200 +F 0 "JP4" V 7546 2267 50 0000 L CNN +F 1 "SJ3_Open" V 7455 2267 50 0000 L CNN +F 2 "Jumper:SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels" H 7500 2200 50 0001 C CNN +F 3 "~" H 7500 2200 50 0001 C CNN +F 4 "DNP" H 7500 2200 50 0001 C CNN "DNP" + 1 7500 2200 + 0 -1 -1 0 +$EndComp +$Comp +L power:GND #PWR0118 +U 1 1 6156DB18 +P 7500 2700 +F 0 "#PWR0118" H 7500 2450 50 0001 C CNN +F 1 "GND" H 7505 2527 50 0000 C CNN +F 2 "" H 7500 2700 50 0001 C CNN +F 3 "" H 7500 2700 50 0001 C CNN + 1 7500 2700 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7500 2700 7500 2400 +$Comp +L power:+5V #PWR0119 +U 1 1 6156DB23 +P 7500 1950 +F 0 "#PWR0119" H 7500 1800 50 0001 C CNN +F 1 "+5V" H 7515 2123 50 0000 C CNN +F 2 "" H 7500 1950 50 0001 C CNN +F 3 "" H 7500 1950 50 0001 C CNN + 1 7500 1950 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7500 1950 7500 2000 +$Comp +L Jumper:SolderJumper_3_Open JP3 +U 1 1 615FB4F8 +P 7450 3500 +F 0 "JP3" V 7496 3567 50 0000 L CNN +F 1 "SJ3_Open" V 7405 3567 50 0000 L CNN +F 2 "Jumper:SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels" H 7450 3500 50 0001 C CNN +F 3 "~" H 7450 3500 50 0001 C CNN +F 4 "DNP" H 7450 3500 50 0001 C CNN "DNP" + 1 7450 3500 + 0 -1 -1 0 +$EndComp +$Comp +L power:GND #PWR0120 +U 1 1 615FB502 +P 7450 3700 +F 0 "#PWR0120" H 7450 3450 50 0001 C CNN +F 1 "GND" H 7455 3527 50 0000 C CNN +F 2 "" H 7450 3700 50 0001 C CNN +F 3 "" H 7450 3700 50 0001 C CNN + 1 7450 3700 + 1 0 0 -1 +$EndComp +$Comp +L power:+5V #PWR0121 +U 1 1 615FB50D +P 7450 3250 +F 0 "#PWR0121" H 7450 3100 50 0001 C CNN +F 1 "+5V" H 7465 3423 50 0000 C CNN +F 2 "" H 7450 3250 50 0001 C CNN +F 3 "" H 7450 3250 50 0001 C CNN + 1 7450 3250 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7450 3250 7450 3300 +$Comp +L Jumper:SolderJumper_3_Open JP2 +U 1 1 615FB518 +P 7400 4400 +F 0 "JP2" V 7446 4467 50 0000 L CNN +F 1 "SJ3_Open" V 7355 4467 50 0000 L CNN +F 2 "Jumper:SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels" H 7400 4400 50 0001 C CNN +F 3 "~" H 7400 4400 50 0001 C CNN +F 4 "DNP" H 7400 4400 50 0001 C CNN "DNP" + 1 7400 4400 + 0 -1 -1 0 +$EndComp +$Comp +L power:GND #PWR0122 +U 1 1 615FB522 +P 7400 4800 +F 0 "#PWR0122" H 7400 4550 50 0001 C CNN +F 1 "GND" H 7405 4627 50 0000 C CNN +F 2 "" H 7400 4800 50 0001 C CNN +F 3 "" H 7400 4800 50 0001 C CNN + 1 7400 4800 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7400 4800 7400 4600 +$Comp +L power:+5V #PWR0124 +U 1 1 615FB52D +P 7400 4150 +F 0 "#PWR0124" H 7400 4000 50 0001 C CNN +F 1 "+5V" H 7415 4323 50 0000 C CNN +F 2 "" H 7400 4150 50 0001 C CNN +F 3 "" H 7400 4150 50 0001 C CNN + 1 7400 4150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7400 4150 7400 4200 +Wire Wire Line + 7800 1700 7800 1200 +Wire Wire Line + 7800 1200 7750 1200 +Wire Wire Line + 7800 1700 8450 1700 +Wire Wire Line + 7800 1800 7800 2200 +Wire Wire Line + 7800 2200 7650 2200 +Wire Wire Line + 7800 1800 8450 1800 +Wire Wire Line + 7800 3750 7800 3500 +Wire Wire Line + 7800 3500 7600 3500 +Wire Wire Line + 7800 3750 8450 3750 +Wire Wire Line + 7700 3850 7700 4400 +Wire Wire Line + 7700 4400 7550 4400 +Wire Wire Line + 7700 3850 8450 3850 +Wire Wire Line + 7650 4700 7600 4700 +Text Label 7950 2300 0 50 ~ 0 +MOT_REF +Wire Wire Line + 7950 2300 8450 2300 +Text Label 7950 4350 0 50 ~ 0 +MOT_REF +Wire Wire Line + 7950 4350 8450 4350 +Text Label 4850 7050 0 50 ~ 0 +MOT_REF +Wire Wire Line + 4850 7050 5250 7050 +$Comp +L Device:R R15 +U 1 1 60B53DC0 +P 5250 7250 +F 0 "R15" H 5320 7296 50 0000 L CNN +F 1 "10K" H 5320 7205 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 5180 7250 50 0001 C CNN +F 3 "~" H 5250 7250 50 0001 C CNN +F 4 "DNP" V 5250 7250 50 0000 C CNN "DNP" + 1 5250 7250 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4300 4250 4750 4250 +Wire Wire Line + 4750 4150 4300 4150 +Wire Wire Line + 4300 4450 4750 4450 +Wire Wire Line + 4300 4550 4750 4550 +Wire Wire Line + 4750 4750 4300 4750 +Wire Wire Line + 4750 4850 4300 4850 +Wire Wire Line + 4300 4950 4750 4950 +Wire Wire Line + 4300 5050 4750 5050 +Wire Wire Line + 4750 5350 4300 5350 +Wire Wire Line + 4400 6200 4400 6400 +Wire Wire Line + 4250 6200 4400 6200 +Wire Wire Line + 4250 6400 4400 6400 +Connection ~ 4400 6400 +Wire Wire Line + 4400 6400 4400 6450 +Text Label 4000 1300 2 50 ~ 0 +ESP_RST +$Comp +L Device:R R13 +U 1 1 61D1D755 +P 3400 1300 +F 0 "R13" V 3500 1350 50 0000 L CNN +F 1 "10K" V 3500 1150 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 1300 50 0001 C CNN +F 3 "~" H 3400 1300 50 0001 C CNN +F 4 "" V 3400 1300 50 0000 C CNN "DNP" + 1 3400 1300 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 3250 1300 3200 1300 +Wire Wire Line + 3200 1300 3200 1100 +Connection ~ 3200 1100 +Wire Wire Line + 4300 1300 4300 1500 +Wire Wire Line + 3550 1300 4300 1300 +$Comp +L power:GND #PWR0126 +U 1 1 61D54274 +P 4300 2000 +F 0 "#PWR0126" H 4300 1750 50 0001 C CNN +F 1 "GND" H 4305 1827 50 0000 C CNN +F 2 "" H 4300 2000 50 0001 C CNN +F 3 "" H 4300 2000 50 0001 C CNN + 1 4300 2000 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4300 2000 4300 1800 +Wire Wire Line + 4750 3850 4300 3850 +Text Label 3100 2750 2 50 ~ 0 +ESP_TX +Text Label 3100 2650 2 50 ~ 0 +ESP_RX +Text Label 3100 2850 2 50 ~ 0 +RTS +Text Label 3100 3150 2 50 ~ 0 +DTR +$Comp +L Connector:USB_B_Micro J2 +U 1 1 61DB3246 +P 850 3250 +F 0 "J2" H 907 3717 50 0000 C CNN +F 1 "USB_B_Micro" H 907 3626 50 0000 C CNN +F 2 "Connector_USB:USB_Micro-B_Molex-105133-0031" H 1000 3200 50 0001 C CNN +F 3 "~" H 1000 3200 50 0001 C CNN +F 4 "farnell" H 850 3250 50 0001 C CNN "supplier" +F 5 "3499363" H 850 3250 50 0001 C CNN "ordercode" + 1 850 3250 + 1 0 0 -1 +$EndComp +Text Label 10050 4050 0 50 ~ 0 +MOT_B4 +Text Label 10050 3950 0 50 ~ 0 +MOT_B3 +Text Label 10050 3550 0 50 ~ 0 +MOT_B2 +Text Label 10050 3450 0 50 ~ 0 +MOT_B1 +Text Label 7950 1400 0 50 ~ 0 +MOT_DIR0 +Text Label 7950 1500 0 50 ~ 0 +MOT_STCK0 +Wire Wire Line + 7950 1400 8450 1400 +Text Label 7950 2000 0 50 ~ 0 +MOT_EN +Text Label 7950 2100 0 50 ~ 0 +MOT_RST0 +Wire Wire Line + 8450 2400 8400 2400 +Connection ~ 8400 2400 +Wire Wire Line + 7650 2650 7650 2700 +Connection ~ 7650 2650 +Text Label 7950 3450 0 50 ~ 0 +MOT_DIR1 +Text Label 7950 3550 0 50 ~ 0 +MOT_STCK1 +Text Label 7950 3750 0 50 ~ 0 +MOT1_MODE1 +Text Label 7950 3850 0 50 ~ 0 +MOT1_MODE2 +Text Label 7950 4150 0 50 ~ 0 +MOT_RST1 +Wire Wire Line + 8350 4450 8450 4450 +Connection ~ 8350 4450 +Wire Wire Line + 7600 4800 7600 4700 +Connection ~ 7600 4700 +Wire Wire Line + 7600 4450 7600 4700 +Wire Wire Line + 3100 2650 2750 2650 +Wire Wire Line + 3100 2750 2750 2750 +Wire Wire Line + 3100 2850 2750 2850 +Wire Wire Line + 3100 3150 2750 3150 +Text Label 3200 3650 2 50 ~ 0 +USB_SUSP +Wire Wire Line + 3200 3650 2750 3650 +Text Label 4000 2100 2 50 ~ 0 +USB_SUSP +$Comp +L Device:R R20 +U 1 1 626BC221 +P 3400 2100 +F 0 "R20" V 3500 2150 50 0000 L CNN +F 1 "10K" V 3500 1950 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 2100 50 0001 C CNN +F 3 "~" H 3400 2100 50 0001 C CNN +F 4 "" V 3400 2100 50 0000 C CNN "DNP" + 1 3400 2100 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 4000 2100 3550 2100 +Wire Wire Line + 3250 2100 3200 2100 +Connection ~ 3200 2100 +Wire Wire Line + 3200 2100 3200 1900 +$Comp +L power:+3V3 #PWR0127 +U 1 1 626F270D +P 2250 2350 +F 0 "#PWR0127" H 2250 2200 50 0001 C CNN +F 1 "+3V3" H 2265 2523 50 0000 C CNN +F 2 "" H 2250 2350 50 0001 C CNN +F 3 "" H 2250 2350 50 0001 C CNN + 1 2250 2350 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2250 2350 2250 2450 +$Comp +L Diode:BAV70 D1 +U 1 1 627088D2 +P 1250 2400 +F 0 "D1" V 1296 2479 50 0000 L CNN +F 1 "BAV70" V 1205 2479 50 0000 L CNN +F 2 "Package_TO_SOT_SMD:SOT-23" H 1250 2400 50 0001 C CNN +F 3 "https://assets.nexperia.com/documents/data-sheet/BAV70_SER.pdf" H 1250 2400 50 0001 C CNN +F 4 "2677467" H 1250 2400 50 0001 C CNN "ordercode" +F 5 "farnell" H 1250 2400 50 0001 C CNN "supplier" + 1 1250 2400 + 0 -1 1 0 +$EndComp +Wire Wire Line + 1150 3050 1250 3050 +Wire Wire Line + 1250 3050 1250 2700 +Wire Wire Line + 1250 3050 1450 3050 +Wire Wire Line + 1450 3050 1450 3150 +Wire Wire Line + 1450 3150 1750 3150 +Connection ~ 1250 3050 +Wire Wire Line + 1450 2400 1600 2400 +Wire Wire Line + 2150 2400 2150 2450 +Text Label 1250 3250 2 50 ~ 0 +D+ +Text Label 1250 3350 2 50 ~ 0 +D- +Wire Wire Line + 1250 3250 1150 3250 +Wire Wire Line + 1250 3350 1150 3350 +Text Label 1600 3250 2 50 ~ 0 +D- +Text Label 1600 3350 2 50 ~ 0 +D+ +Wire Wire Line + 1600 3350 1750 3350 +Wire Wire Line + 1750 3250 1600 3250 +$Comp +L power:GND #PWR0128 +U 1 1 62A74288 +P 850 3750 +F 0 "#PWR0128" H 850 3500 50 0001 C CNN +F 1 "GND" H 855 3577 50 0000 C CNN +F 2 "" H 850 3750 50 0001 C CNN +F 3 "" H 850 3750 50 0001 C CNN + 1 850 3750 + 1 0 0 -1 +$EndComp +Wire Wire Line + 850 3750 850 3700 +Wire Wire Line + 850 3700 750 3700 +Wire Wire Line + 750 3700 750 3650 +Connection ~ 850 3700 +Wire Wire Line + 850 3700 850 3650 +Wire Wire Line + 1150 3450 1250 3450 +Wire Wire Line + 1250 3450 1250 3700 +Wire Wire Line + 1250 3700 850 3700 +Text Label 1400 2650 0 50 ~ 0 +USB_RST +Wire Wire Line + 1400 2650 1750 2650 +Text Label 4000 1500 2 50 ~ 0 +USB_RST +$Comp +L Device:R R17 +U 1 1 62BFAD12 +P 3400 1500 +F 0 "R17" V 3500 1550 50 0000 L CNN +F 1 "10K" V 3500 1350 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 3330 1500 50 0001 C CNN +F 3 "~" H 3400 1500 50 0001 C CNN +F 4 "" V 3400 1500 50 0000 C CNN "DNP" + 1 3400 1500 + 0 1 -1 0 +$EndComp +Wire Wire Line + 3250 1500 3200 1500 +Wire Wire Line + 3200 1500 3200 1300 +Connection ~ 3200 1300 +Wire Wire Line + 4000 1500 3550 1500 +Wire Wire Line + 3550 1100 4050 1100 +$Comp +L power:GND #PWR0129 +U 1 1 62E99E44 +P 2050 4050 +F 0 "#PWR0129" H 2050 3800 50 0001 C CNN +F 1 "GND" H 2055 3877 50 0000 C CNN +F 2 "" H 2050 4050 50 0001 C CNN +F 3 "" H 2050 4050 50 0001 C CNN + 1 2050 4050 + 1 0 0 -1 +$EndComp +$Comp +L clockclock-rescue:CP2102-Axx-xQFN28-Interface_USB U4 +U 1 1 62EBBEA3 +P 2250 3750 +F 0 "U4" H 2600 5050 50 0000 C CNN +F 1 "CP2109-Axx-xQFN28" H 2800 3600 50 0000 C CNN +F 2 "Package_DFN_QFN:QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mm" H 2750 3000 50 0001 C CNN +F 3 "https://www.silabs.com/documents/public/data-sheets/CP2102-9.pdf" H 2300 3000 50 0001 C CNN +F 4 "2930584" H 2250 3750 50 0001 C CNN "ordercode" +F 5 "farnell" H 2250 3750 50 0001 C CNN "supplier" + 1 2250 3750 + 1 0 0 -1 +$EndComp +NoConn ~ 2750 2950 +NoConn ~ 2750 3050 +NoConn ~ 2750 3350 +NoConn ~ 2750 3250 +NoConn ~ 6150 3950 +NoConn ~ 6150 4050 +NoConn ~ 6150 4150 +NoConn ~ 6150 4250 +NoConn ~ 6150 4350 +NoConn ~ 6150 4450 +NoConn ~ 6150 4550 +Wire Wire Line + 2050 3950 2050 4000 +Wire Wire Line + 2200 3950 2200 4000 +Wire Wire Line + 2200 4000 2050 4000 +Connection ~ 2050 4000 +Wire Wire Line + 2050 4000 2050 4050 +NoConn ~ 2750 3550 +$Comp +L LED:SK6812MINI D2 +U 1 1 609A6CE9 +P 1250 4900 +F 0 "D2" H 1350 5150 50 0000 L CNN +F 1 "SK6812MINI" H 1300 4650 50 0000 L CNN +F 2 "LED_SMD:LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm" H 1300 4600 50 0001 L TNN +F 3 "https://cdn-shop.adafruit.com/product-files/2686/SK6812MINI_REV.01-1-2.pdf" H 1350 4525 50 0001 L TNN +F 4 "aliexpress" H 1250 4900 50 0001 C CNN "supplier" + 1 1250 4900 + 1 0 0 -1 +$EndComp +Text Label 500 4900 0 50 ~ 0 +LED_DATA +Wire Wire Line + 500 4900 950 4900 +$Comp +L power:GND #PWR0123 +U 1 1 60A1C5FD +P 1250 5250 +F 0 "#PWR0123" H 1250 5000 50 0001 C CNN +F 1 "GND" H 1255 5077 50 0000 C CNN +F 2 "" H 1250 5250 50 0001 C CNN +F 3 "" H 1250 5250 50 0001 C CNN + 1 1250 5250 + 1 0 0 -1 +$EndComp +Wire Wire Line + 1250 5250 1250 5200 +$Comp +L power:+5V #PWR0125 +U 1 1 60A34487 +P 1250 4550 +F 0 "#PWR0125" H 1250 4400 50 0001 C CNN +F 1 "+5V" H 1265 4723 50 0000 C CNN +F 2 "" H 1250 4550 50 0001 C CNN +F 3 "" H 1250 4550 50 0001 C CNN + 1 1250 4550 + 1 0 0 -1 +$EndComp +Wire Wire Line + 1250 4550 1250 4600 +$Comp +L LED:SK6812MINI D3 +U 1 1 60A4E4E4 +P 1900 4900 +F 0 "D3" H 2000 5150 50 0000 L CNN +F 1 "SK6812MINI" H 1950 4650 50 0000 L CNN +F 2 "LED_SMD:LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm" H 1950 4600 50 0001 L TNN +F 3 "https://cdn-shop.adafruit.com/product-files/2686/SK6812MINI_REV.01-1-2.pdf" H 2000 4525 50 0001 L TNN +F 4 "aliexpress" H 1900 4900 50 0001 C CNN "supplier" + 1 1900 4900 + 1 0 0 -1 +$EndComp +$Comp +L LED:SK6812MINI D4 +U 1 1 60A4EC1E +P 2550 4900 +F 0 "D4" H 2650 5150 50 0000 L CNN +F 1 "SK6812MINI" H 2600 4650 50 0000 L CNN +F 2 "LED_SMD:LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm" H 2600 4600 50 0001 L TNN +F 3 "https://cdn-shop.adafruit.com/product-files/2686/SK6812MINI_REV.01-1-2.pdf" H 2650 4525 50 0001 L TNN +F 4 "aliexpress" H 2550 4900 50 0001 C CNN "supplier" + 1 2550 4900 + 1 0 0 -1 +$EndComp +$Comp +L LED:SK6812MINI D5 +U 1 1 60A4F5E7 +P 3200 4900 +F 0 "D5" H 3300 5150 50 0000 L CNN +F 1 "SK6812MINI" H 3250 4650 50 0000 L CNN +F 2 "LED_SMD:LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm" H 3250 4600 50 0001 L TNN +F 3 "https://cdn-shop.adafruit.com/product-files/2686/SK6812MINI_REV.01-1-2.pdf" H 3300 4525 50 0001 L TNN +F 4 "aliexpress" H 3200 4900 50 0001 C CNN "supplier" + 1 3200 4900 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2200 4900 2250 4900 +Wire Wire Line + 2850 4900 2900 4900 +$Comp +L power:+5V #PWR0131 +U 1 1 60A99092 +P 1900 4550 +F 0 "#PWR0131" H 1900 4400 50 0001 C CNN +F 1 "+5V" H 1915 4723 50 0000 C CNN +F 2 "" H 1900 4550 50 0001 C CNN +F 3 "" H 1900 4550 50 0001 C CNN + 1 1900 4550 + 1 0 0 -1 +$EndComp +$Comp +L power:+5V #PWR0132 +U 1 1 60A99537 +P 2550 4550 +F 0 "#PWR0132" H 2550 4400 50 0001 C CNN +F 1 "+5V" H 2565 4723 50 0000 C CNN +F 2 "" H 2550 4550 50 0001 C CNN +F 3 "" H 2550 4550 50 0001 C CNN + 1 2550 4550 + 1 0 0 -1 +$EndComp +$Comp +L power:+5V #PWR0144 +U 1 1 60A999BB +P 3200 4550 +F 0 "#PWR0144" H 3200 4400 50 0001 C CNN +F 1 "+5V" H 3215 4723 50 0000 C CNN +F 2 "" H 3200 4550 50 0001 C CNN +F 3 "" H 3200 4550 50 0001 C CNN + 1 3200 4550 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3200 4550 3200 4600 +Wire Wire Line + 2550 4550 2550 4600 +Wire Wire Line + 1900 4550 1900 4600 +$Comp +L power:GND #PWR0145 +U 1 1 60AE471A +P 1900 5250 +F 0 "#PWR0145" H 1900 5000 50 0001 C CNN +F 1 "GND" H 1905 5077 50 0000 C CNN +F 2 "" H 1900 5250 50 0001 C CNN +F 3 "" H 1900 5250 50 0001 C CNN + 1 1900 5250 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0146 +U 1 1 60AE4A34 +P 2550 5250 +F 0 "#PWR0146" H 2550 5000 50 0001 C CNN +F 1 "GND" H 2555 5077 50 0000 C CNN +F 2 "" H 2550 5250 50 0001 C CNN +F 3 "" H 2550 5250 50 0001 C CNN + 1 2550 5250 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0147 +U 1 1 60AE4E7B +P 3200 5250 +F 0 "#PWR0147" H 3200 5000 50 0001 C CNN +F 1 "GND" H 3205 5077 50 0000 C CNN +F 2 "" H 3200 5250 50 0001 C CNN +F 3 "" H 3200 5250 50 0001 C CNN + 1 3200 5250 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3200 5250 3200 5200 +Wire Wire Line + 2550 5200 2550 5250 +Wire Wire Line + 1900 5200 1900 5250 +Wire Wire Line + 1550 4900 1600 4900 +Text Label 4300 5550 0 50 ~ 0 +LED_DATA +Wire Wire Line + 4750 5550 4300 5550 +$Comp +L Sensor_Proximity:SFH9202 U1 +U 1 1 60D59A68 +P 5900 1500 +F 0 "U1" H 5950 1700 50 0000 C CNN +F 1 "SFH9206" H 5950 1300 50 0000 C CNN +F 2 "OptoDevice:Osram_SFH9x0x" H 5700 1300 50 0001 L CIN +F 3 "http://www.osram-os.com/Graphics/XPic0/00083379_0.pdf/SFH%209202,%20Lead%20%28Pb%29%20Free%20Product%20-%20RoHS%20Compliant.pdf" V 5860 1540 50 0001 L CNN +F 4 "2981800" H 5900 1500 50 0001 C CNN "ordercode" +F 5 "farnell" H 5900 1500 50 0001 C CNN "supplier" + 1 5900 1500 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R21 +U 1 1 60D5BD9E +P 5550 1100 +F 0 "R21" H 5650 1150 50 0000 L CNN +F 1 "200E" H 5650 1050 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 5480 1100 50 0001 C CNN +F 3 "~" H 5550 1100 50 0001 C CNN +F 4 "" V 5550 1100 50 0000 C CNN "DNP" +F 5 "1894108" H 5550 1100 50 0001 C CNN "ordercode" +F 6 "Farnell" H 5550 1100 50 0001 C CNN "supplier" + 1 5550 1100 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R22 +U 1 1 60D5C4A7 +P 6450 1150 +F 0 "R22" H 6550 1200 50 0000 L CNN +F 1 "10K" H 6550 1100 50 0000 L CNN +F 2 "Resistor_SMD:R_0603_1608Metric" V 6380 1150 50 0001 C CNN +F 3 "~" H 6450 1150 50 0001 C CNN +F 4 "" V 6450 1150 50 0000 C CNN "DNP" + 1 6450 1150 + 1 0 0 -1 +$EndComp +Text Label 6800 1400 2 50 ~ 0 +PROX +Wire Wire Line + 6450 1300 6450 1400 +Wire Wire Line + 6450 1400 6200 1400 +Wire Wire Line + 6800 1400 6450 1400 +Connection ~ 6450 1400 +$Comp +L power:+3V3 #PWR0148 +U 1 1 60DD8104 +P 6450 900 +F 0 "#PWR0148" H 6450 750 50 0001 C CNN +F 1 "+3V3" H 6465 1073 50 0000 C CNN +F 2 "" H 6450 900 50 0001 C CNN +F 3 "" H 6450 900 50 0001 C CNN + 1 6450 900 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0149 +U 1 1 60DD83CD +P 5550 2100 +F 0 "#PWR0149" H 5550 1850 50 0001 C CNN +F 1 "GND" H 5555 1927 50 0000 C CNN +F 2 "" H 5550 2100 50 0001 C CNN +F 3 "" H 5550 2100 50 0001 C CNN + 1 5550 2100 + 1 0 0 -1 +$EndComp +$Comp +L power:GND #PWR0150 +U 1 1 60DD8750 +P 6250 2100 +F 0 "#PWR0150" H 6250 1850 50 0001 C CNN +F 1 "GND" H 6255 1927 50 0000 C CNN +F 2 "" H 6250 2100 50 0001 C CNN +F 3 "" H 6250 2100 50 0001 C CNN + 1 6250 2100 + 1 0 0 -1 +$EndComp +Wire Wire Line + 6250 2100 6250 1900 +Wire Wire Line + 6250 1600 6200 1600 +Wire Wire Line + 5600 1600 5550 1600 +Text Label 6450 3850 2 50 ~ 0 +PROX +Wire Wire Line + 4750 5650 4300 5650 +Wire Wire Line + 6450 3850 6150 3850 +Text Label 4300 5650 0 50 ~ 0 +PROX_LED +Text Label 4850 1850 0 50 ~ 0 +PROX_LED +Wire Wire Line + 6450 900 6450 1000 +$Comp +L Transistor_FET:2N7002 Q2 +U 1 1 609352AD +P 5450 1850 +F 0 "Q2" H 5654 1896 50 0000 L CNN +F 1 "2N7002" H 5654 1805 50 0000 L CNN +F 2 "Package_TO_SOT_SMD:SOT-23" H 5650 1775 50 0001 L CIN +F 3 "https://www.onsemi.com/pub/Collateral/NDS7002A-D.PDF" H 5450 1850 50 0001 L CNN + 1 5450 1850 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5550 2100 5550 2050 +Wire Wire Line + 5550 1600 5550 1650 +Wire Wire Line + 4850 1850 5250 1850 +Wire Wire Line + 5550 1400 5600 1400 +Wire Wire Line + 5550 1250 5550 1400 +$Comp +L power:+5V #PWR0151 +U 1 1 609F649C +P 5550 900 +F 0 "#PWR0151" H 5550 750 50 0001 C CNN +F 1 "+5V" H 5565 1073 50 0000 C CNN +F 2 "" H 5550 900 50 0001 C CNN +F 3 "" H 5550 900 50 0001 C CNN + 1 5550 900 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5550 900 5550 950 +$Comp +L Device:C C5 +U 1 1 60A11409 +P 6450 1700 +F 0 "C5" H 6336 1654 50 0000 R CNN +F 1 "100nF" H 6336 1745 50 0000 R CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 6488 1550 50 0001 C CNN +F 3 "~" H 6450 1700 50 0001 C CNN + 1 6450 1700 + -1 0 0 1 +$EndComp +Wire Wire Line + 6450 1550 6450 1400 +Wire Wire Line + 6450 1850 6450 1900 +Wire Wire Line + 6450 1900 6250 1900 +Connection ~ 6250 1900 +Wire Wire Line + 6250 1900 6250 1600 +$Comp +L power:+5V #PWR06 +U 1 1 60BD18F4 +P 2050 2350 +F 0 "#PWR06" H 2050 2200 50 0001 C CNN +F 1 "+5V" H 2065 2523 50 0000 C CNN +F 2 "" H 2050 2350 50 0001 C CNN +F 3 "" H 2050 2350 50 0001 C CNN + 1 2050 2350 + 1 0 0 -1 +$EndComp +$Comp +L Device:C C6 +U 1 1 60BED0D0 +P 2550 1950 +F 0 "C6" H 2436 1904 50 0000 R CNN +F 1 "100nF" H 2436 1995 50 0000 R CNN +F 2 "Capacitor_SMD:C_0603_1608Metric" H 2588 1800 50 0001 C CNN +F 3 "~" H 2550 1950 50 0001 C CNN + 1 2550 1950 + -1 0 0 1 +$EndComp +$Comp +L power:+3V3 #PWR07 +U 1 1 60BEE634 +P 2550 1750 +F 0 "#PWR07" H 2550 1600 50 0001 C CNN +F 1 "+3V3" H 2565 1923 50 0000 C CNN +F 2 "" H 2550 1750 50 0001 C CNN +F 3 "" H 2550 1750 50 0001 C CNN + 1 2550 1750 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2550 1750 2550 1800 +$Comp +L power:GND #PWR08 +U 1 1 60C259B6 +P 2550 2150 +F 0 "#PWR08" H 2550 1900 50 0001 C CNN +F 1 "GND" H 2555 1977 50 0000 C CNN +F 2 "" H 2550 2150 50 0001 C CNN +F 3 "" H 2550 2150 50 0001 C CNN + 1 2550 2150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2550 2150 2550 2100 +$Comp +L Device:Fuse F1 +U 1 1 60C49C09 +P 1750 2400 +F 0 "F1" V 1553 2400 50 0000 C CNN +F 1 "250mA" V 1644 2400 50 0000 C CNN +F 2 "Fuse:Fuse_1206_3216Metric_Castellated" V 1680 2400 50 0001 C CNN +F 3 "~" H 1750 2400 50 0001 C CNN +F 4 "Farnell" H 1750 2400 50 0001 C CNN "supplier" +F 5 "9921826" V 1750 2400 50 0001 C CNN "ordercode" + 1 1750 2400 + 0 1 1 0 +$EndComp +Wire Wire Line + 2050 2350 2050 2400 +Connection ~ 2050 2400 +Wire Wire Line + 2050 2400 2150 2400 +Wire Wire Line + 1900 2400 2050 2400 +$Comp +L Device:R_Pack04 RN? +U 1 1 60AFB70F +P 1050 6300 +F 0 "RN?" V 633 6300 50 0000 C CNN +F 1 "10K_array4" V 724 6300 50 0000 C CNN +F 2 "Resistor_SMD:R_Array_Convex_4x0603" V 1325 6300 50 0001 C CNN +F 3 "~" H 1050 6300 50 0001 C CNN + 1 1050 6300 + 0 1 1 0 +$EndComp +Wire Wire Line + 750 6400 850 6400 +Wire Wire Line + 850 6300 750 6300 +Connection ~ 750 6300 +Wire Wire Line + 750 6300 750 6400 +Wire Wire Line + 850 6200 750 6200 +Connection ~ 750 6200 +Wire Wire Line + 750 6200 750 6300 +Wire Wire Line + 850 6100 750 6100 +Connection ~ 750 6100 +Wire Wire Line + 750 6100 750 6200 +Text Label 1550 6100 0 50 ~ 0 +ADDR0 +Wire Wire Line + 1250 6100 1900 6100 +Wire Wire Line + 1250 6200 1900 6200 +Wire Wire Line + 1250 6300 1900 6300 +Wire Wire Line + 1250 6400 1900 6400 +Text Label 1550 6200 0 50 ~ 0 +ADDR1 +Text Label 1550 6300 0 50 ~ 0 +ADDR2 +Text Label 1550 6400 0 50 ~ 0 +ADDR3 +$Comp +L power:+3V3 #PWR? +U 1 1 60D19F7E +P 750 5850 +F 0 "#PWR?" H 750 5700 50 0001 C CNN +F 1 "+3V3" H 765 6023 50 0000 C CNN +F 2 "" H 750 5850 50 0001 C CNN +F 3 "" H 750 5850 50 0001 C CNN + 1 750 5850 + 1 0 0 -1 +$EndComp +Wire Wire Line + 750 5850 750 6100 +$EndSCHEMATC diff --git a/CAD/~$ESP32 Pins.xlsx b/CAD/~$ESP32 Pins.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..97d8d6d2efb2a81bb3e0168c08ae1014f0c94ab4 GIT binary patch literal 165 zcmd-N&& LEDS(NUM_LEDS, LED_DATA); + +RgbColor red(colorSaturation, 0, 0); +RgbColor green(0, colorSaturation, 0); +RgbColor blue(0, 0, colorSaturation); +RgbColor white(colorSaturation); +RgbColor black(0); + + + +/* ---------------- */ +/* public functions */ +/* ---------------- */ + +void initLeds(void) +{ + Serial.print("Init Leds: "); + LEDS.begin(); + LEDS.ClearTo(black); + + Serial.println("OK"); +} + +void handleLeds(void) +{ + uint64_t currentmillis = millis(); + if (currentmillis - ledtimer1 > LEDINTERVAL) + { + + + ledtimer1 = currentmillis; + + } +} \ No newline at end of file diff --git a/clockclock/src/led.h b/clockclock/src/led.h new file mode 100644 index 0000000..8c53c29 --- /dev/null +++ b/clockclock/src/led.h @@ -0,0 +1,11 @@ +#pragma once + +#include "board.h" +#include +#include + +#define NUM_LEDS 4 +#define LEDINTERVAL 10 + +void initLeds(void); +void handleLeds(void); \ No newline at end of file diff --git a/clockclock/src/main.cpp b/clockclock/src/main.cpp index 66e3a59..066b6ac 100644 --- a/clockclock/src/main.cpp +++ b/clockclock/src/main.cpp @@ -3,12 +3,20 @@ #include "motor.h" #include "buttons.h" #include "movement.h" +#include "Proximity.h" +#include "led.h" +#include "comms.h" void setup() { // put your setup code here, to run once: + initBoard(); initMotors(); initButtons(); initMovement(); + initProximity(); + initLeds(); + initComms(); + } void loop() { @@ -16,4 +24,7 @@ void loop() { handleMotors(); handleButtons(); handleMovement(); + handleProximity(); + handleLeds(); + handleComms(); } \ No newline at end of file diff --git a/clockclock/src/motor.cpp b/clockclock/src/motor.cpp index 4be165a..9400b45 100644 --- a/clockclock/src/motor.cpp +++ b/clockclock/src/motor.cpp @@ -11,6 +11,7 @@ MultiStepper motors; void c_motor::init(bool setvref) { + Serial.print("init Motors: "); pinMode(_rst, OUTPUT); pinMode(_en, OUTPUT); pinMode(_sclk, OUTPUT); @@ -27,9 +28,13 @@ void c_motor::init(bool setvref) if (setvref) { - pinMode(MOT_VREF, OUTPUT); + Serial.print("Setup Vref: "); + ledcSetup(0,12800,8); + //pinMode(MOT_VREF, OUTPUT); + ledcAttachPin(MOT_VREF,0); ledcWrite(MOT_VREF, 32); } + Serial.println("OK"); } void c_motor::begin(void) diff --git a/clockclock/src/proximity.cpp b/clockclock/src/proximity.cpp new file mode 100644 index 0000000..20cbf77 --- /dev/null +++ b/clockclock/src/proximity.cpp @@ -0,0 +1,70 @@ +#include "Proximity.h" + +uint64_t proximityTimer = 0; +uint64_t sampleTimer = 0; +uint16_t readbuffer[ANALOGSAMPLES]; +uint16_t readbuffer_idx = 0; +bool firstOutputSampleReady = false; +uint16_t currentProx = 0; + +uint32_t addSample(void) +{ + uint64_t currentmillis = millis(); + if (currentmillis - sampleTimer > SAMPLERATE) + { + sampleTimer = currentmillis; + if (readbuffer_idx > ANALOGSAMPLES - 1) + { + readbuffer_idx = 0; + firstOutputSampleReady = true; + } + digitalWrite(PROX_LED, HIGH); + delay(3); + readbuffer[readbuffer_idx++] = analogRead(PROX_IN); + + digitalWrite(PROX_LED, LOW); + + if (firstOutputSampleReady) + { + //average samples + uint64_t sampleAvg = 0; + for (int i = 0; i < ANALOGSAMPLES; i++) + { + sampleAvg += readbuffer[i]; + } + //Serial.printf("AnalogRead_sum(%l)\n", sampleAvg); + sampleAvg /= ANALOGSAMPLES; + currentProx = sampleAvg; + return sampleAvg; + } + } + return readbuffer[readbuffer_idx - 1]; +} + +void initProximity(void) +{ + Serial.print("Proximity init:"); + pinMode(PROX_LED, OUTPUT); + pinMode(PROX_IN, ANALOG); + + for (auto sample : readbuffer) + { + sample = 0; + } + Serial.println(" OK "); +} + +void handleProximity(void) +{ + uint64_t currentmillis = millis(); + if (currentmillis - proximityTimer > PROXIMITYINTERVAL) + { + //Serial.printf("proximity raw read = %u\n", currentProx); + proximityTimer = currentmillis; + } + + addSample(); +} +void getProximity(void) +{ +} \ No newline at end of file