Pwm fan on zynthian

well that seems to work.
one bc108c, a 680 ohm resistor, GPIO14 and set for 60 degrees :slight_smile:

The final zynthian conclusion is to use GPIO pin 13 or GPIO27 in old money. This is referenced in the discussion below.

Oh please do share some stuff regarding this, the noise ( :face_with_monocle:) and type of fan used and such

is what it all fitted in so it needed a fan that would fit the mounting points in the case so it needed to be 25mm * 25mm
I bought a 5V one from amazon which didnā€™t have any fancy PWM connections or such like, and fitted it, directly to the 5v line in the Pi.

It was LOUD ā€¦ :-(, disturbingly soā€¦
so I connected it to 3.3V which was much more acceptable, but since I leave my zynthā€™s on most of the time this seemed a pretty effective way of chewing the bearings up pretty quickly.

So I added a BC108 in the 0V side of the circuit with the emitter connected to 0V & the collector connected to the ov side of the fan and drove it from GPIO 14 on the edge connector.
This was all assembled on a small bit of veroboard and joined to the appropriate pins with thin wires with heatshrink over it to avoid shorts and the GPIO pin driving the base of the transistor via a 680 ohm resistro.
Fire up the Pi and go into the performance section and enable the fan, setting the temperature to 60 degrees and hey presto, the fan starts up with the Pi then turns off as the green LED starts to flicker.
A soon as the Pi reaches 60 degrees on comes the fan, which Iā€™m still connecting to the 3.3V rail. Not a problem as there isnā€™t any thing else connected to the GPIO header in this zynth ( a 60 W amplifier known as zynthian-amp4.local).

We are using it for piano and strings via MIDI and also for playing backing tracks for a wedding.
Seems pretty good, and the temperature settles around 55 degrees or so.

I wont put up the veroboard as itā€™s not the nicest piece of work, held in place using one of the Pi boards mounting screws, Iā€™ve ever done but it fits in the case and works ā€¦ !

3 Likes

Course, at the moment, once itā€™s on it doesnā€™t turn off, because the off temp is 50 degrees which is presumably as close to an ā€˜officialā€™ Pi temperature as you might find.

Thus indifference to reopening it is turning it into a fan endurance test. There ainā€™t no fighting entropy ! :smiley:

So, at last a view inside the weird and wonderful of zynthian-amp4.local to itā€™s friends. . .

I intend to try to mount banana pillars on to the fan face as well to avoid the irritations of having to take a screwdriver along with it, but itā€™s nice to have a 60W zynthian which I can drive from an hdmi terminal and a mouse.

For those that tend more towards the wanton destruction end of the dark underbelly of zynthian development, I include a picture from the Ever expanding dungeons of shame for the following, harrowing picture of a BC108 living vicariously from a meagre 3.3v being made to work in unspeakable conditions by harsh unfeeling users, with nothing but a 680 ohm resistor to keep it company . . . .

image

Course if I need an excuse to try it on 5V to see if we can actually reduce the fan life at the expense of some noise. . .

Decisions, decisions. . . ā€¦

A raven slowly flaps across shot, caws once and exits stage left bared by a pursuit. . .

Well it seems that 5V gets it down to a temperature where it will switch off, after bringing it down from 60 degrees. Obviously it only needs to touch 50 degrees to turn off the fan, and let it cycle. Iā€™ll let it amble along with no load on it ( No irritating MIDI or audio playback/record going onā€¦) if it doesnā€™t need to turn the fan on then that looks pretty optimal. Well done Daniel :slight_smile:

Donā€™t reckon the banana connectors are viable in the available space.
The next attachment would seem to be a mono guitar lead to USB as a pure input.
This has all the makings of a PA. . . .

Entropy, entropy, theyā€™ve all got (it) entropy!

has Carry On made it to the outside world ā€¦?

Things have ,as they inevitably do, moved on in this regard and this is now handled by a zynthian moduleā€¦

whih is fired up by a systemd serviceā€¦

Itā€™s now moved to GPIO 13 by default but lives nicely within the zynthian infrastructure.

given the noise of the fan in my configuration I would lke access to the temperature thresholds via something webconfish but such real estate is a valuable resource so I might just have to cobble the individual file.

Is this still a viable option and does it work on the current zynth?. It seems to be a python 2 programme

Do you mean V5?
It doesnā€™t need a fan in any case. The thermal block is much better, silent and never breaks.

If you mean the last stable, it should work :wink:

Regards!

1 Like

Yes I fully appreciate this is a purely open source concern, but it isnā€™t always the hardware implementation used. This is going in a church and it all runs warm without overclocking.


Iā€™ve run it without it kicking in, but I can toggle the fan with RPi. GPIO on PI PIN 13 ( GPIO.BOARD). No sweat I will dig some moreā€¦

1 Like

I simply didnā€™t know what did you mean with ā€œcurrent zynthā€, jeje!
I see you meant the ā€œlatest stableā€ :wink:

AFAIK, nothing has been changed that could break the ā€œpwm fanā€ config.

Cheers!

1 Like

staging-2307ā€¦

Itā€™s workingā€¦!

systemctl enable zynthian-pwm-fan

A MUCH quieter fan and a cool box!!!

2 Likes

Itā€™s amazing where you can squeeze a fan. . .

zynfan

1 Like

Gotta love those back EMFs! (Thatā€™s what the diode is for - to stop the fan motorā€™s sudden change of state in producing energy that would destroy the transistor - for those who are interested!)

2 Likes

Please, can someone competent suggest some alternatives to the BC108c? Unfortunately, this particular type is not available in my local store ā€œon the cornerā€, and I suppose almost any NPN can do the job in this case, but I donā€™t want to buy blindly and I donā€™t know which parameters are crucial. I noticed e.g. the BC547(a/b/c/ā€¦), but it has a much lower hFE value (problem or not?).

The same applies also for the diode, but I suppose the common 1N4148 could be enough.

A 2N4401 or 2N2222 will do the job. The 2N4401 has a higher collector current limit of 500mA compared to the 2N2222. This higher collector current rating allows the 2N4401 to handle medium loads more effectively. But handling the fan current the 2n2222 or almost any NPN transistor would be OK. I donā€™t think the hFE value would be at all critical, the transistor just has to be fully turned on which isnā€™t particularly difficult even for the puny logic level output of the GPIO pin.

For the diode Iā€™d want to use a power diode - anything in the the 1N400x series such as 1N4001 1N4002 1N4003 1N4004 1N4005 1N4006 1N4007. I donā€™t know if a small signal diode like the 1N4148 or 1N914 would be ā€œgood enoughā€.

1 Like

Thanks a lot! 2N4401 is easy to get. And I also have a bunch of 1N4007 in the drawer!

1 Like

They were my goto transistor in my synth building days. BC547ā€™s are probably my second reach, with 2N2222 following them as time has moved on
. These are all switching applications so the hfe is only really a factor in the tiny sliver of time as the transistor races from one supply line to the other. It will spend almost all its days at those two extremes so the characteristics of the transistor have little effect.
Most parameters for devices are at the extremes of operating performance and unless you are designing Guitar input stages for Raspberry Pi based music platforms it shouldnā€™t worry too much. Just spare a thought for those down in the zynthian development swamp.

Power characteristics are probably the largest differenciator but again itā€™s just switching, so you are not operating the device for any length of time in itā€™s linear range, the bit where it can apply analog amplification or control.

And itā€™s always worth remembering that they are constructed, measured and then thrown into the appropriate bins to be printed, and sold from there.

Not so much crafted as sortedā€¦

Oh, and I thought they just started doing this with the CPUsā€¦ :smiley:

Yep! Any BC108 or BC547 will do and 1N4001 for the reverse bias protection. 1N4148 doesnā€™t have the power rating to sick the high EMF induced current.