Interfacing

BPI SoftPWM for a fan

8 947
rvdns11  
Hi everyone,
I have a BPI set up for media streaming etc. Now I want to cool the Pi with an external powered fan with softpwm. The PWM-Cable of the fan is attached to GPIO 0 (Phys. Pin11). Unfortunately, I have no expiriences with python or C/C++. Is there a script available for softpwm for a fan?
The fan is called Arctic Cooling AF
Max RPM 1500
12V

Many thanks in advance for your help and sorry for my bad english :-)
tkaiser  
Edited by tkaiser at Mon Jul 27, 2015 10:26

Based on the idea outlined in this post http://www.lemaker.org/forum.php?mod=viewthread&tid=11167 (defining a PWM pin and setting a value between 1 and 100) I wrote a script a few hours ago that uses a simple formula to derive the PWM value from the thermal value of the PMU (more realiable than the SoC's temperature):
  1. #!/bin/bash

  2. CheckTimeInSeconds=5
  3. MaxTemp=55000
  4. MinTemp=40000
  5. TempDiff=$(( ${MaxTemp} - ${MinTemp} ))

  6. while true ; do
  7.     read CurrentTemp </sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input
  8.     AdjustedTemp=$(( $(( ${CurrentTemp} - ${MinTemp} )) * 100 / ${TempDiff} ))
  9.     if [ ${AdjustedTemp} -lt 1 ]; then
  10.         AdjustedTemp=1
  11.     elif [ ${AdjustedTemp} -gt 100 ]; then
  12.         AdjustedTemp=100
  13.     fi
  14.     # AdjustedTemp=$(( 101 - ${AdjustedTemp} ))
  15.     echo ${AdjustedTemp} >/sys/class/pwm-sunxi/pwm0/duty_percent
  16.     sleep ${CheckTimeInSeconds}
  17. done
Copy the Code


The outcommented line "AdjustedTemp=$(( 101 - ${AdjustedTemp} ))" would invert the value. Now when temperature is below 40°C then duty_percent will be set to 1 and if temperature rises also this value will be increased. If you uncomment this line it would work the other way around: Setting duty_percent to 100 when 40°C or colder and decreasing it constantly when the temperature rises towards 55°C.

And maybe there's a mistake since values of 0 should also be possible to completely shut the fan off (easy to fix: just replace 1 with 0 two times and change 101 to 100)

tkaiser replied at Mon Jul 27, 2015 13:25
Based on the idea outlined in this post http://www.lemaker.org/forum.php?mod=viewthread&tid=11167 (d ...

Great job!

rvdns11  
Many thanks for your script
Will test the script in this week or next, i have to do my school stuff etc.

rvdns11  
Thanks, it worked perfectly as expected.
Thanks!

abc20180506
adidas yeezy boost
moncler outlet
air jordans
uggs
ferragamo shoes
coach factory outlet online
polo ralph lauren outlet online
louis vuitton
coach outlet store
moncler coats
kate spade
puma shoes
ugg australia
kate spade outlet store
rolex watches
canada goose uk
kate spade outlet
pandora jewelry
coach factory outlet
yeezy boost 350
air jordan shoes
mulberry bags
ralph lauren uk
vans store
canada goose jackets uk
converse shoes
converse outlet store
jordan shoes
north face outlet
air max 2018
moncler jackets
canada goose outlet
nike air max
pandora charms sale clearance
birkenstock
yeezy boost
coach outlet online
mlb jerseys
coach outlet
adidas outlet
mont blanc pens
ralph lauren sale clearance
coach outlet store
ray ban sunglasses discount
fitflops
coach outlet
mcm outlet
prada handbags
tods outlet
hermes outlet
nike store
cheap jordans free shipping
mbt shoes
pandora jewelry official site
michael kors outlet
kate spade outlet store
polo ralph lauren outlet online
polo ralph lauren outlet
nike free 4.0
polo ralph lauren outlet
coach factory outlet
cheap nike air max
coach outlet
canada goose outlet
polo outlet
hermes handbags
louis vuitton handbags
uggs canada
adidas yeezy
kate spade outlet
adidas shoes
ugg boots on sale
polo ralph lauren outlet
oakley sunglasses
nike zoom
tory burch outlet online
coach outlet
mulberry handbags
pandora jewelry official site
nike huarache
ray ban sunglasses
pandora
nike outlet store
adidas yeezy
new balance shoes
cheap nfl jerseys
adidas superstar
jordan shoes
adidas nmd
nike outlet
birkenstock outlet
canada goose
canada goose sale
supreme clothing
louboutin shoes
ralph lauren sale
ralph lauren outlet
kobe bryant shoes
timberland outlet
coach outlet
michael kors outlet canada
louis vuitton outlet
nike shoes
pandora jewelry
nike outlet online
cheap jordan shoes
nmd adidas
rolex watches
fitflops
adidas yeezy
michael kors outlet
philipp plein outlet
yeezy boost
nike free run
uggs
tory burch outlet store
hermes bags
kevin durant shoes
pandora jewelry outlet
air max 97
christian louboutin outlet
coach outlet store
coach outlet
pandora outlet
pandora charms
coach factorty outlet
pandora jewelry
coach outlet
supreme clothing
ralph lauren outlet
abc20180506

