Year's Distraction

As with every year, this one brought a distraction. Much shorter and more important than those from previous years, but still welcome getting away from solving hardware and, even more so, software problems.

This time round I decided to set up a special rig to tape challenges. Requirements would go along the lines:

  1. Full HD or close resolution
  2. Camera to see whole arena and from top
  3. Camera to start filming at the point when the robot would start moving - well slightly sooner, of course
  4. Storage on the device to be such to allow many attempts - so I don't have to worry about filling in the disk
  5. Easy and visible feedback what the current time in the challenge is

It wasn't hard: first part of requirements were perfectly covered by my 'Desktop Pi' - Raspberry Pi 4 with 8GB of RAM, 512GB SSD:

Desktop Pi

Desktop Pi InsideDesktop Pi Inside

Along with it I needed long camera cable and tiny fish eye adapter that, if I remember it correctly, actually came from 2018 or 2019 PiWars - really useful addition to camera lens. It allowed camera to be slightly lower and still pick up whole arena.

As for 3rd requirement - that was relatively easy: I've mapped a key on PS4 controller (PS key) to output a simple message (start) on challenge topic of MQTT, wrote small Python program to listen to Flig's PyROS MQTT broker and toggle invocation or stopping (sending SIGINT) of libcamera-vid on desktop-pi. Another quick win - low hanging fruit for the Farming challenge!

Last bit may be solved by additionally adding timer in video post production, but it wouldn't work for me for feedback how far in the challenge we are.

So, I reverted back to little device a friend of mine and I did some good 25 years ago or more:

7 Seg Display

It has i2c (yes, i2c existed way before Raspberry Pi) 7 seg display driver (SAA1064), 8 bit i2c I/O expander (configured to 4 input and 4 output lines) and i2c EEPROM. We used it for some industrial machines (big cookers that needed to keep temperature constant, custom built machine that was making small coils for setting up number of steps on X axis and number of turns, etc). And, in this case - it presented as perfect candidate for feedback to me - how much time passed since start of the challenge and at the same time as timer which is visible by camera.

Level ShifterLevel Shifter And it worked perfectly well with Raspberry Pi in the past. But it didn't want to work with Raspberry Pi 4! After scratching head for a while I finally realised that most of the equipment built in previous millennium was built to work at 5V. Luckily, around the time I remembered that in my last (re)organising of electronics bits and pieces I rediscovered a little bag with couple of small FETs and a few resistors, labelled "level shifter". 15 minutes later I've got it:

All rigged and tested shoved one little flow in the display itself - there was too much light reflecting from the displays and digits were hard to be seen on the camera. I've fixed it by using one of the anti-static for electronics I cut out a piece, gently sanded it and glued it at the top:

anti-shine

Last touch was to utilise fact that desktop-pi was treated as proper desktop computer by me - it had set of speakers attached to it so all I had to do is to use pygame's sound engine and play 4 short and one long beep before challenge is to start and 9 short and one long beel at the end. More about them in the videos from recorded challenges

anti-shine