Controlling 50 fans RAMPS 1.4
February 22, 2016 09:55PM
Hello all,

This is my first time posting on here so I figured I would give it a go. This project has no real practical application to my knowledge. But I just want to see if it is possible. I'm a mechanical designer, and often want to exparement with ideas. My main problem is my lack of electrical and programming knowledge. Ok enough about that, here is the problem.

I would like to have the standard setup for controlling my 3d printer with the standard ramps 1.4 and the ardunio mega. On top of this I was wondering it it was possible to control 5, 10 or even 50 fans. I was wondering if you could turn different ones on and off at a random time programed with M codes.

It's just a thought challenge really.

Edited 1 time(s). Last edit at 02/23/2016 08:43AM by Cliint.
Re: Help with an Idea
February 23, 2016 06:45AM
Do you need simple on/off or pwm control?

On/off = use shift registers as IO expanders.

If you can use the same pwm for all enabled fans then use shift registers such as 74hc595 to enable individual fans, and have the pwm triggering OE pin. This will cause the outputs to go high z while the pwm is high. A lot of pull down resistors then ensure the fans are off during high z.

If you want 50 individually programmable fan speeds then I suggest you look for pwm capable io expanders. I do not know their numbers, but I know that Intel Galileo gen1 uses some.

By the way... Help with an idea is basically the topic of the whole forum. Something like controlling 50 fans would have been more descriptive. :-)
Re: Help with an Idea
February 23, 2016 08:42AM
It would be just a Simple on off, no adjustment of fan speed would be require. Would you be able to use M codes to turn these on and off?

Sorry for the title, I was not really thinking as I just finished a long day at work. Thank you for your help, it is truly appreciated.
Re: Controlling 50 fans RAMPS 1.4
February 23, 2016 12:04PM
You will probably need to modify your firmware for that. I don't know if any of the current firmwares has spi targeted M codes in them.

Otherwise you may be able to bitbang spi over a few gpio, using existing M codes for each level change. While this is terribly inefficient and slow, you will probably change fan states once every several seconds, so it should be a functional solution.
Re: Controlling 50 fans RAMPS 1.4
February 25, 2016 05:35AM
You might need to add a flight controller just incase the thing takes off smiling smiley
Re: Controlling 50 fans RAMPS 1.4
February 25, 2016 07:06AM
Thank you for you suggestions. I am having a hard time finding reference to modifying the firmware to add M codes. Would anyone have a good source? Or even an example?

Also, what pins would best be used with the ardunio when it is connected to the ramps 1.4?

I will tie this thing down so it is not to take off.
Re: Controlling 50 fans RAMPS 1.4
March 28, 2016 07:34AM
My question is... are you going to control all that fans while 3D printing?
If not, you could ditch the RAMPS board and go with another shield that exposes all its I/O pin. (Google Arduino Mega shield to give yourself an idea)

As for firmware modification, you should find the code that handles G-code and M-code, modify the code to accept your custom G-code, and set an action when that code is received.
The location of the code, along with the difficulty to modify it, varies between firmware,
Re: Controlling 50 fans RAMPS 1.4
August 08, 2016 09:53AM
Not sure if anyone follows, but - there is quite a number of available I/O pins on RAMPS. Not 50, but still plenty.
You can set each one to your likings - e.g. I am using pin 36 to control the lights for the printer, so my webcam can "see" something using
M42 P36 S255
to turn pin 36 on, and
M42 P36 S0
to turn it off.
Works no problem.
There is ~16 pins at the end of RAMPS ready for use, there is 5 more for servos, you can use pins for unused extruder, too and there is PS-ON pin.
And, if none of this works, you can always expand the number of pins using 3 I/Os and serial-to-parallel expansion. Will not be very fast or efficient, but will work.
Re: Controlling 50 fans RAMPS 1.4
September 26, 2016 03:48PM
Thank you rklauco, that will get me started.
Re: Controlling 50 fans RAMPS 1.4
February 09, 2017 07:25AM
Nice Idea
Re: Controlling 50 fans RAMPS 1.4
November 20, 2018 05:59PM
It's not difficult to get a program on the arduino with a command line interface (google it). Basically you could send text messages through the serial port over usb through a terminal client or even the one included with arduino ide (serial monitor iirc). The most basic is a program that checks if a character is pressed on the keyboard and turn a pin on or off. I use this all the time on pic microcontrollers for debugging and control. It's much easier than to try to hack a 3d printer firmware for sure. Start small and build it up piece by piece.

I'd connect transistors capable of switching 1A and 12V or even easier use an transistor array ic like uln2003. Connect 12V to the supply rail, connect arduino pins to logic level inputs and outputs 12V. You can connect the fan directly to the uln2003 output. It has 7 drivers, so use as many uln2003s as you need. Just google arduino uln2003. Lots of diagrams to get you started. Ie a lot of results will be examples of driving a stepper motor. Instead of a motor wire the + of the fan to one uln2003 output and the - to ground or supply -.

Edited 1 time(s). Last edit at 11/20/2018 06:00PM by imqqmi.

Kind regards

NFAN CoreXY printer:
Sorry, only registered users may post in this forum.

Click here to login