ZX Spectrum on Altera DE2-70

Monty on the Run (DE2-70)

Laurent Mitnik has ported my FPGA Sinclair Spectrum to the Terasic DE2-70 board, and has very kindly allowed me to publish his changes.  The port is based on the 200110901 release from the Downloads page.

I don’t have a DE2-70 on which to test this, but Laurent provided the screenshot to the right showing his board running Monty On The Run.

You can download the port from here for now, with the longer term plan being to move the source for both onto Github (when I have some time to convert the existing SVN repo).

High Altitude Success!

wggs2080The last few months I have been providing engineering assistance to Wirral Grammar School for Girls in their project to launch a helium balloon into the stratosphere.  This first chapter of the project was brought to a stunning conclusion yesterday when we successfully launched and recovered a camera payload, lifting it to a final altitude of 35.5 km (116500 ft).

Telemetry from the balloon was transmitted back to the ground using a pair of trackers made from a modified version of my sensor boards.  The two trackers were configured on different bands using a 433 MHz and 868 MHz RFM22B module respectively, and custom firmware was written to communicate with a uBlox GPS receiver and transmit coordinates via 50 baud RTTY.  The primary downlink was on 434.3 MHz and was received as far away as Belgium and The Netherlands (thanks to all who helped out).

The downlink was received and decoded in real time from a chase car, with a rough landing site being obtained before the signal was finally lost.  Initial indications placed the landing worryingly close to a quarry, although a search with a 7 element yagi turned up an extremely weak signal which was enough to give us a bearing to follow – it turned out to be a further mile and a half away and behind a ridge, which is pretty good going for a 10 mW transmitter lying on the ground.  A short drive further and another wave of the yagi yielded a GPS fix which turned out to be 50 yards into a field about a mile further down the same farm track.  Recovery was quickly affected by DFing the 868 MHz tracker for the final few meters using the much more portable yagi we had for this band.  The camera was still snapping, and had shot over 1300 images.

Many thanks to everyone on #highaltitude on Freenode IRC for their valuable advice, and especially to those involved in the provision of the tools at habhub.org and spacenear.us.

Update 25/10/2013: Some images from the flight are now available on the new gallery

A Software Radio for the Web

webradioThere’s no shortage of good Software Defined Radio (SDR) apps for RTL2382-based dongles, but wouldn’t it be nice if they could be driven remotely?  WebRadio is a project I have been working on which aims to be a fully functional SDR with a user interface that runs in a browser.

The front-end is separated cleanly from the signal processing server by a (fairly) RESTful JSON API, so alternative GUIs are also an option (smartphone apps being the obvious one).

A key feature of the design is server-side decoding of data modes.  Since the original impetus for WebRadio was my involvement with a local school’s high altitude balloon project, initial focus will be on making it decode RTTY, but the modular design makes it easy to add other decoders.

Currently the project builds and runs on a Linux PC, but with only basic functionality (tuning for a single receiver and selection of AM and FM).  Channel filtering also needs some improvement, after which SSB will work as well – this is next on the list.  The GUI is known to work properly in Chrome; for other browsers, for now, YMMV.  Take a look.

Turn a TI Launchpad into a GoodFET with just a Serial Cable

lp_bsl_modThe TI MSP430 Launchpad is a cheap MSP430 development board – about £3 when they first came out, although a bit more now.  I think mine was a freebie from a distie.  Although I quite like the MSP430 I do tend to use either AVR or some kind of ARM for most of my projects, so it hasn’t really seen much use.

The built-in emulator consists of a TUSB3410 and an MSP430F1612, pre-programmed with TI’s own MSP430 “FET” debugger.  My aim here is to end up with a debugger that I can use with TI’s CC1110 chips used in the Ciseco SRF.  The GoodFET project can talk to these using its Chipcon module, and this has at some point in the past been made to run on the Launchpad.

Continue reading

Low Cost, High Accuracy Temperature Sensing with a Thermistor

For many microcontroller projects requiring accurate temperature sensing the sensor of choice is the Maxim DS18B20.  Although this has a specified absolute accuracy of +/- 0.5°C, it has several drawbacks, not least of which is its relatively high cost.  For my prototype sensors I incorporated a TI TMP112, which is an I2C device with a minimum operating voltage of 1.4 V, making it particularly attractive for battery powered applications.  My preferred option for cost-reduction, however, has always been to use a cheap thermistor with the microcontroller’s built-in analogue to digital converter (ADC).

This post discusses the evaluation of a thermistor-based technique for small embedded systems capable of achieving uncalibrated temperature accuracy to rival expensive digital sensors.  An experimental comparison of various sensors over temperature is then introduced.

Continue reading

RFM22B/23B Availability and RFM69W

There is a degree of uncertainty at the moment regarding the future availability of HopeRF’s RFM22B and RFM23B modules.  Having been in touch with a number of HopeRF’s European distributors the message appears to be that while they are indeed “not recommended for new designs”, there has been no end-of-life notification for either of these products.  Both modules will continue to be available for the foreseeable future, although they may be subject to minimum order quantities once distributor stocks run dry.

