Projects/HotTubTemp

From Hackerspace Amersfoort
Jump to navigation Jump to search

Hardware

  • CampZone2019 badge 'I-PANE'
  • Waterproof DS18B20 with 1K5 pullup on expansion VCC,GND,SDA
  • Case
  • M12 Gland

[picture]

Firmware Setup

cp -r firmware/python_modules/sha2017/onewire firmware/python_modules/campzone2019/

Software

import onewire

ds=onewire.ds18x20.DS18X20(onewire.OneWire(machine.Pin(4)))
roms=ds.scan()

def update():
  global ds
  global roms
  rgb.clear()
  rgb.text(str(system.get_vcc_bat()))
  time.sleep(0.5)
  ds.convert_temp()
  rgb.clear()
  rgb.text(str(ds.read_temp(roms[0]))[0:5])

while(1):
  update()
  time.sleep(10)