# Input Power Source Switching \(USB / Solar\)

## Description

This project is intended to validate automatic or prioritized input source selection \(if any\), or test performance across variable solar conditions using the simulation and code tool

## Project Details

- **Owner:** the\-sims
- **Created:** 4/30/2025
- **Last Updated:** 4/30/2025
- **Visibility:** Public

## Key Components

### D1 — [SS34](https://flux.ai/jecstronic/ss34~8tm.md)

- License: https://creativecommons\.org/licenses/by/4\.0/
- Manufacturer Part Number: SS34
- Datasheet URL: https://www\.onsemi\.com/pdf/datasheet/ss39\-d\.pdf
- Part Type: Diode
- Manufacturer Name: onsemi

**Pins:**
- A [pin 2]
- K [pin 1]

### D2 — [LED\_0603\_1608Metric](https://flux.ai/adrian95/led06031608metric~990.md)

- Forward Voltage: 2\.0V
- Manufacturer Name: Foshan NationStar Optoelectronics
- Part Type: LED
- Color: Green
- License: https://creativecommons\.org/licenses/by/4\.0/
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/2008201032\_Foshan\-NationStar\-Optoelectronics\-NCD0603C1\_C84264\.pdf
- Manufacturer Part Number: NCD0603C1
- Forward Current: 20mA

**Pins:**
- P1 [pin 1]
- P2 [pin 2]

### D3 — [SS34](https://flux.ai/jecstronic/ss34~8tm.md)

- License: https://creativecommons\.org/licenses/by/4\.0/
- Manufacturer Part Number: SS34
- Datasheet URL: https://www\.onsemi\.com/pdf/datasheet/ss39\-d\.pdf
- Part Type: Diode
- Manufacturer Name: onsemi

**Pins:**
- A [pin 2]
- K [pin 1]

### D4 — [SS34](https://flux.ai/jecstronic/ss34~8tm.md)

- License: https://creativecommons\.org/licenses/by/4\.0/
- Manufacturer Part Number: SS34
- Datasheet URL: https://www\.onsemi\.com/pdf/datasheet/ss39\-d\.pdf
- Part Type: Diode
- Manufacturer Name: onsemi

**Pins:**
- A [pin 2]
- K [pin 1]

### D5 — [LED\_0603\_1608Metric](https://flux.ai/adrian95/led06031608metric~990.md)

- Current: 20mA
- Manufacturer Name: Foshan NationStar Optoelectronics
- Part Type: LED
- Color: Red
- Manufacturer Part Number: NCD0603R1
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/2008201032\_Foshan\-NationStar\-Optoelectronics\-NCD0603R1\_C84263\.pdf
- License: https://creativecommons\.org/licenses/by/4\.0/
- Forward Voltage: 2\.0V

**Pins:**
- P1 [pin 1]
- P2 [pin 2]

### IC1 — [MT3608](https://flux.ai/vasyl/mt3608~9zt.md)

- Manufacturer Name: Aerosemi Technology Co Ltd
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/2201121530\_XI\-AN\-Aerosemi\-Tech\-MT3608L\_C2932326\.pdf
- Manufacturer Part Number: MT3608L
- Part Type: Integrated Circuit

**Pins:**
- EN [pin 4]
- FB [pin 3]
- GND [pin 2]
- IN [pin 5]
- NC [pin 6]
- SW [pin 1]

### J1 — [JST B2B PH K 01x02 Connector](https://flux.ai/jharwinbarrozo/jst-b2b-ph-k-01x02-connector~zu5.md)

- Manufacturer Part Number: B2B\-PH\-K\-S\(LF\)\(SN\)
- Manufacturer Name: JST Sales America
- Part Type: Connector
- Datasheet URL: https://www\.jst\-mfg\.com/product/pdf/eng/ePH\.pdf

**Pins:**
- PIN1 [pin 1]
- PIN2 [pin 2]

### J2 — [DB125\-3\.81\-4P\-GN\-S](https://flux.ai/jharwinbarrozo/db125-3p81-4p-gn-s~l9d.md)

- Part Type: Connector
- License: https://creativecommons\.org/licenses/by/4\.0/
- Manufacturer Name: DIBO
- Manufacturer Part Number: DB125\-3\.81\-4P\-GN\-S
- Datasheet URL: https://www\.lcsc\.com/datasheet/lcsc\_datasheet\_2304061030\_DORABO\-DB125\-3\-81\-4P\-GN\-S\_C395880\.pdf

**Pins:**
- P1 [pin 1]
- P2 [pin 2]
- P3 [pin 3]
- P4 [pin 4]

### J3 — [2\-Position Screw Terminal](https://flux.ai/corynrobinson/2-position-screw-terminal~s4.md)

- Part Type: Connector
- Manufacturer Part Number: WJ500V\-5\.08\-2P
- Manufacturer Name: Ningbo Kangnex Elec
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/1912251636\_Ningbo\-Kangnex\-Elec\-WJ500V\-5\-08\-2P\_C8465\.pdf

**Pins:**
- P1 [pin 1]
- P2 [pin 2]

### J4 — [USB\_Micro](https://flux.ai/adrian95/usbmicro~1ej.md)

- Part Type: Connector
- Manufacturer Part Number: 10118192\-0001LF
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/2304140030\_Yuandi\-MICRO\-03\-P1\-A1T2\_C2682528\.pdf