2018.9.10zhouyanhua
barbour jackets
dsquared2 jeans
hermes outlet
kate spade outlet
nike outlet
jimmy choo shoes
asics running shoes
beats pill
mac makeup
christian louboutin
nike store
michael kors canada
g-star jeans
michael kors
sac longchamp
timberland
true religion jeans
james harden jersey
burberry sunglasses
versace handbags
pandora rings
burberry bags
longchamp
converse
nfl jerseys
ray ban sunglasses
salvatore ferragamo shoes
basketball jerseys
lebron james shoes
nike vapor max
adidas zx flux
antonio brown jersey
ray ban sunglasses
burberry outlet
prada outlet
adidas slides
jordans
air zoom pegasus
toms outlet
sac vanessa bruno
asics gel lyte
longchamp handbags
nike roshe
scarpe nike
michael kors outlet
adidas outlet
kd 9
karen millen
fendi sunglasses
nike air max
tory burch
nike air max
pandora bracciali
christian louboutin
pandora jewelry
bijoux swarovski
hollister outlet
jordan
adidas superstar
rolex watches
dior handbags
nike free run
bathing ape
chloe sunglasses
nike shoes canada
stuart weitzman shoes
marc jacobs handbags
kristaps porzingis jersey
canada goose jackets
jordan shoes
converse
nike blazer
nike blazer
valentino shoes
guess handbags
nike outlet
gucci outlet online
chanel
prada handbags
mizuno running shoes
polo ralph lauren
wedding dresses
fendi
adidas originals
sac michael kors
swarovski jewelry
dolce & gabbana sunglasses
air max 95
adidas outlet
sac burberry
soccer jerseys
air max 90
kobe 12
kobe 11
nike air max
gucci shoes
converse shoes
air max 95
timberland
lunette ray ban
2018.9.10zhouyanhua

michael kors purse
breguet watches
balenciaga sandals
coach outlet
cheap jerseys
supreme clothing
ugg boots
ugg outlet
kobe 12
burberry sale
ysl sunglasses
giuseppe zanotti
michael kors outlet
valentino shoes
marcelo burlon
jordan 8
snapback hats
moncler jackets
canada goose sale
ralph lauren outlet
nike outlet
tag heuer watches
canada goose
nike mercurial
uggs outlet
kate spade purse
uggs outlet
mac cosmetics
kate spade outlet
swarovski crystal
nike kd 10
cheap nfl jerseys
adidas wings
birkenstock shoes
coach outlet
ugg outlet
michael kors outlet clearance
undefeated clothing
links of london
nobis jackets
ugg sale
football shirts
christian louboutin shoes
jordan 3
pandora jewelry
converse shoes
longchamp outlet
nike air max
nike shoes
ugg outlet
ralph lauren
timberland
mont blanc pens
nike flip-flops
kate spade outlet
mulberry handbags
canada goose jackets
ugg boots
longchamp
ray ban sunglasses
moncler outlet
michael kors handbags
valentino
lebron soldier 11
flip flops
pandora jewelry
philipp plein
louboutin
nike outlet
columbia outlet
ugg clearance
ralph lauren
michael kors outlet
ugg outlet
alexander mcqueen
y3 shoes
tiffany rings
beats by dre
fjallraven outlet
supra shoes
lebron 15
longchamp
coach factory outlet
nfl jerseys wholesale
running shoes
tom ford sunglasses
lee jeans
stussy clothing
coach wallets
police sunglasses
adidas ultra boost
ugg for men
nba jerseys
jordans
coach outlet online
ugg outlet
hundreds clothing
north face jackets
birkenstock
supreme new york
coach outlet
chenyingying20180912

ponor  
Note: The author has been banned or deleted.

You have to log in before you can reply Login | Sign Up

Points Rules