EDIT: Embedded images do not show. I put the schematic and pcb as attachment.
Hi
I created a circuit that should switch a led on if it gets dark. The design is powered by a LiPo battery which is charged by a solar panel. The main circuit is the standard resistive divider with an LDR that drives the base of a NPN transistor to switch the current through the LED - Collector - Emitter path. There are two other parts to the circuit, the solar charging circuit around a CN3791 Standalone Li-ion Battery Charger IC With Photovoltaic Cell MPPT Function and the protection circuit around a FS312F-G Standalone Li-ion Battery Charger IC With Photovoltaic Cell MPPT Function. See schematic below for details:
https://drive.google.com/file/d/12_YMz7QGEUaEKRMuqhE5P9pmQOAl4V40/view?usp=share_link
I built this circuit in the pas without a switch and a little different layout on the pcb. It seemed to work fine. Now with my newest pcb the LED is very dim. As mentioned before the change in the design is that I now use a switch and I also use a green led this time (forward voltage of 2.2V an I_F = 20mA according to datasheet). Before I used a white LED with a forward voltage of 3.2V and I_F=30mA according to datasheet.
To check I built the "dark switch led" part on a breadboard using the same resistor values as on the pcb and the same transistor ([2N222A](
https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf])) and LDR (GL5528). When powering it on the breadboard, the LED is brighter than on the PCB. I did some measurements and it turns out, that in the pcb variant, the voltage at the base of the transistor is 640mV, while at the base of the transistor on the breadboard the voltage is 680mV. I don't understand where this difference comes from? Also I don't understand why both values are not higher, as the LDR in dark conditions should have > 40MΩ which should result in a 3.59V given a 3.6V battery?
I did further measure the Voltage at the output of the switch (V_s), the voltage between R3 and the led D1 (V_r) and between the led D1 and the transistor Q1 (V_l). The results for the pcb variant were:
V_s = 3.72V (same as on battery +)
V_r = 3.68V
V_l = 1.88V
and for the breadboard variant they were:
V_s = 3.72V
V_r = 3.64V
V_l = 1.6V
as 3.56V (same as measured directly at battery +) on the pcb (and set the input voltage on the breadboard to the same value) and I also measured the Voltage between R3 and the LED as XX on the pcb and YY on the breadboard.
Last but not least, I decided to put the switch to off and inject power on the pcb at the output of the switch from the power supply channel 1 and at the same time supply the same power on channel three to the breadboard to have a direct comparison of the difference in intensity.
https://drive.google.com/file/d/1cHRC__eyKLTeTMRTx2Gdkkvw4yJd-HR7/view?usp=share_link
The psu shows that the pcb circuit only draws XX mA while the breadboard variant draws YY. I also noticed, that when switching the PSU off, the LED on the pcb variant fades and the LED on the breadboard is immediately off.
https://drive.google.com/file/d/1Itv2TXeDHXTARo58N_a3yxGdbgzQAFkH/view?usp=share_link
Do you see where I made a mistake and can you help me understand the problem - or also just give hints how to test further. I would appreciate that a lot.
I attached the PCB layout and datasheets below.
Thank you
https://drive.google.com/file/d/1Itv2TXeDHXTARo58N_a3yxGdbgzQAFkH/view?usp=share_link