KRANENBORG.ORG
  • Home Page
  • I am a Maker
  • On Architecture
  • CV Jurjen Kranenborg
  • DD-Convection (Ph.D.)
  • Login

Electronics (Philips EE) and Microcontroller-based projects (PICAXE, ZBASIC and MicroPython)

This local website contains all information on the Philips EE and microcontroller-based projects that I have been running, with my eldest son Joost being involved sometimes as well. Regarding microcontrollers, I use the PICAXE, ZBASIC and - recently - MicroPython microcontroller types, quite different but excellent systems for building applications based on the BASIC (and Arduino/C++) or MicroPython language. I often use my childhood's Philips EE system for prototyping for both practical and nostalgic reasons, and therefore it has a sub-blog by itself. 


PONGSAT-18X: Picaxe-based satellite

NLSE-1Everybody wants to make a space trip, so my son Joost and I joined as well, that is, a trip to near space (31 kms high), through the "Pongsat" service offered by JP Aerospace. 

To this end we built our own small (nano?) satellite called Pongsat-18X, named after the microcontroller in it. It was made to fit into a pingpong ball (which was a requirement for taking part in JP Areospace's journey). The satellite is filled with a Picaxe-18X microcontroller (a simple 8-bit controller from Microchip with a BASIC interpreter and program bootloader added), EEPROM memory, a rich set of digital and analog sensors and of course a small but special battery.  It made recordings of temperature and other parameters each twenty seconds, stroring them in memory. Joost wrote the core of the program, I added some details to it and designed the electronics, as shown below:

A large number of sensors were included:

  • A digital temperature sensor (DS18B20),
  • An analog temperature sensor (as a double check, particularly for very low temperatures in the troposphere area),
  • A simple tilt and an equally simple mechanical vibration sensor (relating tilt and vibration levels to wind speed),
  • Two leds that can act as optical sensors (by reverse charging them and then measure the charge decay rate) and ... as leds,
  • A voltage reference that can be used to monitor the battery voltage (which is particularly important for low temperatures - in which case the satellite can be put into sleep mode im order to keep the battery voltage above the critical level). 

Here are some views of its actual implementation (including top and bottom views). Note that the battery is mounted under the circuit board (it still fitted!) and therefore not visible in the fully assembled state:

 

Read more: PONGSAT-18X: Picaxe-based satellite

"SerialPower" True Two-Wire Network

The Picaxe "SerialPower" Network combines power delivery and bi-directional communications between processes (max. 255) on intelligent, microcontroller-based battery-less nodes. This can be physically implemented using just two interchangeable (preferably twisted-pair) wires. Simple diode-mixing networks with separate power and communication wires are supported as well. Here my favorite, simple Picaxe microcontroller has been used for the implementation. The picture below shows the essential hardware concepts of the network:

A master node provides for power as well as "timeslots" - all supported through the network protocol - during which processes on nodes can exchange messages with each other using a standard format. The slave nodes are powered from the network and only need a backup capacitor. Both master and slave nodes can be implemented using any available Picaxe type and this implementation can be easily ported to other simple 8-bit microcontrollers.
At power-up the network software at the master node automatically registers all processes on slave nodes that wish to send messages on the network. In this way, timeslots are automatically generated by the master node for all of them (and additonal timeslots for different processes can be generated on the fly as well).

In the simplest first version a message format with two databytes is supported, for use with very simple applications. A second version allows any message between 1 - 32 bytes to be transmitted. In that case, power provision to the nodes is managed in between the transmitted bytes (using short pulses) as part of the protocol as well, still allowing very small backup capacitors in the slave nodes to be used in any application. An impression of the second message format is shown here:

Processes may be distributed over several nodes. In the example below, temperature sensing process #11 at the middle slave node calls display process #2  located at both another slave node and the master node to display its measurement data.  Given the particular node's resources (e.g. lcd display, sound), display process #2 has local implementation variants: 

LogicalViewNetwork

I created a separate website with all the information required to understand the concepts and to implement applications. It can be found here: SerialPower Website. The related discussions on the Picaxe Forum can be found here: SerialPower on Picaxe Forum

Mahjong points calculator

CalcBox3.jpgThe popular Mahjong game (4 players using ivory bricks) uses a points reckoning system that balances the individuals' scores in a certain way so that the net result always equals zero. This process is rather tedious and requires the person who is calculating to be "decoupled" from the ongoing social conversations, which destroys one of the nice aspects of the game. Therefore it is a good candidate for automation. My oldest son Joost and I undertook the project of implementing such a calculator in ZBasic hardware using a ZX328L and a simple matrix keyboard and an LCD display. This project was a nice opportunity for both of us to jointly learn object-oriented programming.

The project is a nice example of the flexibility and power of the ZBasic platform, as shown for example by: 

  1. The use of the FirstTime command to show a welcome text only a few times,
  2. The use of the AN105 code for interfacing the matrix keyboard, providing for a very fluid behavior of the keyboard in practice, 
  3. Object-oriented programming as a useful way to easily include functionality (for example: LCD display routines are used through the mix-in concept).

The true fun is with the functionality as provided by the software (V5.1 as a zipped ZBASIC project) and the project casing. The QR-code on the box links to a page in Dutch where I explain how the calculator works and how scores per individual are calculated first, which are then used as input for the calculator.

The calculator became somewhat of a visual attraction point and since the Mahyong game is quite a thing in my family I ended up making several units, including the following for my three sons:

From an electrical perspective this project is rather straightforward: a Z328L microcontroller with keypad and LCD display interfaces as shown here:

Read more: Mahjong points calculator

PICAXE and ZBASIC code contributions

Here follow a number of code contributions (snippets or small projects) to the PICAXE and ZBASIC user forums that may be of use for or provide inspiration to others:

PICAXE

  • The PICAXE (28X2) as a central element of a VLF receiver (15.8kHz - 80kHz), providing both the receiver frequency (in a Direct Conversion Receiver architecture) and the antenna tuning: A Philips EE VLF receiver (16 - 80 kHz) with digital control
  • Flexible AXE133/134Y setup (using 4-pin communication with the display module), thereby allowing the Serial Display to be more generally used as a computer with a display, with configurable PortB pins
  • PICAXE-08M2: Picaxe Cicada: A showcase of what a 08M2 is up to when connecting it to several sensors and output devices. This may provide some inspiration and references for the use of various sensors in projects.
  • PICAXE-X2 series: Accurate Frequency Counter (0 ... 65MHz). Additions/improvements submitted by others.
  • Any PICAXE: Frequency generator 10kHz - 60KHz (or higher/lower frequencies by using higher/lower clock frequencies and/or the PWMDIVxx parameter for the PWMOUT command)
  • PICAXE M2 variants: Fast spike detection (and programmable noise canceler): This approach allows to detect very fast spikes (optionally: above a certain noise level) using an interrupt (much faster than the Picaxe's polled interrupt system generally can, since in that case they are only recognized when occurring exactly in between Basic commands), and probably equally fast as the hardware X2 interrupts. It uses the SR-Latch bit as a memory which is set active by the spike, subsequently the latch output generates a polled interrupt. Additions/improvements submitted by others.
  • PICAXE M2 variants: "Non-Interruptible Pause": This example code shows how in an interrupt-driven program a pause functionality of one or multiple seconds can be implemented (since normally an interrupt will cause an executing PAUSE command to directly finish without completion). The example shown here allows interrupts to be used to collect information in a given time interval. The M2's free-running timer is used to implement an "non-interruptable", one-second pause.
  • PICAXE M2 variants: Accessing comparators on the PICAXE-18M2: The PICAXE M2 variants have one or two independent comparators (see Microchip's datasheet) which, although not directly supported by the COMPSETUP command like with the X2 variants, nevertheless can be configured with the same flexibility through direct POKESFR and PEEKSFR register operations. The example code is for an 18M2.
  • Small PICAXEs (08M2 & 08M): Single-paper Picaxe-08M(2) programming quick reference (including troubleshooting): Not so much of a code snippet, more of a "documentation snippet". Presented is a single-paper overview of the main programming concepts (symbols, registers, most important commands, Picaxe pinout and troubleshooting) for a 08M(2). It may serve well in the class room as a quick reference and help guide, I have been using it to give my middle and youngest sons an introduction to Picaxe. MS-Word version available for download to tailor to one's specific needs/opinions. This contribution was motivated by Manuka's "cheat sheet" concept.
  • MicroBot (BOT120): asynchronous RC control using interrupt on IR receiver input: Here is a small change suggestion regarding the mounting of the IR receiver extension to the popular MicroBot (BOT120), which may make the use of IR remote control of this bot much more flexible, simply by changing the mounting position of the IR receiver. It then becomes possible to implement real asynchronous remote control by using an interrupt (active low) on this input. As a result the Microbot does not have to wait for input from the RC but can in its main body program do all kinds of useful things continuously and will at the same time react immediately whenever a RC key is pressed.
  • Any combination of PICAXE-types: Automatic Clock Frequency calibration/finetuning: The two code snippets given here (for a master and a slave Picaxe, connected to each other via a 1K or larger resistor) cause the slave node internal resonator frequency to get aligned with the master node's frequency.
  • PICAXE-18X: This code shows how on the highly configurable PICAXE-18X any of the output pins can be converted to input pins (logical), or two of the output pins to ADC inputs, effectively allowing a maximum of 5 ADC channels on the 18X: Converting 18X output pins to inputs (logical or ADC)

Read more: PICAXE and ZBASIC code contributions

Philips EE (Electronic Experimentation) kits

The Philips EE series of kits have been developed by Philips Electronics from the sixties (the EE5/EE10 and EE8/EE20) till the eighties (EE3000) in various forms, and became very popular in various European countries, notably Germany and the Netherlands. Initially these kits were used to promote Philips-produced electronic parts to hobbyists, but at the end of the sixties the focus shifted towards educational purposes: the kits were intended to interest teenagers in studying electronics. As a result the series gradually developed into the most advanced electronic experimentation kit type that has been available ever, with designs that include several superhet radios, an oscilloscope and even a TV! Tor Gjerde has presented a great and very detailed presentation of the complete range of series at his website that I highly recommend for a visit.

The Philips EE category - also accessible through the "I am a Maker" menu item on the top of this page - contains all of my contributions on this subject.

 

 

 

IR-controlled Airport model

AirPortOverviewIn a joint project my son Joost and I built an airport model a while ago (Joost built and painted the hardboard-based construction, I took care of the electronics part). The model includes 68 programmable LEDs, all of them in three main landing and departure tracks as well as the support tracks. This is probably the one-and-only remote-controlled airport available on the globe that can be steered by a Sony RC!

Read more: IR-controlled Airport model