Saturday 28 December 2019

3D printer: Projects never die, they just hibernate

This does not count as an ODOTS post. Though ODOTS posts will just have heralded it and will follow on from it.

The 3d printer LIVES


One of the things that became very clear at the end of University was that I was unlikely to gain access to as good computer aided manufacture devices for a very long time. Naturally this resulted in the Engineer's equivalent of the process of grief: procrastination, fear for future projects, rapid acquaintance gathering in later university intakes, planning for losing capability and finally  - coming up with a hacky workaround.

I am pleased to reveal that the hacky workaround in question rates very low on the hack-index. Actually it rates embarrassingly low. The solution of course was to plan to build my own 3D printer, CNC router e.t.c. - to this point only the 3d printer has had any work done with it, mostly as many of its components were made using the machines at University in my final few months.

The justification for this was that I was only using scrap wood (in the laser cutter) and a minimal amount of filament on 3d printers that were not being used (because everyone was studying for exams...). The result was stuff of legend. I had chosen the Smartrapcore design because I liked the idea of the RepRap Core-xy and the design ends up looking a lot like the Ultimakers from Uni. The smart rap core jscad produces a STL of the expected completed printer, this made making the frame design particularly straightforward.
The blue is the STL - so far everything has fitted perfectly on the frame side.
The big stumbling block was naturally gathering components and the cost of doing so. This is my excuse for the 6-12 month delay in actually starting construction from when I first started the 3d printer concept with a bunch other students.

A view of the core-xy carriages 

Some filing work has been needed to get the timing belts working - but the entire structure is now together, and all carriages are moving smoothly. The only thing left to do is wire it up, load up firmware, check everything is working, calibrate the movement, calibrate hot-end temperature and filament flow-rate ... just most of the build process really!

Saturday 30 November 2019

ODOTS: The Hardest test of all

 ... Real People...

So today the ODOTS proof of concept units headed off to the sunny Forest of Dean* to be demonstrated to live orienteers, mainly so that I could get some feedback from potential users on what I had missed as a designer. The answer was mostly box size - people did not fancy the idea of carrying around a whole load of the rather large enclosures.

Live tests are a traditional stumbling block of any project - nothing brings out the bugs more than people watching. This test was unfortunately no different - one of the Arduino chips emitted some blue smoke yesterday so the download unit also became a reset unit, and my laptops battery died in the cold so results were not displayed for most of the demonstration.

However most people (as far as I could tell), were receptive and understood the goal of providing an option for timing system users that cannot justify the expense of current timing systems.

So, what are the next goals? The next stage of work will be made a bit slower by the fact that I have a job now, but there are a couple of concrete goals to go after:

  • Move to SMD components so that the cost and power consumption can be further lowered.
  • Make a couple of operation changes to increase battery life - so that users can be less concerned about having to charge/change batteries.
  • Design a custom enclosure to eliminate all the unused space and make the controls more suitable for mass transportation (this is a perfect excuse to go and build a 3d printer)
For a public demonstration I managed to get remarkably few photos. Hopefully this will change with the next post.

*Don't let that fool you, it was still covered in the traditional half meter of mud.




Wednesday 9 October 2019

ODOTS: boxen

The ODOTS are in their boxes, and the proof of concept is officially ready for demonstration! The PCBs are all soldered and connected up, batteries are all primed and all the units have now been put in enclosures.

Enclosures and everything.
This completes this phase of the ODOTS project, but it shall continue! It has been way too interesting not too. The progression in the design has been very satisfying, not least because it has gone the full way from breadboard and loose wires to enclosed box and PCB. 

So long ago
The documentation is also done for the moment, it will be added to once I gain experience in actually using the ODOTS, but for now it contains as much as there is to know (literally).

Friday 27 September 2019

PCBs: Pile on the Ice Cubes

The PCBs arrived in the post today, turns out the slow boat from China has probably been upgraded to a Hydrofoil. With the PCBs here the final construction of all the ODOTS units (I have parts for)  is now under way, with a quick order to Mouser (sorry RS, they had nicer enclosures) to grab the final bits and pieces. The boards that have now been put together (Two in a couple of hours) both work well.

The PCBs have come out really rather well, and current testing indicates that I only made one massive mistake, so all is looking good. (Not least because the error is just a missed connection, easily fixed with a sneaky extra wire!). I am amazed how clean the manufacture of them is, and attaching components has been easy enough that I have vowed to never again use Protoboard on anything that I need more than one of, never again.

So nice, so clean, so ... green.
The improvement over the strip board in visual quality is incredible, as is the reduction in board foot print (1.5 cm less length!). Additionally because there are no wires to solder in (apart from the one to fix the missed connection), and a very limited number of mounting points (all of which are labelled), putting the board together is straightforward. While the stripboard took a day to put together and was tricky to debug (as well as having lots of error prone wires), the PCB goes together in an hour and is neat enough that debugging is less daunting.

