the general project is an EDM machine, from an arduino perspective I need to be able make a pulse and read the voltage between the two electrodes(to adjust spark gap). I have the pulse system down but the reading of the voltage is giving me a real hard time. In my current iteration, I am getting "inverted" voltage readings....when the mosfet is on, I get adc vals around 200 (low I guess), when mosfet is off, I get adc vals of 1023. If you are thinking I messed up a register or am doing something wrong in software, I did too...so I put a multi meter on the voltage divider and it shows the same (1.2v when mosfet is on, 5.2v when off).
Yes that is exactly what I'd expect. MOSFET on, low output voltage.
Explain exactly what you want to achieve, and what voltages will be involved in the machine (measuring highvoltages may have other challenges).
BTW that 10k pull up on the MOSFET gate is shockingly high. Try 680 ohms for faster pulses, or use a MOSFETdriver chip instead of the NPN stage.
I'm puzzled...What's an EDM machine?Where does the 12v transformer come into this?Where is the adc connected? If connected to the junction of the 2M2 and the 220k it will see +12 , or whatever your 12v pulse supply provides whenever the mosfet is off - ie +5 on the drive to the BJT.Please complete your drawing .Allan
Since the mosfet drain is connected to ground, when ON, the source is also connected to ground, so you would have "low output voltage when ON". Also, since the whole circuit is a bit hinkey with the resistors in series with the source, you would have minimal current anyhow (5uA). Perhaps get those resistors in a parallel leg and actually connect a load to the drain. Just for testing, anything will do, like a led (and resistor). The divider would have to go on the switched side of things, so basically it has to go between the mosfet and load.
could you explain that? seems simple but I am not getting it.
EDM- gotcha - what we Brits call spark erosion.Normally done under a blanket of flowing electrolyte to take the eroded particles away.I take it you're rectifying your 12v transformer?I've never done this but so far as I understand you must supply a limited current - is there a series resistor?Allanps many years ago I patented a method of making accurate holes down to 1 micron or less . Think it's still in use for making calibrated leaks for gas detectors....
Its a low-side switch. A high side switch would be the opposite.
You are not understanding what the mosfet is doing. When there is 10V on the gate, source and drain are connected. If the source is connected to ground, then the drain is connected to ground. You will not get 12V on the drain while the mosfet is ON unless you have blown the mosfet.
Now, with the resistor divider, if there is ground attached to the bottom end (mosfet ON), current is moving through it, and you will see 1.2ishVDC at the center. With the mosfet OFF, that 12V potential extends all the way to the drain of the mosfet, also putting 12VDC to the Uno.
Perhaps update your drawing to what you have, use a SPST momentary switch for the electrodes. Show the load as a resistor.