Showing posts with label 1-wire. Show all posts
Showing posts with label 1-wire. Show all posts

Thursday, 19 February 2015

TinySensor Server

Well after almost a year I decided it was time to update this project with improvements to both its hardware and software.

On the hardware side, the server is still the original Raspberry Pi model B, but I've mounted the nRF24L01+ radio on a neat little Slice of Pi board. (These boards also have traces for mounting XBees with their unusual pin spacing. And they're cheap!)

The Slice of Pi board (left) with radio and status LEDs
While I had the soldering iron out, I added a couple of status LEDs (see picture). The green one indicates recent activity on the radio, while the red one indicates a timeout but also flashes every time a packet is received. Both of them are driven by a single GPIO line on the Pi. (This was motivated by the radio cutting out on the Pi, probably due to the original Heath-Robinson jumper cable arrangement, and since its transplant it's behaved perfectly.)

On the software side, there are now quite a few little daemons, each doing one thing well:
  • A wireless hub, running RF24-rpi, sends packets received on a TCP socket,
  • A wired hub, running remotely, polls a legacy 1-wire sensor network and sends its readings on another TCP socket,
  • A multiplexor, connected to the two data sources above, sends their streams to its connected clients, described next,
  • A MySQL client writes readings to a database,
  • A status client manages the LEDs described above,
  • An RRD client maintains a round-robin database,
  • An lcdproc client updates a wireless LCD display.
All of these are, as usual, on GitHub.

Future software components planned for this system include a simple weather service to inject local weather data into the stream, and a client for one of the various IoT services now becoming widespread. (Here is a fairly recent overview of some of these.)

Wednesday, 25 May 2011

One-Wire Mains Switch



The schematic shows a one-wire controlled mains switch. One-wire is a simple protocol which is typically used for networks of temperature sensors. (The diagram is a simplified version of a circuit by Simon Atkins.)

Features of this circuit are:
  • The diodes on the left provide surge protection, for those occasions when your network is hit by lightning.
  • The DS2406 is active-low, the LED is entirely optional.
  • The RC pair at the far right is called a snubber. It is used for inductive loads (e.g., electric motors) when the current is out of phase with the voltage. The resistor should be rated at 1W and the capacitor 400v.
  • The resistor R3 is required to limit the current through the opto-isolator during the instant of time when it is conductive but before the triac has switched on.