Recommended replacements are the RFM69W and RFM69HW.  These new modules appear to be based on Semtech SX1231H, which means they are not an ideal equivalent because of a 2.4 V minimum Vcc (the RFM23B can work down to 1.8 V).  Fingers crossed that HopeRF has actually used the 1.8 V capable non-H version of the chip on the lower power RFM69W.

Several EU distributors have indicated that they will be carrying the new modules within a month or so.  Pricing looks like it will be slightly cheaper than that of the older modules, so that plus the addition of hardware AES should make these a welcome upgrade.

Antenna Measurements – Part 1

PCB antenna with test port attached

I finally found the time to make some measurements on the printed antenna used on my sensor board, which I didn’t think was performing very well.  Turns out I was right.

For this first part of the test various antenna configurations were tested by mounting them on unpopulated sensor boards connected to an Anritsu Sitemaster RF fault analyser via some added SMA connectors.  This instrument is capable of making return loss measurements, which were taken over a range of 800 MHz to 1 GHz.

Return loss is a measure of the proportion of power reflected back into the transmitter (or back out of the antenna) due to a mismatch.  It is given in decibels as incident minus reflected dB, and is related to VSWR.  A high positive return loss value indicates a good match.

Measurements were made on the following antennas:

  • A reference dipole tuned for resonance while mounted on the instrument
  • The printed antenna cut to the recommended length for 868 MHz as given in the TI application note
  • Wire monopoles of length 85 mm, 86 mm and 87 mm

Continue reading

Timestore – a Time Series Database

As part of my interest in IoT and Home Automation I spent some time looking for a non-destructive alternative to rrdtool for long-term storage and aggregation of sensor data.  The search did turn up a few alternatives, particularly OpenTSDB, but I was not especially impressed with its performance nor its complexity.  During the search I came across Flot, which is a JavaScript library for plotting graphs client-side in a browser, and the idea for a “Web2.0″ time-series database was hatched.

Timestore, which is the result, is written in C and accessed via an HTTP API that can feed data series directly to Javascript via AJAX calls.  It is designed to be lightweight, fast, and to retain all data.  Like most equivalent tools it can decimate on inserts, so queries for aggregate data take constant time regardless of the time-scales involved.

The design has optimisations for sensor applications, where a single device may report multiple data items at each time point.  These can be submitted in one go, but queried as separate series for display.  The modular architecture will enable alternative access methods to be added; MQTT being an obvious one which I intend to look into for data submission.

Code and documentation can be found on the project’s dedicated page.  There are some hosted examples to play with, including the graph embedded above, which is real temperature data and can be zoomed by dragging a box around a range.  Double-click to zoom back out.  The software is released under GNU AGPLv3.

 

Implementing the ELV FHT Protocol with an RFM23

Over the last few weeks I have been helping out the guys over at OpenTRV with an implementation of the FHT protocol for use with HopeRF RFM22B and RFM23B modules.  My as-yet unreleased sensor modules (as seen in another post) make use of an RFM23B, and I have an interest in evaluating the Conrad/ELV FHT8V valve head as part of my own central heating upgrades, so this was a job that I needed to do anyway.

The FHT protocol is similar to FS20, but the receivers are battery powered and so use a timeslot technique to avoid the need for a permanently powered receiver.  This necessitates a synchronisation procedure between the controller and its valve.  Once completed, the controller will send a packet approximately every two minutes, keeping the valve in sync.  This means that it can take up to two minutes for a change to take effect, but it does mean that the receiver remains un-powered for most of the time.

This example implements the protocol using the module’s FIFO mode, requiring minimal intervention from the host MCU.  Source is available for ATMEGA328, so it should work on an Arduino, although I have not tested it yet.

Continue reading

A Simple RF Protocol (or, what is the point of ZigBee?)

I’m going to start by admitting that this isn’t going to be a tirade of abuse against the oddly named 802.15.4-based wireless tech, but rather a request for comments on an open, lightweight alternative, particularly for low-cost sub-GHz applications.  I know what the point of ZigBee is, and the ability to form into self-organising mesh networks is an obvious advantage for large scale industrial automation, but for domestic applications it feels like overkill.

The industry is apparently thinking along the same lines, because the vast majority of DIY Home Automation (HA) stuff on the market in the UK at least is using proprietary sub-GHz like LightwaveRF.  The driver here is probably cost, but it is my view that the lack of interoperability that this leads to is holding back the mass-market acceptance of HA, and is unnecessary.

What I am looking for is a simple, open (as in freely available, properly documented, royalty free) standard for sub-GHz RF that could be implemented on the cheapest of radios in minimal code space.  I am aware of MQTT-S, although even that looks too complicated for simple sensor/actuator applications, and it doesn’t define the lower layers, instead running on top of something like ZigBee or 6LoWPAN.

Continue reading