WireMon64

Update 29.01.2020 : Added version 0.2 with some minor improvements

You probably already know what a Dallas 1-wire bus is - if not here are a few links which tell you that it is basically a rather slow bus for different devices that will each have a unique address. The maximum length of the bus is much longer than, for example, I2C.

100 meters, for example, should be totally possible.

https://en.wikipedia.org/wiki/1-Wire

https://www.maximintegrated.com/en/design/technical-documents/tutorials/1/1796.html

I've got a small 1-wire network at my house, so here is an attempt to get my C64 connected.

What is needed is a bus master DS2482. For something like reading only a single sensor from 1-wire can be done without it but in order to handle bigger networks this is needed. There are some breakout boards with DS2482 such as the one below. Also, there are two variants - DS2482-100 and DS2482-800. Main difference being that the 800-variant can handle 8 independent 1-wire channels/networks.

DS2482 Bus Master

I ended up getting this RPI2 Raspberry Pi 1-wire adapter since it already has the RJ45 -connector I wanted. This way you can easily use ethernet patch cables to build your 1-wire network... and since you have additional wires with ethernet cables you have the option to use them as you wish.

It has the DS2482-100 variant which is fine since I only have 1 network.

http://www.sheepwalkelectronics.co.uk/product_info.php?products_id=30

Here it is attached to a breakout board (from Tim Harris) with a user port connector.

There was a small modification needed for the RPI2 - It was made for Rasperry PI which uses 3.3V logic levels so, it had a PCA9306 -level shifter to convert 5V <--> 3.3V. Since C64 has 5V logic levels (userport & cassette port) I removed the PCA9306 from the RPI2 board and wired the SCL1 directly to SCL2 on the RPI2 board and then did the same with SDA1 and SDA2 (two short red wires in the picture).

I use pretty much the same wiring as shown here:

http://www.sheepwalkelectronics.co.uk/wiring_info.php

The RPI2 adapter didn't have an input connector/pin for feeding the +12V into RJ45. In fact it only has 4 of the RJ45 connector -pins connected (VCC, GND, 1W Data and 1W GND) and since I also needed +12V to power a few motion detectors, I soldered the +12V directly into the RJ45 pin 7 at the RPI2 PCB.

If somebody is interested in trying this out, please note that you should not really put any heavy loads in this.

At the moment the wiring looks like this:

User or Cassette -port connections:

Same pins are used as described here:

https://sites.google.com/site/dividedbit/home/c64-projects/fm-radio-for-c64

While building a 1-wire network via ethernet patch cables you can get these pretty cheap adapters you can use to extend or branch the wire.

The Y-adapter is handy for adding a 1-wire device in one connector and then use the other connector to continue the main 1-Wire network.

I've used the surface mountable RJ45 box when I needed to cut a wire while passing a ceiling (like in my garage at the middle picture above). In some cases I've added the 1-wire sensor inside such a box.

Some example devices below. From left to right:

- Motion detector (DS2406 chip inside used to detect when detector voltage goes up)

- iButton reader. Currently I don't use this - In our previous place I used the iButton ID in a key chain to set our burglar alarm system ON/OFF.

- Switching a relay ON/OFF (DS2406 in a TO-92 casing is the small chip which has the PIO-A -pin connected to the relay module, GND-pin to common ground and Data pin to 1-Wire data).

Note, that when using DS2406 as a "switch" it cannot deliver current, instead it can "sink" it. Channel A PIO-pin can sink up to 50mA (check datasheet). So, for example, I've connected the DS2406 to this relay module which has the jumper set to LOW-level trigger.

The most common 1-Wire chip/device is probably the temperature sensor DS18B20 which is also available in a easy to use TO-92. The DS2406 in very handy for motitoring state changes. Connect it for example to a smoke detector, vibration sensor for intrucion detection etc...

WireMon64 application

Using the app starts from a network scanner - which lists the IDs of the found devices and the type of chip in question.

After scanning you may select the devices you which to add to your configuration and edit the parameters.

Monitor mode is the state where the status of the devices is checked according to the configuration settings you defined.

Using DS3231 RTC module is also supported (optional) to get the timestamps valid without having to enter the date / time when after starting the app. Just place it in the same userport / cassette port pins as the DS2482.

Following chips currently supported to be taken into active configuration:

    • DS18B20
    • DS18S20
    • DS2405
    • DS2406
    • DS2423
    • DS2438
    • DS2401

This is a work in progress - Some screen captures from version 0.1 below.

TODO:

    • The app is getting quite big - perhaps split the configurator and monitor into separate apps
    • Maybe enable logging the data and playing it back later... but where to log...?

Downloads: