# DC solution failed using EasyEDA

I am trying to simulate an IR sensor circuit as described here:

https://circuitdigest.com/electronic-circuits/ir-sensor-circuit-diagram

I am using EasyEDA for this purpose, and the following is my first attempt:

After making this circuit, I wanted to know voltages at few points and I have added the probes as can be seen in the schematics.

Then I started simulation ("simulate this sheet"). But I got the following error:

Circuit: gooduntitled

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Warning: singular matrix:  check nodes u1_7 and u1_7

Note: Starting dynamic gmin stepping
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Warning: singular matrix:  check nodes u1_7 and u1_7

Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Warning: singular matrix:  check nodes u1_7 and u1_7

Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful gmin step
Note: One successful source step
Warning: singular matrix:  check nodes u1_7 and u1_7

Warning: singular matrix:  check nodes u1_7 and u1_7

Warning: source stepping failed

DC solution failed -

Last Node Voltages
------------------

Node                                   Last Voltage        Previous Iter
----                                   ------------        -------------
u1_7                                              0                    0
volprobe2                                         0                    0
volprobe1                                         0                    0
led1_2                                            0                    0
gnd                                               0                    0
+5v                                               0                    0
led1#branch                                       0                    0
led2#branch                                       0                    0

doAnalyses: iteration limit reached

op simulation(s) aborted
Error(parse.c--checkvalid): volprobe1: no such vector.
ngspice-26 done


I am unable to understand why I am getting 0 values for volprobe1 and volprobe2, and what is the meaning of the errors.

• There's no guarantee that your simulator will take the light output from the LED and shine it at the SFH2400. – Andy aka Jul 12 '18 at 11:13
• @Andyaka Thanks for the comment. is there anyway I can ensure this? – gpuguy Jul 12 '18 at 11:18
• I'm no expert on EasyEDA. – Andy aka Jul 12 '18 at 11:31
• @Andyaka - in case it helps (I've never done simulations with optoelectronics so am not sure) EasyEDA's simulation uses ngspice, and any ngspice directives can be included by adding a text object to the schematic and changing its type on the properties panel to "spice directive". – Jules Jul 12 '18 at 14:46
• @gpuguy - it may help to export the spice netlist from easyeda and paste it in the question. I've had trouble with easyeda skipping components out of a netlist without issuing warnings before, so if the simulation is misbehaving it's always best to check that as a possibility. – Jules Jul 12 '18 at 14:49

You're using the "+5V" net name to identify your positive rail, but all that does is name it. You need to add a voltage source, too.

In the "EELib" panel, you should be able to find a voltage source component (a circle with plus and minus symbols at the top and bottom). Attach it between your +5V net and GND net, and set its value to "DC 5V". If it still doesn't work, paste the netlist in your question so we can check it has no other discrepancies in it (folder icon/"Export Netlist"/"Spice for this sheet").

I'm not familiar with EasyEDA, but some things never change.

According to the data sheet the PD will produce about 10 uA at 1000 lux (direct sunlight is about 120,000 lux), and an LED won't produce that much flux. Let's be optimistic and hope for 1 uA. Note that dark current at 25 C is 1 nA. Also note that 1 uA through 10k will produce 10 mV, and while the PNP input structure of the LM358 will operate at these levels, your pot will pretty much be useless. Plus, since the input offset voltage of a 358 can be as high as 7 mV, you should really rethink this design.

With that said, you have two choices. You can replace the PD with a 1 uA current source (if EasyEDA permits), or you can replace it with about a 5 Mohm resistor. A drop of about 5 volts across 5 M will give you 1 uA.

Note that the 358 is not ideal for this application in other respects. Its input bias current can be as high as 250 nA, and working that close to the device error levels is likely to be source of some consternation.

When you get to building a real circuit, you will need to take enormous care to shield your optical path from ambient light. If you are using this for object detection, you will find the broad acceptance angle of the PD (and probably the LED, since it seems to be a 3 mm device) means that it will not work well for any sort of distance to the LED. Just a friendly warning.

• This sounds plausible, but it shouldn't cause all of the output voltages to be exactly zero... – Jules Jul 12 '18 at 15:11