• Re: Retropi on Nespi

    From Bbsing.Bbs@FREEWAY to Richard Menedetter on Thu Aug 1 17:01:00 2019
    Richard Menedetter wrote to All <=-


    I had a small fan. but I just bought a "Ultimate Pi cooling fan" for 8 USD. (simply a large heatsink with 2 cooling fans).
    Probably not needed but I liked its appearance, and it may stop
    throttling of the pi.

    Is your colling fan attached to pins where you controll when the fan turns on?

    Is it on all the time?

    I have one of those cases with a fan attached and the fan power is attached pins 3 and 5.

    It works great for cooling the pi, but the fan is cheap and its loud. I think I will attached a pulldown to it and setup a script to turn on the fan only if it needs to be cooled.

    +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
    | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
    +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
    | | | 3.3v | | | 1 || 2 | | | 5v | | |
    | 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5V | | |
    | 3 | 9 | SCL.1 | IN | 1 | 5 || 6 | | | 0v | | |


    --- MultiMail/Linux v0.49
    * Origin: Electronic Warfare BBS|bbs.ewbbs.net|Vincennes,IN (80:774/40)
  • From Richard Menedetter@FREEWAY to Bbsing.Bbs on Mon Aug 12 12:49:00 2019
    Hi Bbsing!

    01 Aug 2019 17:01, from Bbsing.Bbs -> Richard Menedetter:

    I had a small fan. but I just bought a "Ultimate Pi cooling fan"
    for 8 USD. (simply a large heatsink with 2 cooling fans).
    Probably not needed but I liked its appearance, and it may stop
    throttling of the pi.
    Is your colling fan attached to pins where you controll when the fan
    turns on?

    No ... same as you, fan is allways on.

    CU, Ricsi

    ... It's easier to have solutions if you don't know much about the problem.
    --- GoldED+/LNX
    * Origin: Miracle owes its origin to the negation of thought. (80:774/18)
  • From Bbsing.Bbs@FREEWAY to Richard Menedetter on Wed Aug 14 23:20:00 2019
    Richard Menedetter wrote to Bbsing.Bbs <=-

    Hi Bbsing!

    01 Aug 2019 17:01, from Bbsing.Bbs -> Richard Menedetter:

    I had a small fan. but I just bought a "Ultimate Pi cooling fan"
    for 8 USD. (simply a large heatsink with 2 cooling fans).
    Probably not needed but I liked its appearance, and it may stop
    throttling of the pi.
    Is your colling fan attached to pins where you controll when the fan
    turns on?

    No ... same as you, fan is allways on.

    CU, Ricsi

    Ok I'll come up with a solution for this.

    I think a here are some parts required for minimal required build:
    1) 1 560 ohm resistor
    2) 1 NPN 3904 transistor
    4) some wires
    .) a diagram
    .) some code see below
    .) possibly a diode.

    I did some messing around and found a fix for this annoying fan that is always on. .. mine is rattling a bit and if I can just turn it on when the cpu/gpu get hot, I can prevent a lot of noise.

    The basics of the hookup:

    [raspi pin 12]-(gpio18 3v)---(560 ohm resistor)---(npn3904 base)
    [raspi pin 6]-(ground)---[emitter (npn3904)]
    [collector (npn3904)]-(5v)---(-){fan motor black lead}
    {fan motor red wire}----[raspi pin 2]-(+5v)

    The gpio readall output helps with orientation

    -- CPU SIDE --
    +---Pi 3B+-+---+------+---------+-----+-----+
    | Physical | V | Mode | Name | wPi | BCM |
    | +----++----+---+------+---------+-----+-----+
    | | 1 || 2 | | | 5v | | |
    | 3 || 4 | | | 5v | | |
    H | 5 || 6 | | | 0v | | |
    D | 7 || 8 | 0 | IN | TxD | 15 | 14 |
    M | 9 || 10 | 1 | IN | RxD | 16 | 15 |
    I | 11 || 12 | 1 | OUT | GPIO. 1 | 1 | 18 |
    | 13 || 14 | | | 0v | | |
    P | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 |
    O | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
    R | 19 || 20 | | | 0v | | |
    T | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 |
    | 23 || 24 | 1 | IN | CE0 | 10 | 8 |
    | | 25 || 26 | 1 | IN | CE1 | 11 | 7 |
    | | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
    | 29 || 30 | | | 0v | | |
    | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 |
    | 33 || 34 | | | 0v | | |
    | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 |
    | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 |
    | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 |
    +----++----+---+------+---------+-----+-----+
    | Physical | V | Mode | Name | wPi | BCM |
    +---Pi 3B+-+---+------+---------+-----+-----+
    -- USB ETHERNET SIDE --

    I used Edoardo Paoloa Scalafiotti's code with minor modifications
    basic code begin -- base64 begin --

    IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMgojIEF1dGhvcjogRWRvYXJkbyBQYW9sbyBTY2FsYWZpb3R0 aSA8ZWRvYXJkbzg0OUBnbWFpbC5jb20+CiMgbW9kIGJ5OiBCQlNJTkcKIyBtb2RpZmljYXRpb25z IHJlcXVpcmVkIHRvIHdvcmsgd2l0aCBvcHRvIGlzb2xhdG9yIFBDODE3CiMgb3JpZ2luYWwgd29y ayB3aXRoIGhhdmUgYSBjb21tZW50IG5leHQgdG8gZGVwcmVjaWF0ZWQgb3IgdW51c2VkIGNvZGUK CmltcG9ydCBvcwpmcm9tIHRpbWUgaW1wb3J0IHNsZWVwCmltcG9ydCBzaWduYWwKaW1wb3J0IHN5 cwppbXBvcnQgUlBpLkdQSU8gYXMgR1BJTwoKcGluID0gMTggIyBUaGUgcGluIElELCBlZGl0IGhl cmUgdG8gY2hhbmdlIGl0Cm1heFRNUCA9IDU1ICMgVGhlIG1heGltdW0gdGVtcGVyYXR1cmUgaW4g Q2Vsc2l1cyBhZnRlciB3aGljaCB3ZSB0cmlnZ2VyIHRoZSBmYW4Kc2Vjb25kc3RvaG9sZGZhbiA9 IDE4MCAjYmJzaW5nIC4uIGFsbG93cyBzeXN0ZW0gdG8gY29vbCBvZmYgYmVmb3JlIGNoZWNrIGFn YWluCgpkZWYgc2V0dXAoKToKICAgIEdQSU8uc2V0bW9kZShHUElPLkJDTSkKICAgIEdQSU8uc2V0 dXAocGluLCBHUElPLk9VVCkKICAgIEdQSU8uc2V0d2FybmluZ3MoRmFsc2UpCiAgICBy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c2xlZXAoNSkgIyBSZWFkIHRoZSB0ZW1wZXJhdHVyZSBldmVyeSA1 IHNlYywgaW5jcmVhc2Ugb3IgZGVjcmVhc2UgdGhpcyBsaW1pdCBpZiB5b3Ugd2FudAogICAgICAg IHNsZWVwKDcpICNiYnNpbmcgLi4gbWFkZSBhIG1vZGlmaWNhdGlvbiBoZXJlLCBzZWUgYmVsb3cK ICAgICAgICAjYmJzaW5nIC4uLiBhYm92ZSB3YXMgbW92ZWQgaW4uIEkgZG9uJ3Qgd2FudCB0byBj aGVjayBBRkFQIHRlbXAgZ29lcyB1cC4KZXhjZXB0IEtleWJvYXJkSW50ZXJydXB0OiAjIHRyYXAg YSBDVFJMK0Mga2V5Ym9hcmQgaW50ZXJydXB0CiAgICBHUElPLmNsZWFudXAoKSAjIHJlc2V0cyBh bGwgR1BJTyBwb3J0cyB1c2VkIGJ5IHRoaXMgcHJvZ3JhbQo=

    -- base64 end --

    run the code above using sudo:
    sudo ./raspi.fan.control.basic.py

    I tested this with the above parts and code.
    My system usually runs about 49 deg celcius.
    I test this with stres via:
    stress -v -c 4 -t 900s

    to install stress type the following:
    sudo apt update && sudo apt install stress

    If you want a systemd script for this let me know. Thats probably best if you just want the entire thing to run at startup.

    NOTE: I found if I don't slow down the execution loop that will drive the cpu use up and increase cpu temp. I also added a sleep gate to allow the system to cool below the threshold I set to keep the npn3904 from micro triggers.

    If anyone sees and issue with the wiring setup let me know.

    ... BBSING
    --- MultiMail/Linux v0.49
    * Origin: Electronic Warfare BBS|bbs.ewbbs.net|Vincennes,IN (80:774/40)