Making a Stir Plate (Controlling the Motor)

Making hydroponic Nutrient Solution requires stirring the concentrated liquid solutions before they are added to water in the mix tank. To accomplish this I want to use a stir plate. This consists of a 80mm computer case fan with magnets glued (with E6000 adhesive) to the fan hub. In the container is a stir bar which also has magnets in it. The case fan is placed as close a possible to the bottom of the container while still allowing clearance.

The problem: Using a relay to just switch ON the case fan will cause the stir bar to dislodge from the case fan magnets.
The Solution: When the stir plate is to be put into operation the motor starts out at a MIN value of lets say 35%. This is because the fan motor wont start turning below this value. Then the value will slowly increase to a MAX value of lets say 85%. Operate at 85% for X amount of time then slowly ramp back down to lets say 25% and then OFF. I have a IRF520 mosfet device to handle the 12VDC motor.

What is needed: Can anyone show me the XOD nodes and their configuration that would be required to accomplish this task?


You want to use PWM (Pulse Width Modulation) to control the motor. You can use pwm-load (which has an ACTive pin) or pwm-write (which uses an UPDate pulse instead). A VAL of 0.35 will equate to 35%

I have button to flip flop to pwm load to the IRF520 mosfet. The pwm load is set to .35 and the motor runs a a reduced speed after pressing the button. After experimenting for a while I found that a .15 setting would start the fan.

However when the button is pressed again and the flip flop is false the fan continues to run.

I would like to start at a low point slowly increase to a high point, run for a bit then ramp back down or just shut off. Can you suggest how I might accomplish this.

Thanks again

I would need to see your code to determine why the fan doesn’t turn off.

To gradually change a value over time, the “fade” node is probably your best option. My recommendation is to switch between 0 and your max value, but fade fast enough the fan has no chance to burn out while it is below startup speed; otherwise you will be leaving it “on”, but below startup speed when it is supposed to be off. This will cause a slight delay before stirring starts, but you can probably fade fast enough without losing your stirrer that it will not be an issue.

I have been trying map and map clip but haven’t been able to get it to work as planned.
This screenshot is of the False scenario when the program boots the fan will start at 35%. When it is True the fan will go to 85%. When False again then it goes back to 35% but not OFF.

I don’t know if the screenshot came through it is showing the location on my end


Sounds like it is working as you intended, unless you want it to go to off. If you want it to go all the way to off, you will have to use 0 for Tmin. If you are having trouble that your fan doesn’t actually run, it is probably because pwm-load-ACT is false; you’ll need to change it to true.

If it HAS to jump from 0 to 0.35 and from 0.35 back to 0 (there is some reason you can’t just let it fade between those values), you will have to put extra logic after fade to use 0 if fade output is <0.35.

This is probably the simplest solution, but there will be a delay when you turn it on until fade output reaches 0.35 as it fades up from its low value. If Tmin=0.34, then that delay will be very minimal.

By the way; since your map node is taking 0 or 1 input and mapping it to min & max value, you could just use an if-else node. 0 is interpreted as false & 1 is interpreted as true. if-else-COND will be output of flip-flop. If-else-T will be high value. if-else-F will be low value.

Thanks gweimer for your help!!!

This is what I came up with which starts the motor at .38 slowly ramps up to .85 and holds at that speed. When the flip flop goes False then the motor slowly ramps back down to .38 where it shuts off.
Note: on the pwm-load no link to the ACK terminal.

You have helped me to learn a bit more over the weekend

Your Awesome