You need to log in to create posts and topics.

Help with subcircuit/scripted circuit

I was wondering if there was some way to create a circuit/chip for measuring resistance of a circuit.

Im building some circuits with transistors and stuff and it's annoying to get the equivalent resistance of a specific section, mostly input and output resistances.

I was wondering if it was possible to make a pseudo-ohmmeter.

For the input resistance or a resistance in a part of the circuit, a simple scripted chip that takes in a voltage in 2 pins and the current going tru it in other 2 inputs, or share one of the voltage pins to share. I just don't know how to make a display that shows the value of the resistance by doing V/I

 

And for output resistance, a scripted circuit that can read the open circuit voltage, then short to ground and measure the current, and do V/I and display it

 

Anyone knows if this is possible? 

Hi.

Attached 2 examples of voltmeters made with subcircuits and script.
I think you can modify for your use case.
If you have any questions feel free to ask.

One is made with 7 segment BCD displays and the other one with a Text component:

Uploaded files:
average_simulide_enjoyer has reacted to this post.
average_simulide_enjoyer

Voltmeters are fairly simple indeed. However, for impedance (resistance for DC only), we also need the current.

I know there's no script function to directly read current, but there must be some interesting tactic.

You can know the current by reading the voltage drop across a resistor.
Just use a very low resistance.

Quote from arcachofo on February 5, 2025, 11:31 pm

You can know the current by reading the voltage drop across a resistor.
Just use a very low resistance.

wouldn't that alter the actual current coming trough the circuit?

i was looking at the ampmeter and i realised it has an output of the current as voltage. i thought i would never use the 3rd pin of voltmeters and ampmeters, but i was wrong lol.

on another issue, is it possible to get a help txt file for my custom components? without putting them in the help folder?

wouldn't that alter the actual current coming trough the circuit?

Yes, that is why you should use a very low resistance, maybe miliOhm or lower.
But if you go too low you can get some error from floating point calculations.

Maybe putting something like this in a subcircuit, the script reads voltage across the resistor, do some calculations and write the value to a Text Component:

 

i was looking at the ampmeter and i realised it has an output of the current as voltage. i thought i would never use the 3rd pin of voltmeters and ampmeters, but i was wrong lol.

You can use that pin, but it updates at "Canvas Refresh" rate, 20 Hz by default.
However in this case it might be ok.

 

on another issue, is it possible to get a help txt file for my custom components? without putting them in the help folder?

Yes, just add a txt file to your component folder with same name than the component.
For example for mycomponent.sim1 use mycomponent.txt

average_simulide_enjoyer has reacted to this post.
average_simulide_enjoyer