Posts

Showing posts from November, 2024

Understanding the hall sensor input matrix

Image
 We're using "multiplexing" to read our grid of 16 hall effect sensors. This means we don't need to use 16 individual input pins for reading inputs (which would just about max out an Arduino, and would be too many pins for a NodeMCU ESP8266 type microcontroller). Instead, we split our grid into "rows" and "columns". Then we activate each row, and read the values from each column. This means we need four i/o pins for the rows (outputs) and four i/o pins for the columns (inputs). Let's look a little closer.... Each hall sensor needs power (3.3v-5v supply) a ground connection and has a "floating" signal pin. When a magnet is presented to the sensor, the signal pin is forced "low" (to ground). When the magnet is removed, the signal pin is left floating (note, it is not driven "high" but allowed to "float" to whichever default value we want it to take - the technical term is "open drain" but we don...

Creating our first light-up 4x4 panel

Image
 Here's our first attempt at a 4x4 light-up panel. The idea here is to connect all the 5v and ground pins on the panel together, using copper tape, and create a daisy-chain effect from one strip of LEDs to the next By cutting away at the circuit board, where the 5v and ground pins are, we could create a continuous connection by adding a simple blob of solder from pin to copper strip. Needless to say, it didn't work! But that's probably a good thing - because when it didn't work, it forced us to abandon the idea of using copper tape for the LEDs (connecting each to the next using wires at the end of each strip) which allows us to use the same surface for running copper tape for our hall sensor input array. Our second design was much more successful. It may be easier to think of this as two panels, overlayed into one space. Firstly, there's the LED strip, chopped into bits, and connected up again, into a "snake-like" layout Then underneath this, we have our ...

Getting really fancy

Image
 So far, we've focused on creating an "input device" for tracking pieces moving around a playing surface. One of the things we really wanted to focus on - and have refused to budge on, over ten years of development - is that the "augmented board" really shouldn't get in the way of the game. We don't want the board to just  be an input device for playing a video game. The idea has always been to keep the action on the board, not on the screen. We even spent some time investigating having a blank screen app, and game action prompts being audio-only. But that made things difficult when trying to explain "you need you place something here on this square" and a tabletop game skirmish game could quickly begin to feel like a chess board, with instructions like "place something on square A4". Having to stop the flow of the game, for someone to count out rows and columns on an (imaginary) grid over an irregular playing surface, in order to pla...

Fewer pins = better?

Image
 The idea of losing the data wire, and requiring only power and ground to make our board sections work feels almost revolutionary! Suddenly, we could have board sections on top of buildings (for large, open area wargame type scenarios). But reducing our connectors down to just two pins (instead of three) also means a slight problem - because a two-pin connector isn't symmetrical. And, as we've already discussed, having boards with just two pins can mean all kinds of problems if someone were to rotate the board around, and try to connect incompatible pins together And the answer was as simple as it was obvious. Simply stop trying to make the board panels symmetrical! Don't allow people to rotate the boards to connect them together! In fact, making the board panels in such a way that they could be  rotated only means additional complexity in working out where each square on the board is, in physical space. As the board piece rotates, the physical location in space of our 0,0 ...

Wireless means one wire less