**Pins:**
- D\-
- D\+
- GND
- ID
- VBUS

### SW1 — [SW\_SPDT](https://flux.ai/adrian95/swspdt~q2k.md)

- Manufacturer Name: SHOU HAN
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/2304140030\_SHOU\-HAN\-MSK12C02\_C431540\.pdf
- Manufacturer Part Number: MSK12C02
- Part Type: Switch

**Pins:**
- A
- B
- C

### U1 — [RT8059GJ5](https://flux.ai/collinsemasi/rt8059gj5~n5.md)

- Manufacturer Part Number: RT8059GJ5
- Datasheet URL: https://www\.lcsc\.com/datasheet/lcsc\_datasheet\_1811100910\_Richtek\-Tech\-RT8059GJ5\_C20542\.pdf
- Package or Case Code: SOT\-23\-5
- SPICE Model: \* RT8059 Behavioral Model for NGspice \* Node order: VIN LX FB EN GND \.SUBCKT RT8059 VIN LX FB EN GND \* Parameters \.PARAM VUVLO=2\.3 \.PARAM VREF=0\.6 \.PARAM FSW=1\.5MEG \.PARAM ILIM=1\.5 \.PARAM RDSH=0\.28 \.PARAM RDSL=0\.25 \* ENABLE Logic B1 N\_EN GND V=IF\(V\(EN\)\>1\.5,1,0\) B2 N\_UVLO GND V=IF\(V\(VIN\)\>VUVLO,1,0\) B3 N\_ACTIVE GND V=V\(N\_EN\)\*V\(N\_UVLO\) \* Internal reference VREF N\_REF GND DC \{VREF\} \* Error amplifier output \(difference between VREF and FB\) E\_ERR N\_ERR GND VALUE=\{V\(N\_REF\) \- V\(FB\)\} \* Triangle wave: emulate using time\-based function B\_TRI N\_TRI GND V=0\.5\+0\.5\*SIN\(2\*3\.14159\*\{FSW\}\*TIME\) \* PWM comparator B4 N\_PWM GND V=IF\(V\(N\_ERR\)\>V\(N\_TRI\),1,0\) \* Current sense using a small resistor R\_SENSE LX N\_ISENSE 0\.05 B5 N\_ILIM\_OK GND V=IF\(I\(R\_SENSE\)\<ILIM,1,0\) \* Control signals for switches B6 N\_HCTRL GND V=V\(N\_ACTIVE\)\*V\(N\_PWM\)\*V\(N\_ILIM\_OK\) B7 N\_LCTRL GND V=V\(N\_ACTIVE\)\*\(1\-V\(N\_PWM\)\)\*V\(N\_ILIM\_OK\) \* Switch models \(control 0\-1 V\) \.model PMOS\_SW VSWITCH \(RON=\{RDSH\} ROFF=1MEG VON=1 VOFF=0\) \.model NMOS\_SW VSWITCH \(RON=\{RDSL\} ROFF=1MEG VON=1 VOFF=0\) \* High\-side switch S1 VIN LX N\_HCTRL GND PMOS\_SW \* Low\-side switch S2 GND LX N\_LCTRL GND NMOS\_SW \.ENDS RT8059
- Part Type: Integrated Circuit
- License: https://creativecommons\.org/licenses/by/4\.0/

**Pins:**
- EN [pin 1]
- FB [pin 5]
- GND [pin 2]
- LX [pin 3]
- VIN [pin 4]

### U3 — [SY6280](https://flux.ai/collinsemasi/sy6280~70.md)

- Manufacturer Name: Silergy Corp
- Manufacturer Part Number: SY6280A  AC
- Datasheet URL: https://www\.lcsc\.com/datasheet/lcsc\_datasheet\_1810121532\_Silergy\-Corp\-SY6280AAC\_C55136\.pdf
- Package or Case Code: SOT\-23\-5
- Part Type: Integrated Circuit
- License: https://creativecommons\.org/licenses/by/4\.0/

**Pins:**
- EN [pin 4]
- GND [pin 2]
- ISET [pin 3]
- VIN [pin 5]
- VOUT [pin 1]

### U4 — CN3063 Test

- Manufacturer Name: Seeed
- Part Type: Integrated Circuit
- Manufacturer Part Number: CN3063
- Package or Case Code: SOP\-8\-EP
- Datasheet URL: https://datasheet\.lcsc\.com/lcsc/1811051510\_ShangHai\-Consonance\-Elec\-CN3063\_C28078\.pdf
- License: https://creativecommons\.org/licenses/by/4\.0/

**Pins:**
- 9 [pin 9]
- \~CHARG [pin 7]
- \~DONE [pin 6]
- BAT [pin 5]
- FB [pin 8]
- GND [pin 3]
- ISET [pin 2]
- TEMP [pin 1]
- VIN [pin 4]

*The full schematic, PCB layout, bill of materials, and interactive design are available at [https://flux\.ai/the\-sims/input\-power\-source\-switching\-usb\-solar\~q9](https://flux.ai/the-sims/input-power-source-switching-usb-solar~q9).*

---

*Generated from [https://flux\.ai/the\-sims/input\-power\-source\-switching\-usb\-solar\~q9](https://flux.ai/the-sims/input-power-source-switching-usb-solar~q9)*