Hi Folks, I did some smaller mistake in my Hardware "design" as I soldered

Hi Folks,
I did some smaller mistake in my Hardware “design” as I soldered a small Board to switch Fans and Lights With D47 D45 D43 and D41
The Board Works as expected but Digital HIGH turns the light off and so on. in Most Cases this is not a Problem as i turn them on by Terminal anyway.
Just with the CONTROLLER_FAN. I thought is must be easy to invert this in Firmware but did not find any till now… could someone Help me here or lean me in the right direction?

Clear simple Question: I Want D45 “CONTROLLER_FAN” to be Off if the Steppers need cooling…

Thanks in advance…

Ah and this is Marlin 1.1-daily complety rearanged Pins on kinda like RAMPS 1.4

I’m not aware of a way to invert fans in Marlin.

Hm. I dont want to invert the fans the question is (very simple spoken) if ther is a way to tell marlin or arduino that a pin HIGH should be a pin LOW on a certan pin. Maybe in the pins.h file or whereever the pins in marlin get initialized…

Just declare that pin on arduino as output and give value low by using
pinMode(pin_no, OUTPUT) ; // Declare as output.
digitalWrite(pin_no, LOW) ; //Declare that pin as low.

@Anil_Choudhary thanks, but where would i put That in Marlin? it would just put the pin LOW right? it is not controlable via M42 or the Firmware right?
think i just redo the Hardware…

Actually i dont know what marlin is. But i know arduino. By searching on google i get to know that marlin is a firmware for 3d printing. Could you send me the code so that i understand and help you out in program. If you want to low the pin by using M42 command then use this
M42 P2 S0 // pin no. 2 will get LOW

M42 P2 S255 // pin no. 2 will get HIGH

yes this is actualy working, but. normaly the FW (marlin) would controll the pin state as “if steppers are enabled set pin X High for 30sec at 80%” for example, this also works, BUT I wont Pin X be Low when the steppers ar active because the Hardware triggers my PNP transistor on on a LOW pin so currently a can controle these, but if the FW controlles them they are on if everything is cool or off if they are needed
you can grab the code from

this is about the Pont I think it could be changed

If it possible then try to make a change in hardware rather then in program. I suggest you to use npn transistor or use logic gate not by using transistor. Below are few image this may help you.

Not gate using transistor for inverting. missing/deleted image from Google+

Npn transistor circuit. missing/deleted image from Google+

This may be type of your circuit which you used in your hardware. missing/deleted image from Google+

@Este_ban_S , line 13627, and 13628; – change it to

analogWrite(CONTROLLER_FAN_PIN, 255-speed);

Essentially this would invert the value.

At 0, the equation would be “255-0”, which would be 255.
At 255 equation would be “255-255”, which would be 0.

That might work as far as a custom solution for you.

It’s a dirty hack, but you’re already diving through custom pin numbers and such.

3D printer controllers usually use N-channel MOSFETs. They feed your + rail to your device +, and the FET turns on the device by pulling down the - side of the device to ground. It’s worth looking at the FET part of 3d printer controller schematics to make a good design.