How to simulate Electrodermal Activity Sensor

Hi,

I am very new to kicad, and its tools so bear with me and have some patience while I try to learn Kicad and all the amazing things it can do! Beforehand, thank you for your help!

I am a master’s student who is going to make a sensor that can measure electrodermal activity (EDA) and electromyography (EMG) simultaneously for my master’s thesis. I have been able to simulate the circuit I will use to measure EMG, but not the circuit that measures EDA. For the EDA measurement, I have been trying to simulate the skin by using a variable resistor that changes with time as I am doing a transient analysis. But that is easier said than done. I have been searching all over the internet on what to do, but as you guys may know, the documentation and the user-friendliness isn’t the best. From what I found out I can use a “bscource” as kicad does not have any thing for a varying resistor. But honestly now I am stuck on what to do. How does I use the “Bsource”? I have been looking into the simulation model editor to try and edit and manually write what I want the component to do. But it does not help either that I also have 0 knowledge about ngspice or spice syntaxes. Like I said, all help would be appreciated, even a small knock in the right direction on how to use the simulation is enough to get me going.

Thank you!
Sincerely
Daniel

Article about the EDA circuit I am using

Hi Daniel: Welcome to the kicad forum.

You have an interesting project there. I can’t comment much on the ngspice question other than to say that years ago I uses a spice PWL voltage source (with one side grounded and a resistor across it to keep the node happy) to define an arbitrary time-dependent node voltage that I used to control other elements – perhaps there is more modern element that does something similar.

The problem with spice simulations is that you make assumptions to enter into your circuit. You want to model the skin interface but that is more complicated than it first looks. If you simply want to model varying skin resistance over time and see how your circuit reacts perhaps that is fine. However, I would recommend just doing a bunch of bench work with a scope and soldering iron.

I design eeg systems, and we use silver-silver-chloride electrodes and a conductive paste. This is a pretty good interface but is still subject to a dc offset (google half-cell potential) that can be hundreds of millivolts – if you want response down to dc you need to handle it (we ac-couple at about 0.1 Hz). The nominal skin resistance at each electrode can vary based on how well it is pasted, and can be 5k or 500k. I think you time will learn more with bench testing and tweaking than trying to simulate. Or at least to develop a decent model to put into your simulation.

This is getting way out of kicad-related content, so anything further should be off-list, but hopefully someone chimes in with some ngspice insight for you.

That has to change of course if you want to do serious simulation.

For an example of a time-based resistor please have a look at my examples at Simulation examples for KiCad8/KiCad9/Eeschema/ngspice , after scrolling down a bit to the boost converter.

And you may have a look at the ngpice manual, to be found at Ngspice, the open source Spice circuit simulator - Documentation: manual and control flow, especially at its chapter 3.3.4.