I'm completely new to arduino so I've read some articles (https://www.instructables.com/How-to-Control-a-MOSFET-With-Arduino-PWM/, Adam meyer | Arduino + N-Channel_MOSFET) about controlling a mosfet with PWM output so my question is would I be able to control the EMCO from the porportional output of the MOSFET? The MOSFET is rated at 60V so if I analogWrite(255*5/60) would that equate to a output of 5v on the MOSFET and therefore 1500kV from the EMCO? I am new to electronics and could not find exact tutorials online for the EMCO, so I am assuming this is wrong. please tell me what is the correct way to do this, all help is appreciated
The high output (100%) is obtained from analogWrite(255). But the EMCO requires a steady input voltage and some input current (650mA), not a PWM signal. Some sophisticated electronic circuit is required for control of the EMCO.
I'd assume the PWM output goes to the MOSFET, which outputs steady voltage. When I tested my voltage between the drain and the source pins, its outputing ~2V so then technically according to the input vs output voltage map it should be outputting 600V but its not, so I'm wondering if my circuit might be wrong. My code is attached below:
void setup() {
// put your setup code here, to run once:
DDRB |= (1 << DDB1) | (1 << DDB2);
TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM11);
TCCR1B = (1 << WGM12) | (1 << WGM13) | (1 << CS10);
OCR1A = 3240;
ICR1 = 8191;
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
delay (1000);
if(OCR1A<=3740)
OCR1A +=1500;
else
OCR1A -=500;
Serial.println(OCR1A);
}
a simple MOS-FET regardless of the type beeing N or a P-type is "outputting" the full Vcc
if the MOS-FET is switched to beeing conductive
and is "outputting" 0,00 V if the MOS-FET is switched to beeing non-conductive
Depending on the MOS-FET type the MOS-FET must be connected between Vcc and the EMCO
or
must be connected between ground and the EMCO
If you measured 2V on a simple digital multimeter (in short DMM) the DMM made the conversion from PWM to "steady analog voltage" and showed a constant voltage.
If the PWM-frequency is high the DMM can not follow the fast on/off-switching of the voltage
Depending on the size of these batteries the required current of 650 mA can not be provided by small batteries.
Even if you use batteries of size D (Mono) such batteries wil be empty after
10Ah / 0.65A = 15 hours.
So what type of MOS-FET are you using? Post a datasheet or at least the type-number
Did you check if the gate of this MOS-FET becomes fully conductant at 5V?
What I think you are trying to to is to vary the high output voltage according to a 0 - 5v input, correct? The data sheet says the control input is high impedance so no buffering is needed, just say a 10k resistor from a pwm pin to the control input and a 47 microfarad capacitor from there to gnd, to smooth the pwm to a dc level.