PCB > Stripboard. Smaller, neater, certainly more professional.
In the image above the PCB has had its RFID unit added, and the wires have been made to loop over the not-yet-present battery. The two boards put together today have really brought the end of this stage of the project into view. Of course, I managed to plug one of the board into an Arduino board (acting as a serial bridge) backwards and now the Arduino board (my only suitable one) has stopped talking - but that is a problem for another day!

Increasingly precise perfection approximations...

Led's mounted on the reverse side so that they will stick through the enclosure.

Friday 13 September 2019

PCBs: an increase in coolness

Haha! I followed through on my PCB threat - and now have a bunch of them waiting to be made somewhere in China. Fantastically using them actually brings the cost of the project down as with the introductory discount they came to less than £1 per item (including shipping). Given that this is less than the soldered mess on the strip-board it is a bit of a no-brainer to use the PCBs.

Given I had already put together the schematic to design the strip-board layout it was relatively straightforward to design the PCB. The massive advantage of PCBs is how close different signals can be routed. This and complete routing flexibility on both sides of the (two layer) board mean that the layout uses 25% less area with a large area with only flat components (for the battery to fit onto). Additionally the LEDs and pinouts are all now in far better locations which is a real help.

KiCad Rendering, gets even better when you actually provide
full 3d models for your components!

The Worms - this step was so straightforward, I don't know why I
have not done it before.
The things this design still misses is attachment points (not a problem if you just use hot glue...) and an on board Serial to USB converter. Given how straightforward the design and order process has been I may opt to move to surface mount components rather swiftly. This will reduce the required PCB area drastically (everything will be smaller), leaving space for drill holes and extra hardware, and the cost reduction (everything should be cheaper) will mean I have budget room for extra hardware. I may even have to start considering integrating in the RFID stuff and actually thinking about power consumption.

NOOOOOOOOOOOO - too polished, too complete, I NEED THE HOT GLUE AND 0-OHM SOLDER BLOB RESISTORS. Darn you engineering maturity, you can't get me that easily!!

This is actually quite a nice step for me. Previously I have always relied on Monsieur Miroshnikov to throw the PCBs together and order them (generally while I dove deep, deep into a pile of code), it is going to be a bit of a change to only have myself to blame when the power rails short out!

Next up in the immediate future is to sort out the enclosures for the proof of concept hardware. The new PCB design should permit easier packing into a box (see my comment about batteries). Everything will probably end up being be glued to the lid of a standard enclosure (with flanges for attaching to controls) just because that keep everything accessible. Of course the best bit will be drilling holes into the weatherproof box to let the LEDs peek out!

Thursday 12 September 2019

Pushing Past Power Problems (perhaps)

Making a semi-final product today allowed me to finally start taking semi-final power consumption measurements. These were done by inserting a small resistance into the positive power supply connection and then measuring the voltage over it (my multi-meter was not sensitive enough for direct current measurements).

These were terrifying, unmodified the board pulled almost 60mA  in its idle state, giving it just over a day of life on a single 18650 lithium ion cell. This is clearly far less than I had hoped and indicates that power consumption is now something I should be worried about. Off we go on a hacky adventure!

First off was removing the 5V regulator which (given it had been shorted out anyway) was just wasting power. That saved a full 5mA of consumption.

The next step was to stutter the RF field from the reader, adding periods where it is turned off, for instance when the microcontroller is doing non-RFID things. Additionally the addition of a sleep period to the polling cycle (with the RF field off) massively reduces the RF field duty cycle and in tests did not really change the user experience (and I was looking for it). That saves another 10mA and being more aggressive on the sleep saved a further 10mA. This pushes the time on single cell up to 3 days.

Clearly I have been optimistic that the cells will actually be able to discharge their full rated capacity, so maybe 1.5 days is more like it. This still allows the proof of concept to be programmed the day before any field trials and left on over night without having any danger of it running out of power!

The interesting thing about this development is that it indicates the next big development required of the ODOTS on its path to becoming ready for certification (certification being expensive and something I only really want to do once in the future)(And something that will be necessary to bring the ODOTS, or derived system, to the mass market). Frankly the current hardware architecture is not optimised for power consumption in any way at all, the use of Arduino in particular is a bit of a liability as it does not provide fine control over AtMega peripheral activation. This may be why I eventually shift over to a different architecture in the future. While I have made an effort to tame the ravenous beast that is the RF field the MRFC522 (or one of its alternatives) will provide methods for reducing its appetite further. I have commented in the past about the ability for the ST Micro chips to passively detect tags, this would be ideal as it would massively reduce the power consumption with potentially little (randomised) impact on competitor visit recording times.

I suppose my dreams of networking the ODOTS units with LoRa and implementing a 6WLoPAN network are going to be a long way off indeed!

Small steps are never as easy as you imagine.

The first stripboard prototype has now been put together and it was worth doing. It works, but has taught me a lot about how the proof of concept design is likely to go together.

Prototype, mk 2: "Ever closer to approximate perfection"

