Fan control of Raspberry

Written by pmd - - no comments

Hardware

Python3 program

I have red a lot of pages how to control a fan using PWM signal.
Some of them:

 

Finally, it seems my fans don't have much effect on the temperature. About 5°C. So I decided to set an hysteresis:

  • Switch ON fans if temperature > 75°C
  • Switch OFF fans if temperature < 60°C
  • Do nothing if 60°C <= temperature <= 75°C
$ nano gpio_test.py
#!/usr/bin/python3
# -*-coding:Utf-8 -*

import os
from gpiozero import LED
from time import sleep
import RPi.GPIO as GPIO

fanPin = 2
testMode = False

def getCPUtemperature():
    res = os.popen('vcgencmd measure_temp').readline()
    temp =(res.replace("temp=","").replace("'C\n",""))
    #print("temp is {0}".format(temp)) #Uncomment here for testing
    return temp

try:
    GPIO.setwarnings(False)
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(fanPin, GPIO.OUT)
    myPWM=GPIO.PWM(fanPin,200)
    myPWM.start(0)
    GPIO.setwarnings(False)
    while True:
        if testMode:
            duty_cycle = input("Nouveau PWM (%) ? ")
            myPWM.ChangeDutyCycle(int(duty_cycle))
        else:
            temp = float(getCPUtemperature())
            if temp > 75:
                myPWM.ChangeDutyCycle(100)
            elif temp < 60:
                myPWM.ChangeDutyCycle(0)
            else:
                pass
            sleep(5) # Read the temperature every 5 sec, increase or decrease this limit if you want
except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
    GPIO.cleanup() # resets all GPIO ports used by this program

Set linux service

$ nano /etc/systemd/system/manageFan.service
[Unit]
Description=start fan management at system startup
After = network-online.target
Wants = network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /home/pi/gpio_test.py

[Install]
WantedBy=multi-user.target

Fix audio amplifier

Written by pmd - - no comments

Links

English

https://jestineyong.com/how-to-repair-amplifier-no-sound/
https://jestineyong.com/about-shorted-transistor/
https://audiokarma.org/forums/index.php?threads/blowing-a-power-transistor-root-cause.196876/
https://www.thegearpage.net/board/index.php?threads/what-causes-power-transistors-to-fail-solid-state-amps.945586/

French

https://www.pascalchour.fr/ressources/repar_ampli/repar_ampli.htm
http://jeanluc.rigal.free.fr/reparer_un_ampli_hi-fi.html
http://www.bedwani.ch/electro/ch14/index.htm

Russian

https://forum.cxem.net/index.php?/topic/74746-романтика-15-120-с-hi-fi/
https://forum.cxem.net/index.php?/topic/117997-романтика-15-120-с-hi-fi-не-работает/
http://radiostorage.net/3225-usilitel-romantika-15u-120-50u-220-stereo.html

What happened

The amplifier is a Романтика 15-120С. It sounds quiet nice but sometime the sound gets no so clear either on right or left speaker.
To fast improve sound quality, I unpluged and replugged AUX input 3.5 jack. Dumb but done. One day it resulted on no more sound at all.

I quickly found dead fuse F3. I took one of the fuse of the other channel and F3 died again. Dumb but done.

I put 2 working fuse on left channel, and 2 dead fuse on right channel. Switched on the amplifier. Left channel is working. Good.

After reading internet, I quickly suspected that power transistor of the right channel were shorted. It was the case.

Test a transistor


How to test a TRANSISTOR with a multimeter PNP or NPN
How to check fuses, diodes, transistors, voltage regulators
3 Ways to Check Capacitors in Circuit with Meters & Testers

Troubleshooting (eyes+multimeter)

Le fusible FU3 de l'alim +27V cramé.
Les deux transistors de puissance VT3 et VT4 en cours-circuit.
 => +27V s'est vidé en quasi direct dans le -27V (R23 et R24 de 0.22ohm sur le chemin)
R15 et R20 cramées sur la carte principale.
R17 et R23 cramées sur la carte module de la voie droite.

Power transistors that were in service before the problem

Left channel (working), original ones:

Right channel (not working), not original ones:

Intervention

Remplacement des transistors
PNP A1941 => A1943
NPN C5198 => C5200
Les nouveaux sont un peu plus gros. Il me reste à les coller sur le radiateur (je n'ai pas pu reprendre les anciens mica).

Remplacement des résistances sur la carte principale
R15 et R20. J'ai mis des 1/4W en comparant visuellement...
Ces résistances servent à prévenir l'utilisateur qu'un certain niveau de puissance a été atteint à travers l'alimentation d'une LED.

Remplacement des résistance sur la carte module
R17 100 ohm je voulais mettre 1/4W mais le vendeur n'avait plus que du 2W.
R23 0.22 ohm. A la base la résistance avait une forme de ressort (j'imagine que ces résistance doivent avoir une petit propriété inductive ?). Le vendeur n'en avait pas. J'ai hésité entre 2W et 5W. J'ai mis une 2W de forme classique.

Power transistor replacing broken ones

Fixed!

To make new PCB

https://www.pcbway.com/

Futur ?

Maybe i could use stuff like this to repair last stage: Amplifier Board - AIYIMA A2D847

 

Rss feed of the category