OpenWrt Forum Archive

Topic: Router Temperature Controller

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Inspired by the good folks at https://forum.openwrt.org/viewtopic.php?id=32516 I decided to build a prototype Router Temperature Controller.
I used an old AR430 (AR2713 cpu) I had in my old junk bin.

I used http://tinyhack.com/blog/2010/04/04/d-l … nd-sd-mod/ as a guide to find the GPIO's.

Quick note, this can ruin you router so proceed with caution.
Also you need some skill and tools so judge accordingly your on your own.

Key parts are a MAXIM DS1621 and an optocoupled FET SPST solid state switch AVQ251, cpu 12 volt fan, power supply etc.
Other misc components, resistors, capacitors, LED, etc are needed.
In Canada these are available from Digikey.

A drawing is available at http://imageshack.us/photo/my-images/401/routerfan.jpg/



I can also send an OpenOffice odf drawing upon request.

I haven't tried it yet but you should be able to adapt this to other routers.


Double check and triple check all your wiring. Things can go "poof" real quick.

For the software and configuration I did a new build from trunk for Atheros.

I included these packages with out Luci:
custom build for ar2317 atheros
ATTITUDE ADJUSTMENT (bleeding edge, r29471)

i2c-tools - 3.0.3-1
gpioctl - 1.0-1
kmod-i2c-algo-bit - 2.6.37.6-1
kmod-i2c-core - 2.6.37.6-1
kmod-i2c-gpio - 2.6.37.6-1
kmod-i2c-gpio-custom - 2.6.37.6-2
kmod-i2c-mux - 2.6.37.6-1

From the above link I used GPIO 3 and 4.
Set the GPIO pins that you have selected:
echo i2c-gpio-custom bus0=0,3,4 > /etc/modules.d/58-i2c-gpio-custom

After a restart I did check dmesg and verify:
i2c /dev entries driver
Custom GPIO-based I2C driver version 0.1.1
i2c-gpio i2c-gpio.0: using pins 3 (SDA) and 4 (SCL)

Find address of I2C device:
root@OpenWrt:~#  i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

So I can see my I2C address is 0X49, kool!


Test the SD1621 device:
Start Convert         EEh
i2cget 0 0x49 0xee  w

Read Temperature     AAh
i2cget 0 0x49 0xaa  b

Write Config
i2cget 0 0x49 0xac 0x0a w    
Verify with a read
i2cget 0 0x49 0xac  w

Set High Temp point
i2cset 0 0x49 0xa1 0x1e b
Verify with a read
i2cget 0 0x49 0xa1  b

Set low Temp point
i2cset 0 0x49 0xa2 0x1c b
Verify with a read
i2cget 0 0x49 0xa2  b

Monitor fan or  led to verify operation.

I have changed the high and low temperature setpoints and they work on the fly.
If you power down the router and temperature controller you will have to restart the temperature controller however it will keep going once set.
The configuration is in EEram so it stays even on power down.

The router has no further burden except for the start and configuration changes.
I did verything from the console.

I hope this helps someone..


~john

Your text in the image is pretty damn small, so maybe I will give you some wrong references.
I don't see a purpose for the 50 ohm resistors and the 0,01µF (?) capacitors on SDA/SCL. I've seen resistors used with high cable lengths, but that also requires special drivers (like PCA9600), and the capacitors are normally just representing the capacity of the cables, they are not placed. In fact, the capacitance is what you want to avoid for a good signal.

Thanks for the reply MBS.
You are correct about the picture. First time I used pastebin.
I hoped it would be better hence my note about sending an .odg drawing is someone wants it.


Actualy the chip I used was from a small industrial controller and I hacksawed it out of the circuit board.
These chips were on the board I used.
The 50 ohm resistors and small surface mount capacitors form a simple low pass filter blockig noise into the temperature chip.
The clock speeds are fairly slow so there is not much loss.

I thought of removing them but did not want to muck up the circuit board but as you say they could probably be eliminated.

The prototype is still running great through all night. Cylces on-off about every 70 seconds with a temperature at 28 C plus or minus 2 degrees.
Ambient temperature is about 21 C degrees.

I'll try this on one of my servers that run hot in the summer and see how it does.

~john

The discussion might have continued from here.