The strip board module, with the AtMega chip, clock, leds, buzzer,
voltage regulators and many many pinouts.

First observation from putting it together was that it took most of a day, and was incredibly fiddly. The build time may come down with repetition and the fiddlyness could be remedied with an extra bit of clever design, but for something I want to be straightforward to put together, it is not acceptable. Therefore I may have to make a diversion to PCB land, which will delay the full completion of the proof of concept system (as as adding cost) but will make the design much easier to build.

A good test for new hardware is to use it. Typically this test is used when you have not put in good testing points, test procedures, or you are bored and want excitement. Also typically new hardware will fail this test and you have to spend twice as long fixing it. Test procedures for the strip board layout included (in order, and initially with no power or DIP chips):

  1. Testing for Power-Ground shorts (good for not blowing up components when you plug it in).
  2. Test for signal-ground shorts (same).
  3. Test for Micro-controller to endpoint signal wire/trace continuity.
  4. Test to see if the voltage rails had the right voltage (with battery plugged in).
Then the following functionality tests were performed (once the DIP chips had been socketed, and the micro-controller programmed):
  1. [PRIOR to all other tests, the AtMega chip was used in the breadboard setup to read cards and demonstrate basic functionality, proving it worked)]
  2. Test to see if the clock worked (and the buzzer), performed by waiting a minute to see if the 'I-updated-from-the-RTC' blip activated.
  3. Test to see if the serial interface (through the now empty UNO board) still worked.
  4. Test to see if the RFID reader worked.
Absurdly the tests were all passed until the last one. The brilliance of not doing the 'plug and go' test was that I knew the RFID reader/wiring to the RFID reader was at fault. Plugging the RFID reader back into the breadboard setup showed it was still working, which meant the problem was in the wiring. Quick testing indicated one of the pins was shorted to ground, which it was due to some splashed solder. Fixing this meant the device worked normally, but such a fault indicates that even when you know the design well, test thoroughly and have plenty of soldering experience with these sorts of components it is still tricky to get a working board. If others are to be able to replicate the design it has to have a fair chance of working first time with no debugging, something this approach is evidently unlikely to achieve.


I lie when I say all tests were passed, the 5V regulator was actually counterproductive with the 5V supply - I had expected it to operate without any voltage drop but it appeared to just not work! Therefore it was just shorted out, and will be in any future designs that use the magic Poundland power supplies.

The placement of components is also an issue. Due to the nature of the Strip board, placement of components (when optimising for reduced soldering) is not exactly free, and as a result (as you may have spotted in the photo of the board), the board is not set out particularly well. The LEDS are recessed, which is not ideal if they are to be visible. The Header pins are spread out all over the board, not ideal for happy wiring in the final enclosure. (Though to be fair I have not thought much about how the final enclosure will look yet). Moving these bits around requires more flexibility in routing than the strip board can give me, which does not bode well for it!

To sum up, stripboard: meh, PCB: possibly worth the extra expense...

Next step will be to think about the enclosure, then go off and order the enclosures, RFID units and PCBs. Then take a trip to documentation land while I wait for them to arrive!


Tuesday 10 September 2019

Website fun.

Hmmmmmm...

ODOTS is intended as an accessible project (broken record time WHOOP WHOOP), which means that ideally the general public should be able to snoop around the design documents and software with little effort. I have spent today throwing together a Github Pages website to do exactly this:  https://ljones278.github.io/ODOTS-Release/

the website


Eventually it will sit on top of a repository that contains all the latest release versions of software and hardware designs and act as a guide on which files to use for which purpose. It can also be used as an update bulletin, which will be useful for showing off to potential users or just the orienteering community at large.

Eagle eyed readers will notice the new logo, this is actually just a re-work of the old one so that it can be used in-line rather than as a separate image. This is far more handy, I actually made it so that it would fit in my User Guide footers!

In line logo.
The other thing to happen today was that RS managed to turn around the order I put in yesterday in record time and I received all of the parts for the first Proof of Concept test build!

Real orders come in boxes.
 I was not really mentally prepared for the task of soldering up the board for the first time, so I will admit that the website may actually be a massive exercise in procrastination! The other step in delaying the inevitable was to sort all the components into component boxes. This is a pretty cool step as it means that I know when I am starting to run low on any single component, as well as being able to quickly spot which type of resistor is which. I am aware of the ESD risks, hence the AtMega chips are still in their bag, but for the rest of them it does not really pose a risk here.

So organised...
Finally, the last thing done yesterday was to pick up the proof of concept power supplies, which are the power banks isible in the photo above. These are pretty nifty, containing a LiIon cell, a charging point and an inbuilt voltage regulator, and all for a price that I could not buy the battery for. (What do you mean, "cut corners". I am sure the batteries and charges are made to the normal high quality standards of their source shop).((Poundland)).

Monday 9 September 2019

The home straight (time to solder on...)

