rayjorgensen
Member
I'm using a Teensy 4.1 My ultimate goal is to use PWM to control a bunch of solenoids, but first I need to get one working. I started with analogWrite and that didn't seem to work for me so I backed up to starting with the blink sketch. Just bit-banging it.
I'm using this Mosfet module (I can't buy the parts this cheap). The solenoid is powered by 12V. I can blink a led so it's working but I can't activate the solenoid. I even powered the VCC pin with 3.3 from the Teensy and also tried with 5V. If I use the same code on an arduino powering from 5 V, the solenoid will run all day even without VCC powered.
I'm out of ideas. Any ideas will be appreciated. Thanks
Code:
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(15); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(15); // wait for a second
}
I'm using this Mosfet module (I can't buy the parts this cheap). The solenoid is powered by 12V. I can blink a led so it's working but I can't activate the solenoid. I even powered the VCC pin with 3.3 from the Teensy and also tried with 5V. If I use the same code on an arduino powering from 5 V, the solenoid will run all day even without VCC powered.
I'm out of ideas. Any ideas will be appreciated. Thanks