Link multiple Micro bits

Hi, planning on using microbits for a project. I was wondering whether it was possible to link a series of microbits, so that they were aware of each others relative position. I’m guessing this is where the accelorometer would come in. Is this feasible, do any online experts have words of wisdom ? cheers.

An accelorometer would give you the direction the Microbit is moving, and potentially it’s compass bearing, but I’m not sure if you could use it to get absolute position.
If you really did just want positions relative to each other, you may be able to get away with it using some lovely mathematical trickery to record the directions each Microbit has gone in and for what amount of time, and use that to draw a sort of “map” for where each bit is.
What you’d really want is some kind of GPS mapping to get a X and Y coordinate for each bit, but I’m not up to date on Microbit hardware specs, so I’m not sure if a GPS module is available.

Edit: It seems that most 4 pin GPS modules should work with it! Pimoroni sell a couple themselves. https://shop.pimoroni.com/search?type=product&q=GPS

Wow, thanks! That’s a fantastically fast response! :)
Essentially what I’m hoping to do, is devise a project for secondary kids where they are building a facsimile of the old school “mastermind” game. Remember? 4 colour code puzzle. You marked a black peg for a correct colour in the right place, and a white peg for a correct colour in the wrong place.
So I envisage some boxes the kids can stack, with BBC MB’s in them. The MB’s are connected in as much as box A must be to the right of B,C and D. B must be to the left of A, and to the right of D and D.
If the condition for each box is Yes, then we get a green light displayed. If No, then a red light.
Something like that. Still very much making it up as I go along!
I’m new to the microbits but know that the kids have them, so this seems a good way to play wth them. Your suggestion of GPS modules seems workable. As long as we think it can be done, I can get walking up that learning curve, and solve this somehow! :)

1 Like

This could possibly help you http://www.multiwingspan.co.uk/micro.php?page=pybit2bit

Or if not maybe there is another page down the side that could help you.

1 Like

You may also find that, if your Microbits are going to be close together, you could use magnets hooked up to the GPIO pins of the Microbits, that then “click” together to form the complete circuit. The bits could then communicate as pi2003 described, and find your result.
GPS would probably be too inaccurate for your small area needs, so something much simpler is probably nicer!

Thanks very much again!
The issue about small scale accuracy could be quite a big one, although all we’d need to know is where they are relative to each other on a horizontal axis.
I think, for the purpose of this project, I’d need to have the MB’s encased in a box of sorts. It’s the box that they will be picking and moving, with, ideally, the bits hidden inside. Requiring magnetic contact would put a spanner in the works too.
Sounds like I’ve given myself a bit of challenge!
I need to research this some more!

Haha, indeed! There are many possibilities, such as RFID (Radio Frequency Identification) or NFC (Near Field Control) which might be able to give you what you want, but you’ll be looking at some quite complex mathematics.

Hmmm. Did you say “Complex Mathematics”? That’s me out then.
I think its one of those projects which sounds quite straight forward initally, but it s quickly getting beyond my reach. I may have to find some other exciting ways to utilise the BBC bits for now, and come back to this later when I know what on earth I’m talking about! :)

There are many people here whom have completed projects “way out of their league”! If you need any assistance to get you going, this forums the place to be!

1 Like

Well, its why I signed up! :)
I’m an artist who is only just starting to delve into tech worlds, not a tech who is steeped in erudite coding law! I’ll go back a few steps, and keep an eye on this project. I think it would be great for the kids if we can work it out at some point.

1 Like

hey. What if the blocks had to be put on a ‘mat’, with specific slots for the 4 blocks. Could there be a sensor that reads a source specific signal? If the ID for a block is the correct, the output confirms a correct placement. Or not, if its the wrong block ID.
Surely this would be a much less complicated procedure? Please say yes! ;)

Sure!
You could either use RFID in order to read a unique code wirelessly from the blocks, or go down the route of metallic pads in order to make a GPIO connection.
Of course, you’ll also need some sort of “mother board” micro controller in the base ‘mat’ in order to read the incoming signals and decide whether or not to activate the LED.
Either that, or you could completely scrap the idea of using Microbits in the blocks, and just make it so that when all the blocks are in the correct positions, a circuit is completed to light an LED.

Simple. :D

sweet!
I think defo for the individual block readouts. Needs to give a sense of progression for problem solving.
With several MB’s they can be coloured, and not all will be suitable, allowing for logic based trial and error as in the original game.
I’m thinking it will be possible to enable some kind of 2 stage confirmation?
ie 1.The block chosen is on the list of correct blocks, but its not in the correct slot. Therefore we get a green light.
2.The block chosen is on the list of correct blocks, and is also in the correct slot. Therefore we get a red light.
I suppose the slots will have to be linked in some way so they all possess
the solution and can identify the blocks as they are placed?
Is the RFID soemthing that comes wiht the Bits, or as an extention?
cheers.

The slots could all just be wired up to one micro controller, like another Microbit, Raspberry Pi or Arduino etc. which would then check through each slot in an array, see if it has a connection, and if so, check if it’s right. It could then communicate back to the Microbit in the cube that it is fulfilling (or not) one of the specified criteria, and display the appropriate message.

RFID can be expensive and complicated, but it’s nice. It doesn’t come with the MIcrobits, but you can pick it up from Pimoroni or similar stores such as Adafruit. Each Microbit would be fitted with an RFID tag (which you can get for pittance), and each slot with an RFID reader. https://shop.pimoroni.com/search?type=product&q=RFID

Actually, thinking about it now, RFID may be a bit complicated for the route you want to take, mainly because of the expense! I’d recommend some sort of physical connection between the Microbit boxes and the base plate, unless anybody else has any ideas!

There was something like this set up at STEELCON- it used 3.5mm jack connectors for each slot, and the blocks (which were different logic gates) simply shorted one or more of the ring/ring/sleeve to the tip to form a very simple block ID.

3.5mm jacks worked well, since they’re normally rated for a lot of insertions (see your headphone jack), don’t require plugging in a specific way up, and come in TRRS varieties (Tip-Ring-Ring-Sleeve) which have 4 electrical connections in them.

4 connections = 3 bits + 1 for ground.

3 bits is 7 ( 2^3-1 ) possible permutations, but we have to ignore permutation 000 since that would be “unplugged”, which gives six uniquely identifiable combinations left:

000 = Unplugged
001
010
011 
100
101
111

The same colour be accomplish with 4 metal contacts, or pogo pins, but they may be harder to deal with. The great thing about 3.5mm plugs is they basically require no components but the plug itself and a bit of wire/solder. You then just need one micro:bit to read the state of the pegs- which admittedly would require 3 “read” pins plus one pin for every slot you want to read.

/waffle

1 Like

A belated thankyou again to the advice. It seems quite complicated, but most importantly it also seems do-able!
I’ll park it and do some investigations. Cheers guys!

1 Like