The last couple of weeks have been spent positioning the project for its final sprint (before the long, long cool down of debugging and documentation correction). This means that this afternoon I sent off a hefty order to the component people to request most of the bits I will need to put together the Proof of Concept!

The first thing to finish off was the interface software, the bit running on a big computer which will allow people to configure how the ODOTS operates, download competitor card data and so on. This is now all done and partially debugged (more on it in another post).

The second thing was to transpose the hardware design to a strip-board using an atmega328p. This is the bit that gets my inner Electronic Engineer very happy, bugs can be solved with extra wires and spotted with your nose, design turns into connect-the-dots and the seemingly random (but essential) components all work their way out of the woodwork. Another advantage is that I now know how much the proof of concept will cost to make. While component costs come to £20.51 (such precision, so exciting), which is more than my original goal, I am not to worried, I have not made an enormous effort to hunt out cheap components so it is likely in another revision many pounds could come off that total.

The design has been put together in KiCad (k-eye-cad or key-cad depending on which side of the flame-war you sit) a free PCB design tool that can also do strip board designs quite well - just by putting all the back-copper traces horizontal! In the layout below Red is being used for the provided strips, while Green is being used to represent all the wires that will need to be soldered on the top side.

The layout so far - now waiting to see which connections I missed.
In the Rubik's Cube project I used protoboard, a variation on strip board where each pin hole is not connected, whereas in strip board they are connected ... in strips.

Strip board (or Veroboard)

Proto-board (or Matrix Board)
This reduces the amount of soldering required, and number of funny bits of wire on both sides of the board. Both do the same job of acting as a permanent bread board with solder.

I am fairly happy with the design as it is, it is fairly compact (if unable to tessellate nicely in the standard strip board sizes) and appears to have a minimum of random wires running large distances around other components.

The next part of the project is where some of the final hardware products will come together which means things like the power consumption, physical size and usability will move from predictions to measured quantities (or qualities).

--------------------------------------------------------------------------------------------------------------------------
For those following on from my previous post, he documentation has progressed as expected, currently sitting at 40 pages of informational goodness - LaTeX really helps with long documents (no massive document redraw when you move a figure/table/sentence around!). Most of the software has now got full documentation with all of the interfaces specified. The only big things left to do are explain the hardware design (including the beautiful layout above) and some user guides. Hmmm - writing those down made me think that actually those could end up being quite large pieces of work.

Sunday 25 August 2019

The return of Arch Enemy no. 38

DOCUMENTATION.

Like this but PDF.


If ODOTS is to be successful it is a fact of the universe that 'self documenting code' and 'straightforward hardware' are not going to cut it. Not only is explicit recording of all code and components required but an explanation of the various interfaces in the project is also going to be needed to make sure the ODOTS makes sense to a prospective user/builder.

What am I looking for in the Documentation of the ODOTS?

  1. Enough information for someone to build and use it from scratch.
  2. Enough information for someone to poke around with the design.
  3. Enough information for me to return to the design and still know what is going on.
If the ODOTS is to become community developed a solid baseline design is essential. Building extras is easier when the foundation is not made of sludge!

