New IT forum
27 June 2022, 11:48:07 am *
Welcome, %1$s. Please login or register.

: CubieBoard 2 and Cubietruck both now in stock.
 
Pages: [1]

Author Topic: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)  (Read 9589 times)

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« on: 06 December 2012, 08:34:31 pm »

Thermal monitoring with an externally powered (as opposed to 'parasite') DS18S20 using a GPIO pin as a 1 Wire Master by software bit-bang'ing.

Solder a 3k3 resistor for pull-up onto the DS18S20 between leg 2 and leg 3 and insulate thoroughly. The resistor leads are used to extend VDD (leg 3) and DQ (leg 2) of the DS18S20, a short flying lead extends the GND (leg 1).

     DS18S20
   Bottom View
    ---------
   /         \
  | 3   2   1 |
  | |   |   | |
  --|---|---|--
    |   |   |
    |\  |   |
    | Z |   |
    | Z |   |
    | Z |  
    |  \|  
    |   |  
    |   |
        |
        |

Remove the front outer casing of the GuruPlug, disconnect the Molex power supply connector and remove the PCB.

Apply a small quantity of thermal compound onto the face of the DS18S20 and position the face of the DS18S20 against the centre of the SoC.
Solder the DS18S20\Resistor assembly leads to the legs (or just insert into the back) of the U-SNAP/GPIO socket.
Reposition the PCB into the back outer casing, reconnect the Molex power supply connector and replace the front outer casing of the GuruPlug.


DS18S20       U-SNAP\GPIO
   1      GND      8            
   2   DQ-GPIO38  10
   3    VDD 3v3    7


« Last Edit: 07 December 2012, 12:29:05 am by Confusticated »
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #1 on: 06 December 2012, 08:34:58 pm »

If the internal DS18S20 assembly has been soldered in place, the external U-SNAP/GPIO port will still be usable across all it's pins. As many DS18S20's as required may be connected externally, simply connect the external DS18S20 legs to the U-SNAP/GPIO port, the internal resistor will provide the required pull-up.

The following external temperature probe was made using a sound card lead.
Dressmaker's pins inserted through the socket and cut to length adapt it into a suitable plug.


« Last Edit: 07 December 2012, 12:32:07 am by Confusticated »
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!

apemberton

  • Full Member
  • ***
  • Posts: 187
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #2 on: 08 January 2013, 06:26:36 pm »

Thanks for that. As I have some smd SO-8 DS18S20's on hand I will have a go at your mod. Should be a bit thinner than the TO92 packages.

However, what software did you use? I assume you compiled in the 1-Wire bit-bang code in the kernel you are using, but what did you use to provide the monitoring. I am using owfs on my Rpi's but I am using a DS2482-100 to use the Rpi's i2c pins converting to 1-Wire, so a somewhat different setting. It is a pity that I havn't been able to try things out recently as I have had serious failures of two of my Guruplugs due to the batteries failing.

Logged
Tony Pemberton

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #3 on: 09 January 2013, 09:16:23 pm »

Quote
what software did you use? I assume you compiled in the 1-Wire bit-bang code in the kernel
Yes, bit-banging, I used two approaches successfully...

1) Patch the kernel to bit-bang w1 on the specific GPIO Pin used by my hardware.

2) Patch the kernel to enable the GPIO Pin, and use w1_gpio_custom to bit-bang.
    (svn://svn.openwrt.org/openwrt/branches/backfire/package/w1-gpio-custom)

both have their merits.

Quote
what did you use to provide the monitoring. I am using owfs
Access to the DS18S20 data is provided by the kernel's sysfs filesystem.
A cron script regularly samples the DS18S20, storing the data in an RRD (rrdtool).
A cgi-bin script graphs the data (rrdtool again) when accessed via lighttpd web server.

It's 'horses for courses' really, what and how you process the data from the DS18S20 ultimately should depend on what your target aim is (mine was to test the reliability of the hardware design\data sampling).
Under heavy CPU usage the 'bit-bang' may fail, but that is easily compensated for by validating the result and repeating the DS18S20 access if necessary before storing in the RRD.
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!

apemberton

  • Full Member
  • ***
  • Posts: 187
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #4 on: 10 January 2013, 02:07:41 pm »

Thanks again for that. Your approach to recording (RRDtool) is the way I have gone. I have used another Sheevaplug to run rrdtool, collecting data (wget-ting a file) from various Rpi's around the house, and I may be doing the same for any of the guru's. However if I install temperature sensing on the guru's, I would also hope to control the fans, increasing or reducing the airflow through them. That might need some sort of PWM controller or a relay control through a GPIO pin. Not decided yet and this will go on the back burner ( ::) ) for the time being.
Logged
Tony Pemberton

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #5 on: 11 January 2013, 10:10:47 am »

Quote
control the fans
My approach would be passive D2A (digital to analogue using resistor ladder) with a buffer transistor driving the fan.
Two GPIO pins would give you a satisfactory four states...
0) Off
1) Slow
2) Medium
3) Fast
There is plenty about the subject on the web (google is your fiend).
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!

canard70

  • Newbie
  • *
  • Posts: 2
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #6 on: 24 April 2013, 08:23:09 pm »

Hi Guys,

I'm trying to get DS1820 working on mine guruplug. Your description is quite short, not giving much hint how you got it working.
Could you please write few steps to follow?
The key here seams to be modification in arch/arm/mach-kirkwood/guruplug-setup.c for w1_gpio_platform_data.
Can you attach your .c file for reference?
Logged

Confusticated

  • New IT customer
  • Hero Member
  • *
  • Posts: 663
Re: Thermal Monitoring on a GuruPlug for £2.50 (The Hardware)
« Reply #7 on: 24 April 2013, 10:56:04 pm »

Quote
2) Patch the kernel to enable the GPIO Pin, and use w1_gpio_custom to bit-bang.
    (svn://svn.openwrt.org/openwrt/branches/backfire/package/w1-gpio-custom)
Edit guruplug-setup.c adding the gpio pin you wish to use to the list of others already present (used by the LED's).

Code: [Select]
static unsigned int guruplug_mpp_config[] __initdata = {
        MPP38_GPIO,
        MPP46_GPIO,     /* M_RLED */
        MPP47_GPIO,     /* M_GLED */
        MPP48_GPIO,     /* B_RLED */
        MPP49_GPIO,     /* B_GLED */
}

Then compile and install w1-gpio-custom for this kernel, there should be plenty on the web as this is non-guruplug specific.
« Last Edit: 24 April 2013, 11:05:45 pm by Confusticated »
Logged
Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!