Image
 Suddenly, the idea of having wifi modules that can automagically connect to a home network seems like a great idea for a multi-part board gaming surface. Instead of having a single, master controller that all the hardware eventually connects to, then using that as a bridge to the app running on a phone/tablet, we can just have the app and the board game pieces talk to each other seamlessly over wifi. And the best thing? One less wire. There'd be no need for a data wire or even for all the board pieces to be physically connected to each other. You could have one over here, one over there, one somewhere else.... So long as there was a consistent means of getting power to the devices, each one could effectively be a stand-alone unit. We could even put a rechargeable battery in each board section - just switch them on, throw them down onto the table, and you're ready to play! Of course, having multiple board sections for a nice large playing area (such as a HeroQuest dungeon or a ...

Keeping the noise down

Image
 These little ESP8266 NodeMCU modules are great little things. You can get them to boot up, connect to a router and then immediately start broadcasting their presence over UDP. What's the point in that? Well, the idea is that we would have our app listening on a UDP port, and when an incoming message is received from a new device just booting up, the server could "shout back" at it. When the NodeMCU client hears the server shouting back at it, the client will have the server's IP address. At this point, the client could STFU and try to make a TCP connection to the server (to ensure connection stability). If any of the UDP packets don't get through, there's no problem. The client keeps shouting until it's heard back from the server. If the server misses the client's UDP packet, nothing happens - the client shouts again a few seconds later. If the server hears the client and shouts back, but that  packet gets lost, nothing happens; the client just shouts...

The ESP8266

Image
 Many long-time users of the Arduino platform are probably already familiar with the ESP8266. It started out as a wifi-to-serial module you could hook up to your Arduino and send messages over wifi to your flashing LEDs and motor controllers. Then it appeared as an integrated board, and multiple variations hit the market. A common one is the NodeMCU and it's derivatives. These are great little Arduino-compatible modules that you can set up in the Arduino IDE as programmable controllers (just like an AVR ATMEGA328 or similar microcontroller) but they have loads of other cool features (not least of all, multi-threading!) But most of us stick to using them like a beefed-up Arduino (they have loads  of RAM memory and plenty of programmable storage to run pretty sophisticated firmware on them). It was while playing with one of these for a completely unrelated project, that I suddenly hit on the idea of having a "network" of board game playing surfaces, all broadcasting over wi...

A brief history in time

Image
 The history of this project, to date, is - believe it or not - the abridged version. There have been lots of other ideas tried, exploratory into different technologies, connectors, numbers of sensors in the matrix, different types of sensors (inductive sensing looked promising for a while, while cross-talk with RFID readers meant that never really got off the ground). We even looked at abandoning hardware altogether, and building an overhead Raspberry Pi camera, that would simply watch the game being played out, and use "AI magic" to track the pieces (this is still a possibility worth exploring in the future, but so far shadows and simply sticking your own big head in the way while moving the pieces means it's never an uninterrupted gaming experience). The failure of Raspberry Pi was quite a lesson for us. We could get it working by introducing a "trigger" - i.e. move the piece(s) as necessary, then instigate a trigger which told the Pi "now look at the bo...

Connecting multiple boards together

Image
 One of the big hangovers from trying to produce a retail-ready product, was the idea of making sure all the electronics were safe. To date, we'd used pin headers as edge connectors on the sides of each board edge - just plug in some pins into a recessed socket and connect the next board. The idea was for everything to "just work" without needing any configuration. This proved trickier than first imagined. For example, it introduced the concept of "polarity" for the connectors. If we had a connector with power on the left, and ground on the right, on the top edge of the board, it meant that the connector on the bottom edge also had to have power on the left and ground on the right. Which is totally fine. Until someone unwittingly rotates a board 180 degrees (they look the same whichever way around they go!) and tries to plug it in. Now you'd have power going straight into the ground pin on another panel, and likewise ground into power. In short, it had a ten...

Smaller is always better, right?

Image
 The great big 2ft square boards were fun to build - and when they worked, they were impressive to behold! But building and debugging them was a real pain! And getting the boards cut to exactly the right size could prove problematic (not everywhere has a local wood merchants with a laser-guided table saw that can cut to within 1mm). Already we were considering how people would make these at home, or in a local hackspace/makerspace, or using common tools (like a laser cutter or a cnc router). 2ft square boards were just too big and cumbersome to be DIY-friendly. So we looked into 12" square 8 x 8 grids... Yes, in order to create a 2ft square board you'd need to make four of these, instead of one large board. But the amount of wiring was about the same. And it's just far, far easier to debug a smaller panel The smaller size also meant we could easily laser cut the MDF on an A3 laser cutter. In fact, with a little clever gluing, it was even possible to make the board out of t...

Bigger is always better, right?

Image
 A few months after receiving a box full of PCBs with hall sensor arrays on them, something peculiar started to happen - the boards themselves started to "curl" and refused to lie flat on the tabletop. As the boards were made from fibreglass, they were difficult to reset - and being too forceful with them, trying to get them to bend in the opposite direction, caused more than one to snap cleanly in half!  We needed something "stable" to mount the boards onto. Like MDF perhaps? And then we got to thinking - instead of paying for relatively expensive "large format" circuit boards, would it be possible to make something similar, using a "arts and craft skills" (ok, copper tape) and mounting the components directly onto a more stable base (like some 6mm mdf board) ? It turns out, the answer was "yes". The cost of materials for producing a large 2ft x 2ft playing surface, with a grid of 16 x 16 sensors plummeted to "a few quid" for...

Some time later....

Image
 So our clever electronic game idea sat in a drawer for many months (years?) but it was always there, bubbling away as "unrealised potential". As time passed, the cost of manufacturing (particularly in China) steadily increased to the point of making such a game idea commercially unviable; at one point we worked out that each board section would need to retail at about £40 just to break even on production costs (allowing for distributor and retail costs). Even as board games regularly hit £80-£100 on Kickstarter (I know, a bargain by today's prices!) asking someone to drop a few hundred quid on an untried gaming platform - with an uncertain development future (I was still working full time as well) - was just too much. But the idea of a gaming system, on which people could play games either against each other (across the internet) or a computer AI opponent just wouldn't go away. If the first idea was too specific - would it be possible to focus more on a generic gamin...