So you may notice that the ODOTS is not actually finished yet, so any documentation written cannot possibly be correct. This is true, there is currently a lull in the design work: I have finished the firmware and now need to move onto a basic making a basic PC based interface and putting together the final proof of concept hardware design. The interface will manage ODOTS checkpoint unit configuration and handle competitor information sorting and retrieving from cards. (I really don't intend to put much more than bare bones functionality into it.) Back to the original point, this lull provides the perfect opportunity to record work so far and tighten up some functionality definitions from random scribblings on my desk.

I have suffered defeat at the hands of Arch Enemy no. 38 before, each time the horror of having to look at your own work and find it indecipherable is enough to make you say 'next time, next time'. Incidentally the Enemy can strike within a single project, recently the Engineers Flat effort to make a custom Robot Wars Control PCB was derailed when we forgot to write down the sequence of resets required to successfully flash the micro controller we were using.

The good news is that there is nothing truly complicated (after development) about the ODOTS so the documentation has so far gone without a problem!

Monday 19 August 2019

The ODOTS test bed - an example of approximate perfection

HAHA - something that works! (maybe)

So - an exciting day, all individual components have been tested individually. The RFID unit has successfully read and written from both MIFARE 1k and 4k cards, the clock has kept time and had its time set, the buzzer has buzzed and the Microcontroller has sat though it all tolerating my antics. Special mention to the 200mm Telescope which donated one of its off-cuts to the testbed as a back board.

The test bed is really about getting everything together in one place so that it can be worked on as a piece. As mentioned earlier all individual components have been tested to the project from here on out is really about putting it all together, using the clock to generate data to be stored on the card, using the buzzer (and soon to come LED) to indicate to the user operational behaviour and finally building in the magic serial to computer interface that will allow each ODOTS checkpoint device to have its time re-calibrated, its function defined and its ID set.

At this point in the project I have a month and a half (if you squint) before my self imposed deadline which is good as if I can get major functionality done this week I will have a month of poking around, testing (and breaking) before a test-with-public at the end of September and a write up with tutorials by the end of the year. This probably means that it is a good time to look at how the project is tracking against its original objectives. For reference the requirements stated were:

  1. Have 100 competitors on a 20 checkpoint course for under £500.
  2. Ensure top level designs and software are straightforward and accessible.
  3. From a performance standpoint checkpoint registrations should ideally take <20ms at a range of under 0.5m, while competitors should have the ability to record as many checkpoints as possible. Orienteers, being used to current timing systems, will also require the checkpoint registration times to also be recorded to around centi-second accuracy over a course that could take 24 hours!
  4. From a safety standpoint it would also be helpful if checkpoints remember who has visited them as this can help with search and rescue (if needed).
  5. From an operational standpoint the entire system should still work if it has been submerged for a while in a nice wet bog.
The engineer requires that I address these in the simplest way possible, point by point ("Yes" may be a bit too brief).
  1. Cost analysis (a very exciting spread sheet) currently predicts ~£18 per Checkpoint unit (for the proof of concept) and <£1 per competitor recording card. 20x£18 + 100x£1  £500, so this is probably an achievable goal so far.
  2. Arduino libraries are brilliant at keeping you from getting too bogged down in detail, which is generally when the unreadable spaghetti appears. So far the code has been written with the utmost effort to keep relevant variables and constants centralised and accessible. The top level Arduino sketch is currently looking like psuedo-code (because it almost is) but there should be no reason for this to break down. Source code has been split down into device specific headers, or general ODOTS functionality. The proof of concept will be built with through-hole, and widely available, components making it easily replicatable by someone with little specialised tooling or expertise.
  3. Very straightforward functional requirements, these will all be met. Choosing the MIFARE standard gives access to 1-4kbytes of storage (100s of controls) with an RF interface that can generally conclude an exchange within 10-20ms at close range. Engimancy with the clock will allow millisecond precision of timing for the same unit and close to that between units, laziness more than anything else limits the available time frame, the clock has records of the current century if needed!
  4. This is the only objective that may be bent, memory is at a premium in the AtMega chips, unfortunately this feature may have to wait until the system is made slightly more professional.
  5. Lunchboxes and a contactless interface are acting fairly well to keep the entire design pretty easy to keep waterproof. 
Other than final integration big tasks looming on the horizon are dealing with the power situation (especially for the RTC, I am thinking a coin cell hiding behind a diode...) and actually developing my ideas about the enclosure. Also trying to make sure that any user is able to handle the built product intuitively will be good to do. Making an interface for setting Card and Checkpoint IDs as well as changing Checkpoint unit function which is simple as possible with an eye for starting to get it to run on minimalist extra hardware will be a must at some point.

An updated logo, I realised that the antenna is too good
a shape to not include!




Thursday 15 August 2019

Time to think about time....

With the RFID system on a postal adventure for the next few days I decided to give some thought to the T of ODOTS. (It is indeed, T time...)


As a timing system the ODOTS will need to be able to accurately (and to an extent, precisely) track the time at each of the recording stations. The microcontroller unit has the ability to track time to an extent by looking at its own clock (digital signal clock, a simple oscillator) but these tend to be rather inaccurate (because they don't need to be) and also loose track of time when you pull the plug. 

This is where an external clock chip comes in handy both having dedicated hardware ensuring that it is keeping time well, and the ability to run on a very small power supply, allowing it to be powered with a small coin cell while the rest of the system is having a plug-pull induced nap. As mentioned in the last post the proof of concept system is staying in DIP land to reduce required soldering complexity/need for PCBs, on top of this requirement I also wanted the chip to require a minimum of external components. Luckily the handiest chip to use is Maxim's DS1337(+) a brilliant little chip that not only satisfies my generational requirement to meme, but also already has drivers written for it (though I only learned this after getting halfway through writing my own).

Choosing the RTC with the power of 1337.
RTC (Real Time Clock) time will be synchronised with a computer, probably during initial setup and then periodically by some sort of Tech Wiz (capitals necessary), while the microcontroller will periodically re-align its own time estimate with the RTC's during operation. Ideally the update timing slack will be less than 10ms (about the maximum precision I could really expect from the RFID system). The RTC can generate interrupts on second boundaries (effectively showing the 0ms point for that second) which I will be exploiting to allow the Microcontroller to gain some sort of sub-second accuracy. 

The frequency of RTC referrals is interesting, ideally I want to keep the interval small (to prevent inaccuracy buildup), but not so small that referring to the RTC is the only thing the MCU has any time time to do. Initially I had thought 10 minutes would be good, but this would require the Microcontroller to set the next interrupt time after each referral, increasing the time each refferal takes. However, the RTC has inbuilt repeating alarm abilities, once every unit of time (once a second, once a minute e.c.t.) for the time being I will attempt to use the once a minute interrupt to see if this noticeably impacts performance for users. That throws as many 'this is going to cause more work in the future' flags as I have seen but oh well....

Wednesday 14 August 2019

Standard Struggle (or how I learned to stop worrying and love NXP)

Part of the ODOTS project is about tackling the problems that other people wont want to, and I think that I have taken a month to do just that. Today I finally admitted defeat to NXP - if I want the ODOTS competitor timing cad to be a MIFARE device (which I do, they are ubiquitous, diverse and likely to be around for a while) I am going to need to use their Reader/Writer ICs. The bit that finally pushed me over the edge was the realisation that not using an NXP chip was going to doom me to having to run the authentication and encryption on the Micro-controller. A day of searching for a friendly application note/datasheet/tutorial showed up nothing.

Up to this point I had mostly worked out the firmware for the CR95HF (from ST Micro) up to the ISO14443a layer and was feeling like I was understanding how it all hung together (a good indication that you are about 10% of the way there). Unfortunately while the CR95HF is MIFARE Classic compliant it requires encryption and authentication to be handled by the host (the micro-controller), while NXP chips will take the bulk of the work off you conveniently meaning the task of encryption and authentication are not often tackled by the sorts of people that will leave behind handy code libraries and examples. Thus I could continue to try and write code to run MIFARE tags through the CR95HF, but it would be a significant piece of work with little benefit (in the short term) over just using an NXP device.

The beaten track beckons, so I am flipping into complete Arduino-friendly mode and using the MRFC522 chip that has a development board that has been mass produced to the point that you can pick them up for £5 from mystery-meat ebay and amazon sellers. My development article is coming from a more reputable source in the hope that it allows me to avoid the classic block-of-resin-with-solder-pads knockoff syndrome! With all RF and surface mount components handled by the wonder board most other components are going to be possible to do with through hole components (or DIP) - for that sweet sweet 90s look. this will also make it more straightforward to prototype and 'mass' produce proof of concept timing units for demonstrations. Naturally as the likelihood of the ODOTS actually being used goes up the more and more it will approach a single PCB, all surface mount, state. Additionally using a shady source RF board may make it tricky to prove that the device is not producing large amounts of EMI - so it will need to be replaced at some point.

Astro Meandering

It has been a while since my last astronomy post, having to spend all night studying tends to reduce sky watching activities. There have been several developments however.

The 200mm telescope has proved itself as a semi portable device, it was successfully dismantled and transported to Scotland by car where it was reconstructed with no ill effects. The de/construction process takes about 15 minutes and appears with not really change the required mirror tilts for columnation. The telescope was not actually used up there ( :( ) as Scotland in summer only really gets dark in the morning and the trip to Scotland was actually for an Orienteering carnival - something that generally requires the maximum amount of sleep possible!

One deconstruction/construction cycle later and the scope is now working back down south. I took it out for a quick test last night, the forecast promising clear sky and the moon offering a good target for finder alignment and focus testing. Of course the forecast did not include the predictable appearance of thin high altitude clouds after such a warm day so I only got to looking at the moon and a brief look at Andromeda before everything became obscured.

With a nice full(ish) moon I also had the opportunity to  test out my new phone's camera and the darkening filter I have had in my eyepiece box forever. I have put the nicest photos below, but be warned my skills are still low, I have yet to get the exposure settings right, and I really need to come up with a way of holding the phone that is not my hands so that I can fix the positioning of the camera aperture. There is however a marked improvement over using my old phone (not surprising) or the mighty 76 millimeters of the Drinking Straw, though I think the latter is more to do with mow much more stable the 200mm's mount is!
A full moon in a single image, showing some nice detail on the terminator (to the left).

No Moon-photograph session is complete without a photo of Tycho Crater.

Monday 5 August 2019

ODOTS, the nitty gritty

Yesterday I posted about the next project lined up, the Open Design Orienteering Timing System - today I will attempt to go into a bit more depth about what I have done so far, including design choices.
The orange and white checkpoint flag hides, trying to ignore the now well trodden path that leads directly towards it...

To start off the entire system will just be a big RFID network, Orienteers will travel between RFID read/Writers collecting their ID's and timestamps which can then be used to determine who completed the course the fastest. Therefore the RFID stations need to be able to both read cards (to detect them) and then write to them, ideally in a short enough time span that the user does not notice. The first step in this project was to decide on a broad RFID standard that will provide this capability and have widely available components (and compatible tags).

RFID has a wide variety of implementations and the first discriminator is operating frequency. Lower frequencies (such as 125kHz) do not provide sufficient read/write capability (or memory) and are also on the verge of becoming antiquated (HITAG, NXP's standard for this frequency had its last update in 2007). Age could be seen as a boon, the technology is proven, however there is a risk that the ICs will stop being manufactured (not brilliant for availability) and there have been dramatic improvements in communication protocols in the recent past that newer technology will have been able to leverage.

Higher frequencies come with their own problems. RF design becomes harder, which would be an issue if I was to try and start designing my own PCB's. Another issue is that higher frequency spectrum becomes useful for other things too, there are increasing numbers of users all competing for spectrum access, interfering with each other or operating in protected bandwidth.

Therefore 13MHz RFID is a good compromise. The 13MHz standards are currently receiving a lot of love (NFC, contactless payments) and will therefore probably have supporting ICs around for the foreseeable future. 13MHz RF design is hard but not impossible/evil. 13MHz also means that we will have to try hard to become spectrally abusive, power output will be limited by the fact that any antenna we make cannot be well matched to a signal that has a wavelength of 10m. A quick look at the OFCOM band map shows that there are users of this spectrum, however there is specific spectrum usage set aside for Inductive Applications (aka Near Field Communications) and the other users are tolerant enough/wideband enough that the restrictions are not too bad - official testing may be required if the ODOTS were ever to go into widespread usage.

Again NXP loom large in the 13MHz protocol lists their NTAG and MIFARE standards form a large portion of the compliance advertisements for cards and transceivers. To be a rebellious engineer I immediately looked beyond NXP for my RFID chip, in the hope that a separate manufacturer would also be able to cater for non NXP communications if needed. In walks ST Microelectonics with their development boarded CR95HF. This strays off the beaten arduino-compatible path (which about sums up most of my software work so far), but has good higher level drivers - when I can get the basics working. ST Micro are also releasing some very tasty IC designs with capacitive (passive) tag detection. These will be a prime target for upgrading to in a couple of years time if the ODOTS works!
Don't worry LM741 - the fancy RF/digital chips will never have your charm.
I have just mentioned Arduino, so that probably gives my Microcontroller game away. I have opted for an ATMEGA to allow me to sneakily use the Arduino bootloader and maintain compatibility with the beginner friendly Arduino IDE. For all the embedded engineers currently crying about the injustice of it all the 'under the hood' code is written far more practically to ensure that is can fit in the ATMEGAs resources. Using the nice friendly IDE for the top level embedded software will hopefully mean that it remains accessible to anyone who wants to have a poke around. Additionally it will allow me to rely on the many tutorials on how to burn in the bootloader/program for when other people try to use my designs.
The legendary MSP430 got a brief consideration (Energia is nice), but unfortunately it just does not have quite enough memory.
Finally I have given some though to other parts of the design, using the ATMEGA is likely going to mean my Vpp will be 5V - pushing Lithium Ion batteries out of the window, luckily 9V batteries are a thing and if I can come up with a nice openable/resealable enclosure replacing them should not be too difficult. Real time clock options have been glanced at briefly, it looks like I may have to put multiple devices on the same SPI bus which would be really cool to do! The actual user interface is something that also needs to be thought about at this point too - the checkpoint interface is pretty simple but the data needs to be read off the card somehow. Luckily if I am using the ATMEGA chips I can 'just add USB ports' and have a RFID tag's contents read and spat off into a computer for displaying/recording.

Sunday 4 August 2019

The Open Design Orienteering Timing System

Uni finished, the next step not yet begun - obviously time for a large project. I have been kicking around the idea of building a custom timing system for orienteering for a number of years, but I finally got around to setting aside some time and (possibly just as importantly) asking the Orienteering Foundation for funds to go off and buy development and evaluation hardware.

What is the aim of this project? To build a proof of concept low cost open design electronic timing system for  use in orienteering training and small events. For those unfamiliar with the sport an Orienteering race is effectively a cross country race with no streamers showing you where to go - so you have to use a map instead. Thus it becomes a challenge of navigating between checkpoints as fast a possible. 

An example course and map, around the southern side of the University of Bristol campus

Validation systems to ensure competitors actually visit all checkpoints or controls are essential in any races with any sort of stakes. While this used to be achieved with pin punches and bits of card, modern orienteering will use high performance electronic timing systems wherever possible. To newcomers this can often be a very good advertisement of our capabilities ad worthiness as a sport. Unfortunately the current solutions for electronic timing are incredibly expensive which poses issues for clubs starting up or clubs looking to deploy their timing systems in areas prone to theft. Therefore I have the grand plan of building the design (and software) for a low cost electronic timing system. The low cost will reduce the barriers that new clubs can face, while keeping the design open and accessible will allow contributions from other members of the orienteering community to change the capabilities of the system to their requirements.

The final goals are:
  • Have 100 competitors on a 20 checkpoint course for under £500.
  • Ensure top level designs and software are straightforward and accessible.
  • From a performance standpoint checkpoint registrations should ideally take <20ms at a range of under 0.5m, while competitors should have the ability to record as many checkpoints as possible. Orienteers, being used to current timing systems, will also require the checkpoint registration times to also be recorded to around centi-second accuracy over a course that could take 24 hours!
  • From a safety standpoint it would also be helpful if checkpoints remember who has visited them as this can help with search and rescue (if needed).
  • From an operational standpoint the entire system should still work if it has been submerged for a while in a nice wet bog.

To hit these goals 13MHz RFID communications work quite well, allowing competitors to carry around a couple of kilobytes of read/write memory in fairly weather proof packages while also allowing fast communication times on protocols that are likely to last for another decade or so (at least). So far I have been working with the CR95HF chip from ST Micro, which is multi-protocol and also has some ST written drivers for using it to talk to NFC cards which is pretty useful. I expect that eventually I will have to specify more stringent RFID tag requirements for compatibility (as in possibly a specific set of MIFARE standards) as supporting a wide range of tags looks to be beyond the abilities of the micro-controller being used. It also requires minimal external components for RF drivers which will be useful when I finally start thinking about PCBs.

Using an Arduino compatible chip is also good, as writing the top level code in the Arduino style will allow it to be read by beginners. Work over the past month trying to get the RFID drivers to compile onto the AtMega328 have shown me that the lower level 'under the hood' programming will be less friendly (just so that it can fit).

At some point I will also have to start thinking about timing tolerances and potentially Real Time Clocks, but for the moment all effort is being put towards getting the RFID systems to talk!

The most important part, a logo/icon for the ODOTS

An alternative name - and logo, I think I must have had the render settings set much lower for this one!
It is important to note that I enjoy using the current timing solutions a lot, which have been honed over a number of decades to provide reliable, painless timing with brilliant precision. Recent moves to contactless registrations have made passing through checkpoints very fluid and don't require any slowing down at all (brilliant if you are trying to live up to your internal image of running along like the the three hunters).

Wednesday 24 July 2019

Starting on a Quest to Building a Music Player

Hi All!

I've recently gotten into the swing of libre software/hardware projects, and so am interested in designing a music player capable of playing ogg vorbis format music.

This is the rough set of requirements:
-Portable (roughly size of a smartphone/PDA, realistically smaller since it's not going to have much hardware other than audio)
-Capable of output sound to a 3.5mm jack (with a small stereo amplifier).
-Capable of Bluetooth A2DP for comparable sound quality to wired. This is important for me as I have a pair of wireless speakers.
-Play audio files from a micro SD card. Keeps design simple and reduces size.
-Play large audio files (100s of MB) to allow listening to podcasts.
-Main audio format to be Ogg Vorbis because the specification is free and available (https://xiph.org/vorbis/doc/). However, given the components I'll be using, other formats (WAV, MP3 etc.) will be usable too. Additional formats will be a stretch goal.
-Custom shuffle functions. I don't like when my devices recommend a song I already played during the same day. Perhaps having a list on the SD card that shows what I listened to today and not adding anything in that list to the shuffle queue?
-Use on of my existing development boards as a prototype. Contenders are: Raspberry Pi 3 Model B, CHIP, STM32F0 Discovery, ESP32 WROOM 32. I decided against using Arduino based boards so that I got more experience with C programming and to reduce  memory overhead.
-Physical buttons for controlling volume, play/stop, next, previous, perhaps some additional functions. For the prototype I'll use my existing protoboard keypad with 14 buttons available.
-Small display for showing current song, shuffle settings, directory etc. For prototyping I have an I2C OLED display with a 0.96 inch diagonal and 128x64 resolution. Should more than enough for testing.
-At least initially, I will reuse parts that I already have (Li-On charger IC, passives etc.) to cut down on prototyping cost.
-Minimise power consumption by using interrupts, turning off unnecessary gpio, reducing clock frequencies etc. This will be more relevant once I figure out the final set of hardware after prototyping. This is also where Arduino, and Linux based solutions may be unsuitable as they have a lot of overhead.
-(?) Anything else that I may deem fun or interesting to play with, since it is my device after all!

Once this device gets closer to finalisation, I will aim to use parts that are:
1. Readily available.
2. Have datasheets and all bootloader information available.
3. Will be produced for a long time.
I'll approach the design from a modular perspective, to allow parts to be replaced with minimum hassle if any parts from my original BOM go out of production etc. In addition I'll include debugging pins and ways of bypassing sections (such as the audio amplifier, bluetooth chip etc.) to allow straightforward replacement of sub-systems.

Monday 8 July 2019

Pipe Post-Script

The end of the big engineering project came and went fairly swiftly, but not without a few fairly long experiment/analysis/writing sessions to finish it off. (It wouldn't be a proper project without them ... riiight??)

The result was that my visions of a brilliant new way of detecting pipes was only partly correct. The final experiments involved sweeping the antenna in front of a pipe, which had been hidden behind a very large wooden board. The pipe could be clearly seen in the reflection data and with a bit of processing the peak in reflected power could be made rather significant.

The pipe is causing that ripple!

And with a bit of manipulation of the underlying phasors we can make the peak magically appear!
Unfortunately the usefulness in the reflection data for distinguishing pipes and non-pipes was not tested (a year is a remarkably short time in the end). Looking at the initial goals for the project - they were all met, the method was tested in the ways proposed and experience in how the data generally worked allowed me to build a schematic of the pipe detector!

Inevitably the question after every project is what next? - well I think it is time for something completely different...