Logo Banner

FEZ - Control K8000 with FEZ

Control your K8000 with a FEZ

Introduction

It is possible to connect a FEZ with a Velleman K8000 board. Doing so you can use your old K8000 without the need of a running computer. The FEZ acts here like the old Velleman K8001 but is way more powerful: programming is done in C# instead of some restricted assembler language. As the K8001 is no longer available with Velleman, the FEZ is a nice replacement! With $40 the FEZ costs also less than the 8001 used to cost.

Connection between FEZ and K8000

The connections between the Fez Panda II and the K8000 are easy to make: you only need to interconnect the SCL,SDA and GND lines. SCL and SDA are used for the communications: Serial Clock, Serial Data. They are two lines that are connected to the +V through a pull-up resistor. Unfortunately the K8000 and the FEZ are operating on a different supply voltage: the K8000 operates on 5 VDC, while the FEZ operates on 3.3 VDC. So, some voltage adjustment is required. This can be done with a simple electronic circuit:

.

Note: it is advised to use this converting circuit but it is no absolute requirement if you are using a FEZ Panda II. The hardware pins of the FEZ Panda II can handle 5V.

I didn't design this circuit but I found it in the I2C specifications from Philips (the company who invented the I2C protocol). The design is very easy: you need only 2 FETs and 4 resistors. The left side of this voltage adjuster is connected to the FEZ, the right side to the K8000. ( the left side should always be connected to the device with the lowest voltage, which is the FEZ). Q1 and Q2 are FETs (Field Effect Transistor). They should be handled with care during soldering as they are very sensitive to static discharges (ESD).

You can plug two JST3AA connectors onto the FEZ Panda II: there is a separate connector for the SCL and SDA lines. Each connector has 3 connections: GND (black), SIGNAL (white) and +3.3V (red). You need to connect those to the left side of the I2C voltage adjuster. The Velleman K8000 has a 5P screw terminal: there is a connection for the +5V, GND,SCL,SDA,DIS. You should connect all but the DIS to the right side of the I2C voltage adjuster. Then your K8000 is properly connected to the FEZ.

Like mentioned earlier the FEZ has some JST3AA connectors. You need the right plugs before you can make connections with the FEZ. The JST connectors are produced by JST, which stands for Japan Solderless Terminals. I bought my connectors at Farnell*. Here are the reference numbers for Farnell:

9492429 B3B-PH-K-S(LF)(SN) Connector at the PCB
3616198 PHR-3 Empty plug housing
1671245 SPH-002T-P0.5S Contacts for the housing

(*) Farnell takes orders from private users but they require you to order for a certain minimum amount of money. Alternatively you can order them at Conrad.

k8000 library for the FEZ

Now your K8000 card is connected with the FEZ, you need to create a program for the FEZ. This is quite easy as I have created a library with standard functions to control the K8000. In fact the functions are exactly the same as in the libraries that were provided with your K8000 card: I just rewrote the code from BASIC to C#, to make it work with the FEZ.

It is very easy to use my library. The sample belows show the minimal code to generate a simple light effect where the outputs LEDs are one by one activated:

Minimal code to output the LEDs

I also engineered a project where you can control the K8000 over an Ethernet network. In this project the FEZ Panda II acts as a bridge between your LAN network and the K8000. I wrote some server software to run on the FEZ and some sample client software to run on any computer in your network. Read more about the project...

Advantages over the K8001

Using the FEZ instead of the K8001 offers you a lot of advantages. First of all the FEZ can be programmed very easily. But the FEZ also has an RTC clock, an microSD card reader, an Ethernet connection, ... Basically you can use it to do whatever you want.

Downloads

Here you can download the files for this project. The FEZ C# Library is the C# library file with all functions for the K8000. The C# sample project is a complete Visual C# project that demonstrates how to use the K8000 class.

The C# class is fully functional: the class is being used for real home automation applications and the code is proven to be stable. It is a real equivalent to the original Velleman code.

Copyright ©1998-2022 Vanderhaegen Bart - last modified: August 24, 2013