Scratch -> Lego Mindstorms

A bit of hardware hacking for Troon Primary CodeClub, who have tons of old style Lego Mindstorms they don’t use any more, and after a year of Scratch programming on their PCs are just getting started with Raspberry Pi. We’re using this Scratch modification together with the hardware I’m making which is based on this circuit. The main thing here is an L293D Motor Controller IC which can drive 2 DC motors in both directions. You can write the hardware code in Scratch like this to control the lego motors:

blink11

The most tricky part in this whole endeavour has been physically connecting to Mindstorms. At the moment I’m having to use crocodile clips which won’t work long in normal classroom conditions – but I’m wary of destroying/modifying the connectors as they’re not made any more…

IMG_20140317_111808

Comments

11 responses to “Scratch -> Lego Mindstorms”

  1. Glen Avatar
    Glen

    We’ve got a number of “broken” wire connectors in our Lego kits, maybe they can be repurposed? Probably lots on eBay too.

  2. dave Avatar

    Sounds good – should we join forces on this? I can build you a board to try out. How are you working with Mindstorms at the moment in Redruth?

  3. Simon Walters Avatar

    Great stuff 🙂 I’ve got quite a few of those motors in my schools so I’d be very interested in a good way of connecting them up as well

    Simon

  4. dave Avatar

    Thanks for ScratchGPIO and your blog, which is proving very useful! I’m hoping this can be a way of making CodeClub a bit less screen based…

  5. Raspians Avatar
    Raspians

    You could then use this for example any RJ12 breakout kit would work wouldn’t it? I just randomly picked this link as an example.

    http://www.winfordeng.com/products/pbc6p6c.php

  6. dave Avatar

    This is all great stuff – thanks very much! I had a go at the tabs on the brick but was a bit scared of breaking them, the backing plate seemed stuck. It looks like they are more hackable than I’d feared, so I shall go ahead with more confidence 🙂

    It’s good that they have moved on to RJ12 though. At the school they also have yet another type of Lego connection with a more recent educational kit – I wish they would standardise.

  7. Glen Avatar
    Glen

    Yes, this term we’ve been trying out the old Dacta + RCX kits, not getting too far away from existing material – main problem has been lack of working batteries and slow firmware downloading because of RoboLab rather than command line. Next term, not sure, we may be back on Scratch, but Scratch & Lego sounds like a nice combination.

  8. […] have any lesson plans for this, but based on some comments from the first workshop and from playing a bit with this during CodeClub teaching I felt it might be good with this age group, who already know quite a bit about screen based […]

  9. […] of using my previous homemade interface board, we’re using the pimoroni explorer hat (pro). This comes with some nice features, especially […]

  10. […] tried a lot of different ways of teaching children programming, starting a few years ago with primary school children in a classroom, then doing inset training days for teachers and finally private tutoring in homes. […]

Leave a Reply

Your email address will not be published. Required fields are marked *