voltage source simulation/pcb implementation
310 21
othernick 2 months ago
Hello, Here the sketch of a circuit I have implemented and which simulation gave me exactly the result I wanted. [https://easyeda.com/editor#mode=sim,id=fb3873960883413b855ad2eb1bfb2f15](https://easyeda.com/editor#mode=sim,id=fb3873960883413b855ad2eb1bfb2f15) I have ordered the PCB accordingly (waiting now for it to arrive), placing an extra pin header footprint in order to substitute all my external connection (and dividing the circuit at the point of Probe2 to insert another part) . Anyway, this is what I wanted to simulate and I will have a sin wave generated by Arduino as an input signal (V1). But I am not sure about how to properly substituting V2!? If for example I just connect a battery, what would be the difference with +/-5V? Because when simulating it made all the difference! [If the question will sound too easy to you, I hope you understand that I am new of the world of PCB and implementing electronic circuits, apologies in advance]. Regards
andyfierman 2 months ago
Markus_ee 2 months ago
Hi! Are you feeding a known DC voltage to V2? If so, then do it with a voltage regulator. For example: You want to insert +3.3V into V2. Then you just build a voltage regulator circuit that inputs 5V from your power supply and outputs 3.3V. Regards, Markus Virtanen HW / Electronics Designer
andyfierman 2 months ago
@othernick, @markus_jidoka, Using a regulator is one option. Another cheaper option us simply to set the required potential divider ratio and connecting it between the +5V rail and ground I am also a bit puzzled by whether your choice to connect V1 from VCC to the input is guided by your original design requirements or by the simple fact that you found it was necessary to do that to get your (broken) simulation to give you the output you expected.
andyfierman 2 months ago
To clarify: "Another cheaper option is simply to set the required potential divider ratio and connecting it between the +5V rail and ground." That assumes that your 5V supply is from a regulator and so is controlled to something like a +/-3% or better tolerance.
othernick 2 months ago
@Markus_ee Thank you for your suggestion, I will try the voltage regulator, I would have 5V there.
othernick 2 months ago
@andyfierman The PCB was ordered about two weeks ago (when I got the desired simulation results) and it is expected to arrive in the next days. I am very confused by your comment: "it is very definitely not correct to the simulation schematic that you have drawn". Would you please try and be more specific? An example of what I would get instead would help, the link you sent is not enough for me to understand what's going on. I couldn't be aware of the "bug of the system" you mentioned, as I mainly work offline on the project, so how does it woow if my system won't give me the results that I simulated? Will I get a refund? To VCC was connected to V1 to simulate an external sinusoidal input I will have (for AC).
othernick 2 months ago
Important to mention that in the schematic I have actually printed I have substituted vcc+v1 and vcc+v2 by vcc supply flag only and inserted a pin header to connect to external sources, like I did now here to show you [https://easyeda\.com/editor\#mode=sim\,id=fb3873960883413b855ad2eb1bfb2f15\|08559fc18e1c4d448e55baf80f489ce1](https://easyeda.com/editor#mode=sim,id=fb3873960883413b855ad2eb1bfb2f15|08559fc18e1c4d448e55baf80f489ce1) . (similarly for other power sources)
andyfierman 2 months ago
@g.lat, Until you correct the power supply connections (or EasyEDA fix the voltage source auto-assignment bugs) as I have described above and clarified what voltage the VCC net should be, you are wasting your time because as I have explained: your simulation is not showing you what the circuit actually does. In this project:, [https://oshwlab.com/andyfierman/lm358-v-divider](https://oshwlab.com/andyfierman/lm358-v-divider)<br> <br> Sheet 1 is your simulation as originally given at the start of this topic. Sheet 2 is the simulation with the power supplies corrected to avoid the EasyEDA auto-assignment bugs and assuming that the supply you have labelled as VCC should be +5V. If you run them you will see that the simulation results are not the same. Your original sim: ![image.png](//image.easyeda.com/pullimage/SLKdaqQxTrmPT9y1nzCIYqJvdx9r4sNpnbeflg78.png) which gives the following WaveForm results: ![image.png](//image.easyeda.com/pullimage/9BWPh2EjLbgaFvEjCwoL6PIhf8tvr0uNmMyd27XI.png) This is the same circuit but with the voltage sources for the supply rails explicitly (i.e. manually) assigned: ![image.png](//image.easyeda.com/pullimage/Ql3X6H4suWFb0GKUVIJefXHvvO97sCMJOuY3Q4zK.png) which gives the following WaveForm results: ![image.png](//image.easyeda.com/pullimage/EE6IC2aquvf29FTE80R1jwIcis2VQaD406LtTCDj.png) <br> If you do File > Export Netlist > LTspice for This Sheet... and compare them, you will see that there is only one (auto-assigned, -5V) voltage source in the netlist for sheet 1 whereas there are three correctly manually assigned for sheet 2. <br> The relevant part of your original netlist showing only a single -5V supply with the positive supplies of the opamps connected to a net called +5V but which has no voltage source supplying it: ![image.png](//image.easyeda.com/pullimage/HLbp7VoDdwvwS4BaMNJeOLqzX4NAreCoUm6M1GfU.png) The same part of the netlist for the corrected circuit showing all three supplies in place: ![image.png](//image.easyeda.com/pullimage/qpINPcF5LLkoLbsadLcT14vA79KOeS8O8bvI4v6Y.png)
othernick 2 months ago
Apologies, this is the right link [https://easyeda.com/editor#id=e7732ac4929f4f55b93c384b814b52f5](https://easyeda.com/editor#id=e7732ac4929f4f55b93c384b814b52f5)
othernick 2 months ago
OK, thank you for the explanation. So it won't work with the schematic I showed now either? Is there a procedure for this now? Will I get a refund based on what happened?
andyfierman 2 months ago
othernick 2 months ago
[https://easyeda.com/editor#mode=sim,id=08559fc18e1c4d448e55baf80f489ce1](https://easyeda.com/editor#mode=sim,id=08559fc18e1c4d448e55baf80f489ce1)
andyfierman 2 months ago
@g.lat, This simulation schematic has also ended up wrong due to the incorrectly auto-assigned supplies. You have however not specified the voltages that you expect to be applied to VCC and VCC2 so it is not clear what you expected the simulation output to be anyway. Also, neither this or the earlier schematics would appear to be the one from which you created the PCB which you have submitted for fabrication. Since that schematic has not been made public, it is not possible to comment on the status of the PCBs you will receive with respect to the schematic from which they were created. It is not clear if your PCB design was completed before or after you started your simulation schematics.
andyfierman 2 months ago
@g.lat, Two of your earlier posts arrived while I was working on the example to show you so I missed your questions and further the information in them.
andyfierman 2 months ago
I understand that you created a PCB based on the results of your simulations and that it was submitted for fabrication about a week before you posted about your simulation here. " I couldn't be aware of the "bug of the system" you mentioned, as I mainly work offline on the project, so how does it woow if my system won't give me the results that I simulated?" Working on or offline makes no difference. The error in the netlist is a result of the EasyEDA auto-supply assignment process and due to the bugs in it, it would not detect - and so you would not have seen - any indications or warnings about it anyway. "Will I get a refund based on what happened?" Once we can clarify your original design aims and whether the schematic that you converted to PCB and then submitted for fabrication, will meet those design aims then that will be a question for EasyEDA Support. At the moment it is not possible to decide if the physical board will "work" in your application because you have not sufficiently specified what that application is. All we have established is that the simulation schematic does not give you the results that you expect which is not the same thing. "To VCC was connected to V1 to simulate an external sinusoidal input I will have (for AC)." Sorry but I still don't understand what you mean here because you have not specified or described the external circuitry, signals and supplies to which this board is to be connected clearly enough.
othernick 2 months ago
@[andyfierman](https://easyeda.com/andyfierman) I have totally run the simulations before going through the order, many times, to make sure to get the same result. The only thing I have done on the sketch I simulated before converting to PCB was substituting the sources with VCC, because I am going to connect externally anyway. Isn't this correct? Thanks for sharing a way to simulate the bug, I will use it now to obtain what I want. But is there a way to overcome it and get instead the result I had? Because in that case I could order different parts (resistors/op amps) and still use that PCB.
andyfierman 2 months ago
@g.lat, "The only thing I have done on the sketch I simulated before converting to PCB was substituting the sources with VCC" Not sure that's true because when I open your project: [https://easyeda.com/g.lat/voltage-divider-x2inverting-amp_copy](https://easyeda.com/g.lat/voltage-divider-x2inverting-amp_copy)<br> <br> and try to convert it to PCB it is missing the LM358 footprints: ![image.png](//image.easyeda.com/pullimage/qMdeL6SbyVcjQrYQUKtaJhNh9jeCr8wejQYnIPG2.png) So it seems that the schamatic that you converted to PCB is not the one that you have made public.
othernick 2 months ago
Maybe you are not sure, but I am, 100% that it is not in the way you are describing the problem now. I have specified above that this [https://easyeda.com/g.lat/voltage-divider-x2inverting-amp_copy](https://easyeda.com/g.lat/voltage-divider-x2inverting-amp_copy) was an example to show you the way I substituted VCC+V1 and VCC+V2 when converting the PCB, not even the pin header is the right one over there. I can't share my project as public, so I won't. You are basically saying that I can't be refunded because maybe my PCB won't work for other reasons, is it? But this doesn't matter, because in that case I wouldn't have asked for a refund. What actually matters is that I have printed my PCB based on the results that I got from this [https://easyeda.com/editor#mode=sim,id=fb3873960883413b855ad2eb1bfb2f15](https://easyeda.com/editor#mode=sim,id=fb3873960883413b855ad2eb1bfb2f15) simulation and that I won't have the expected results on that part because of the bug of your system. I think it would be more than fair that either you make sure I will be refunded, or at least you suggest here a solution to "overcome the bug" providing a way that would give me the solution I was expecting. And I didn't even ask to charge on you the extra parts I would need in this last mentioned case. I am not asking anything more than fair here, there was a disservice based on which I would be the one losing out. And this is not right.
othernick 2 months ago
I really appreciate your help and I also understand your position. But there must be a solution here for the the issue I experienced.
andyfierman 2 months ago
othernick 2 months ago
OK, I will DM you the details and add you on the project. Thanks @[andyfierman](https://easyeda.com/andyfierman)