-
Notifications
You must be signed in to change notification settings - Fork 19
Sequent Microsystems Boards
tagyoureit edited this page Sep 8, 2021
·
15 revisions
The Sequent Smart Fan can be used to cool your Raspberry Pi.
The Smart Fan should show up on ID 3 for the first fan, or ID 4 if you change the jumper to make this a second fan.
Once you save the device the following information/options will be available:
- Hardware and firmware version
- CPU Temp - Unlike the BAS/BAH, the Smart Fan does not have built in support for reading the Raspberry Pi CPU temperature. To input this temperature, create a feed from the BAS/BAH or use the
CPU Temperature (Linux)
generic device.
- Fan Temp - Temperature that the hat senses (not the Pi CPU)
- Fan Power as read from the hat as a percentage 0-100%
- Fan Safe Temp - This temperature can be set and if the Fan Temp reaches this temperature, the Fan Power will automatically be set to 100%. Note - values will convert if you change the units but acceptable ranges are 30-80°C, 86-176°F, or 303°K to 353°K
- Units - Can be set to Celsius, Fahrenheit, or Kelvin. Note - this only changes the display value; the hat will always be sent values in Celsius.
- Blinky Light - Turns on/off the light on the Smart Fan Board. When enabled, if the fan is off, the LED blinks 1 time per second; when the fan is turned on, the LED blinks between 2 to 10 times per second, proportional with the speed of the fan.
- Polling Interval - How often (in ms) should the script run to read the values/update the fan power.
- Fan Power Script - This is a plain javascript function that enables you to be as creative as you want in setting the fan speed. The backend code will round any decimals to the nearest integer and bound the values to 0-100%.
The script has access to the following variables:
- values.units - C, F or K.
- values.fanTemp - Current temperature read by fan hat (in selected units)
- values.fanPower - Current set fan power (1-100)
- options.readInterval - Amount of time (ms) between script evaluation and device polling
- options.fanSafeTemp - See above
- options.blink - See above
- options.units - [Use values.units in favor of this]
- info.cpuTemp - CPU Temperature from incoming feed, if enabled
Examples:
- Off:
return 0;
- Constant power @ 33%:
return 33;
- Stair-step based of fan temp:
if (values.fanTemp > 100) { return 33; } else if (values.fanTemp > 120 { return 50; } else if (values.fanTemp > 150 { return 100; } else return 0;
- Linear progression based on cpu temp:
// will start at 100 degrees and constantly increase speed until 180 degrees at which point it will remain at 100%; // will evaluate to 0 below 100 because of the bounding on REM let slope = 1.2 / 1; return slope * info.cpuTemp - 120;
- Log curve based on cpu temp:
// will start at ~100 degrees and increase logarithmically until 180 degrees // Plug this into a graphic app like Desmos.com: y=a\log_{b}\left(x-h\right)+k let b = 1.6; let a = 10; let h = 100; // lower bound of temperature; below this will be 0 let k = 5; let logBase = 1 / Math.log(b); let log = Math.log(Math.max(0.1, info.cpuTemp-h)) * logBase; // the Math.max is necessary to avoid infinity or isNaN errors return a*log + k;
- Exponential curve ramping up with hotter temps:
// will start at ~100 degrees and increase logarithmically until 180 degrees // Plug this into a graphic app like Desmos.com: y=a\left(1.025^{x}\right) let a = 1.6; let b = 1.025 return a*(Math.pow(b,info.cpuTemp));