Running out of available spots to attach a heated bed, hotend or a fan we do thankfully have the option to use one of the General Purpose Input/Output (GPIO) pins on the MKS Sbase and combine it with a Solid State Relay (SSR) to power the attached device.

Please correct me if I use the GPIO term in error here. I am not educated in electronics :)

I am not going to use a standard SSR, but instead a Power Expander. I'm using the Power Expander as it is really small and more effective than any SSR out there.

Why PWM pin

I am going to use a PWM pin to control some 12v fans on my 24v system and need the ability to adjust them up and down and not just on and off.

If we just wanted to turn them on and off, we could use the analog pins on the upper left corner of the board, labeled J8. One of them is a Gnd as well, making it really easy to set up.

At a later point, in the very near future, I am going to make another instructable using a standard SSR and one of the non-PWM pins to turn an attached fan or led on and off.

Step 1: Finding an Available PWM Pin

Aside from the PWM pins allready packed with a Mosfet (heaters and fan outputs) our EXT2 output has 2 PWM outpus and we also have one in our J8 pin group in upper left corner and an unused one from E1, unless you use all 5 drivers.

PWM-pins list and location

  • P1.23 - J8 pin upper left corner
  • P2.12 - E1 - Epsilon external driver pins. Upper right-ish corner.
  • P3.25 - EXP2 lower right side where an LCD might go.
  • P3.26 - EXP2 lower right side where an LCD might go.

See the photo for exact location.

Note:If you are using a SmartController (LCD) it is connected to the EXP2 and you can not use these PWM pins for other things. They are used to turn the controller back and forth

Step 2: Configuring Smoothieware to Use New Pin

Configuring firmware is one of the easy things when we talk Smoothieware.

In my photo I have listed all of our available PWM pins and uncommented the ones I do not use.

You can see how I have uncommented the standard FAN pin 2.4 and enabled the pwm pin on E1; 2.13.

Now we just need to do the wiring.

Step 3: Wiring Sbase to Use Our New Settings

PWM pins on Sbase delivers 3.3v or so and is considered + in regards to wiring.

Note: I recommend using wires easily recognizeable when doing electrical and electornical things. Like red for power/+/vin and black for -/gnd.

Sbase to Power Expander

Now simply connect your red dupont wire to the PWM P2.13 and lead it down to the signal/control + on the Power Expander. Do the same for your black wire from GND to -.

DC input

I use a smallish 12v 3amp DC-DC converter which I have configured to give 12v output. I draw wires from + and gnd to the Power Expanders input + and - respectively

Note: Do use a converter with more amperage than you want. Many out there are much lower than this 3amp version.

Note: if you are going to use the same voltage as you have in your system in generel: meaning you just use PowerExpander as a sort of Mosfet to add an extra device, you just skip the DC-DC converter.

DC Output

Now you simply draw lines from +/- output to your fan. I recommend you do a measuring using Multimeter while setting output speed on your fan.

Crimping wires

Instead of just twisting your wires, I recommend finding some sort of pin to terminate it with instead. I mostly just use the male dupons pin which can be bought very cheaply, for these thin wires. Then put some heatshrink on it to cover exposed metal.

I use some larger pins for my bigger wires, but do not know the name of those, as I buy them locally.

Have fun!

Now your all set up, and everytime your controller starts the fan, it is going to activate the PowerExpander, which will power the fans with 12v instead of our normal 24v :)

<p>Hi Dintid,</p><p>I was long searching for these details. Thanks for such excellent write ups with MKS sbase boards. I am using this board in my printer as well and it seem to have worked pretty well so far. I have one question though. I am presently using dupont style JST connectors for the connections which is rather flimsy as this board needs 2.54mm pitched xh-JSTs. I tried to crimp some with spare XH receptacles but horribly failed wasting some of them. The connectors you are using are these pre-crimped or have you crimped it? What crimp tool do you use to get it done?</p>
I have crimped my own motor wires. I usually start using a needle-clamp (I think it's called that. I'm danish). I then use a very cheap crimp tool I bought in Biltema (Scandinavian store). But it's the same as any cheap crimp tool you can buy anywhere. <br><br>Sometimes tweak it with my needle-plier after crimping to make it fit into the plugs.
<p>Thanks for sharing. The fact that there is just a fraction of PWM enabled pins available on MKS SBase compared to the original Smoothieboard is a big downside to me. I have it running on a cartesian printer with servo-based probe and dual extruder. So P1.23 and P2.13 are used, fan out as well (for heatsinks). I now have to sacrifice the LCD for the hotend / print fan(s). That is a shame, as a couple of extra pins surely would not break the manufacturing budget. Otherwise, it is a quite nice board tho.</p><p>On a related subject: I cannot get a <a href="http://buy.geni.us/Proxy.ashx?TSID=13213&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0100A6KFS%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0100A6KFS%26linkCode%3Das2%26tag%3Dcircbasi-20%26linkId%3DLQUK7WR2N2JEWEEQ" rel="nofollow">SRD-05VDC-SL-C 5V Relay</a> to switch my PSU on / off. Relay is always on (NC). These are the settings in my config.txt:</p><p>switch.psu.enable true<br>switch.psu.input_on_command M80<br>switch.psu.input_off_command M81<br>switch.psu.input_pin_behavior momentary #probably not required<br>switch.psu.output_pin 1.27ov! # Y_Max Endstop; <b>tried all options and combos: open drain, pull-down, inverted to no avail. Maybe pin is missing capabilities??</b></p><p>switch.psu.output_type digital # on/off only</p><p>Any ideas, pointers?</p>
Hello Googliola. <br>I believe you can run must of the gpio pins as pwn though not as true &quot;hpwm&quot; setting? Just a thought?<br><br>I really do not know about the on off stuff. I always turn my printer physically on/off, and it sounds like you are more at home with the configuration than me ?<br><br>I'm sure you can ask on smoothies google groups on how to use it. They might have an idea. Just don't start out with &quot;hi, I'm using MKS Sbase board...&quot; ?
<p>From the ARM CPU point of view those signals are GPIOs (General Purpose Input/Output), the Pn.nn designation is the original ARM signal names on the chip itself, so you can know exactly which ARM pin you are using. <br>In the smoothieware design they are all assigned to a specific function but it's only a name written on the board and within the config file. <br>The config file design is enough flexible to allow you to use them as general purpose as well so to redefine their assignment. It's an advanced feature for people who knows what they're doing. It's a very smart design and I personally like it more than adruinos based boards.</p>

About This Instructable




Bio: I'm blogging about my projects before they make it to Instructables.com Once I've finished a subject on my blog, I'll put ... More »
More by dintid:Sbase/Smoothieware - Use a Free PWM Pin and Power Expander or SSR to Control Fans. Setup External Driver on Smoothieware Sbase 1.2 Controller using E1 pins! Smoothieware Switch module for automatic fan control 
Add instructable to: