back to article A Raspberry Pi HAT for the Lego Technic fan

There is good news for the intersection of Lego and Raspberry Pi fans today, as a new HAT (the delightfully named Hardware Attached on Top) will be unveiled for the diminutive computer to control Technic motors and sensors. In the belly of the beast: Pi Build HAT next to your correspondent's Lego In the belly of the beast: Pi …

  1. ShadowSystems

    Doomed! You're all doomed!

    My Evil Plans can commence at last! Muh Hahahahahahahahahahahahahahahhhahhahaha...

    1. Dan 55 Silver badge

      Re: Doomed! You're all doomed!

      Until you look at how much the Lego costs.

      100... billion... dollars.

      1. J. Cook Silver badge

        Re: Doomed! You're all doomed!

        I see what you did there. :holds left pinkie to lips:

  2. Mike 137 Silver badge

    Actually, a huge leap

    "... once a curious mind has created a bit of code to operate machinery in the real world via the rapid prototyping made possible by the kit, making the transition to more advanced applications is not such a major leap"

    The actual leap is from blindly tweaking something you don't understand the internals of - to obtaining a holistic views of how the entire system works.

    It's a leap of approach as much as a leap of information. It's fundamentally a change of thought process, and that's not all that easy to make.

    I see the lack of it all the time, manifested by systems with poor performance, poor ergonomics and poor reliability, so we should be teaching the more effective thought process from the start, rather than trying to tack it on after teaching the less effective one. The problem is typified by software development degree courses, where secure development is left until the final year and is often an optional module. As a result, insecure practices are so strongly engrained by the time the module is taken that it doesn't make a lot of difference.

    I'll probably get down votes for saying anything at all negative in the context of the Pi. but this is not specifically about the Pi - it's a matter of principle about the way we teach. For example, on a visit to the BETT expo before the pandemic, on over 200 stalls I couldn't find a single electronics related teaching material that exposed the actual mechanisms of the item to view. Everything was packaged opaquely, on the basis of "just plug it together and follow these instructions and it will work as expected".

    1. Joe W Silver badge

      Re: Actually, a huge leap

      I agree - to some extent. I don't really see the sense in teaching "proper security" from the beginning on (and I'm talking about kids aged 6 and up[*], not university level courses). Feeding their curiosity about how to make the machine do their bidding is the aim. What they will be taught is checking input, and making sure the motors are not fried by running into the limits of motion of the model (and this is something they will figure out, probably by themselves). I think it is a good start. Should we prioritise security by design? Yes, more than we do it now[**]. The question is really when and how, and how high of a priority we want to make it as a function of time. Not a top one from the very beginning, as this will discourage kids from pursuing the subject.

      However, I fear the ship has long sailed, as we all know the classic problem of people just using example code or going on stackoverflow and copying "solutions" without understanding them or their implications. Unless we manage to clean up ze interwebs at the same time we stand no chance.

      What I really like about MindStorms is the inclusion of LabVIEW (even if it has been rebranded). This is a good introduction to the mindset of programming a control flow (and it can be extended by writing libraries in C/C++ or Fortran). This is sadly absent from the Pi offerings, as far as I can tell - if somebody has a good alternative to LabVIEW on the Pi (or Arduino, or ESP) I'd be happy to read about it!

      [*] No, MindStorms is not aimed at that group. Nor is the PiHAT in the article. I know that.

      [**] I'm totally guilty of that, e.g. not sanitising input if I feel I can get away with it...

    2. elsergiovolador Silver badge

      Re: Actually, a huge leap

      related teaching material that exposed the actual mechanisms of the item to view

      This is probably because the moment they explain all the mechanisms, someone in China will setting up clones the second they finished reading the specs.

      Unfortunately elites have outsourced our factories to China and so giving them a great leverage. Oh you want to enforce IP rights, it's a shame if something happened to your factories...

      In the past they would provide schematics and even detailed description how these things work, but they also knew a kid reading those will unlikely clone the product and start selling it as their own.

      1. Mike 137 Silver badge

        Re: Actually, a huge leap

        "This is probably because [...] someone in China will setting up clones"

        Actually I think it's because most of the teachers don't actually know enough about the subject to cope with explaining the principles. When I taught electronics technicianship, the 'tutor pack' contained all the test papers and a crib sheet of answers for each. They seem to have assumed that the tutor wouldn't be able to mark the papers without the cribs. In fact on one course, one of my students told me theta when my predecessor was asked a question, he always grabbed the textbook and thumbed through it before answering.

        The result of course is really neither teaching nor learning - it's a mere diploma mill. When I was taught to teach (on the job by an excellent senior) he told me "you've not taught it until they can use the knowledge independently". The best way I found of making that happen was to cause my students to think it out for themselves with guidance where needed, but that meant me setting non-obvious problems to be solved, and students learning from their mistakes. Unfortunately, current educational theory disallows failure as it might warp a fragile psyche, so everything is made superficial and easy and no real skills are gained. So exams are passed while proving nothing about abilities.

        1. Joe W Silver badge
          Pint

          Re: Actually, a huge leap

          A thousand times yes!

          Students are no longer taught to try and understand the basics, but rather regurgitate stuff that came up in the lecture. This goes so far that they even have to reproduce the teacher's definition for stuff verbatim (in fields like physics), or get taken off marks.

          As to failure? That is because they are no longer students but rather considered customers. And this is why I'm dead against any fees levied.

          1. Mike 137 Silver badge

            Re: Actually, a huge leap

            "That is because they are no longer students but rather considered customers. And this is why I'm dead against any fees levied."

            I suspect that fees are not the source of the problem. Prior to the introduction of grants, university students either paid fees or won bursaries and scholarships, but (at least in the late 19th and 20th centuries) mostly took their studies seriously. I think it's a general culture change, partly borne of the expectation that half the population should take a degree. Previously there were three tiers of higher education - university for future academics and public officers, polytechnics for future engineers and technicians, and trade schools for future technical trades people. In general, in each case most students were committed as there was a clear progression from learning to livelihood. Unfortunately, now, the degree is a mere rubber stamp used by HR for first round selection regardless of subject, so the certificate has become more important than the knowledge gained. As a result, grade inflation is not surprising - e.g. 20 years ago around 7% got a First, now over a quarter do, but the courses and teaching are much the same. Evidence submitted by lecturers to a House of Lords enquiry a couple of years back included statements of coercion by college administration to award undeserved grades in order to maintain institutional rankings, and even statements that job security depended on awarding high marks all round.

            We no longer have an education system - we have a national diploma mill.

            1. Joe W Silver badge

              Re: Actually, a huge leap

              Yes. That is another reason.

              Why I need to have the university admission to start an apprenticeship as an electrician or carpenter is still unclear to me. I do not need to "study" to become a plumber. If I need new utilities in my place, I wnat somebody who can do the work, not some idiot who has studied the theory (I'm quite able to cover the theory, which is only theoretically the same as the practical part).

              The main problem is that an apprenticeship is considered "less worthy" (what a load of crap!) than studying, and that teachers have a hard time teaching - classes are way too big, pupils have sort of resigned to their fate (or are actively sabotaging), and it is difficult to get them back on track. Actively assisting the slowest 10% or so in a class just does not happen. And then those kids don't see their problems being recognised, they don't see any encouragement, they don't see a future. Reaching those kids should be a top priority. It is hard (several friends are teachers, for different age groups), and society does not honour it.

    3. Anonymous Coward
      Anonymous Coward

      Re: Actually, a huge leap

      "just plug it together and follow these instructions and it will work as expected"

      It's a problem with all technology - and probably other areas of human knowledge. If you don't know the underlying constraints then you might breach them. Plug&Play is all very well - but it would be useful if there was at least a link to more detail.

      On model railways there is a device to automatically clean tracks/wheels by a high frequency voltage application. The manufacturer's literature says it can only be used on "analogue" systems not "DCC".

      It needed a query to establish that the important caveat wasn't just a "DCC system" - but if a locomotive running on an analogue system also had a quiescent DCC decoder fitted. In the latter case you would fry the decoder in the locomotive - and the analogue motor function would also then stop working. Knowing whether a locomotive has DCC fitted might require taking the body shell off and knowing what you would expect to see.

    4. John Brown (no body) Silver badge
      Headmaster

      Re: Actually, a huge leap

      Education has been dumbed down to the extent that education itself is too difficult a word or concept to use. From government ministers all the way down to pupils being interviewed, it's simply called "learning" now. Note in particular, media interviews where we are constantly reminded of kids missing school due to COVID-19 and therefore missing out on "learning". And don't forget, "learning" must be fun or it's not proper "learning".

      1. Mike 137 Silver badge

        Re: Actually, a huge leap

        "don't forget, "learning" must be fun or it's not proper "learning"."

        Real learning is fun - personal recognition of real achievement rather than just 'a sense of achievement'.

        As Walter Sawyer said at the start of his 1943 book 'mathematician's delight', there are real subjects and imitation subjects - the first taught via understanding and the second by rote. He goes on to say "it is far easier to learn the real subject properly, than to learn the imitation badly. And the real subject is interesting."

        1. John Brown (no body) Silver badge

          Re: Actually, a huge leap

          Yes, if you have a very good teacher, good resources and reasonable class size. Sadly, a rare combination in the UK education system. "Fun" learning seems to mean bright colours, shiny tech and lots of noise for many kids. Most teachers do try, some try very hard, but it can be demoralising working with over large classes and limited resources. Only the very best teachers can cope with that.

          Part of the "fix" seems to be a reliance on teaching assistants. I wonder if that's not hindering more than helping, ie if every teacher has an assistant, would it not be cheaper to hire two or three extra teachers who can have smaller classes than having 10 assistants? (Looking at primary schools here)

          1. Mike 137 Silver badge

            Re: Actually, a huge leap

            It's not even entirely a matter of staffing or class sizes - it's primarily down to what is set out to be achieved. Even at secondary level and beyond, there's negligible interest in cultivating enquiring minds. For example, most practical work (insofar as it still exists) is designed to yield a foregone conclusion with negligible opportunity for anything unexpected to occur. Unfortunately the unexpected (and resolving it) is a key pathway to cultivating enquiring minds.

            I developed a couple of versatile electronics teaching aids that encouraged sequential decision making by students in order to develop analytical skills, but despite their being really low cost, nobody in the education sector was interested in them. Everyone wanted pre-defined "experiments" with predictable outcomes achieved via documented steps.

            Of course, an exercise with a predictable outcome is not really an experiment at all - it's merely a demonstration. But real learning starts when you have a problem to solve, and demonstrations don't provide that.

  3. elsergiovolador Silver badge

    Overengineering

    For something that is quite possibly will be just turning motors on and off and maybe reading some sensors, that looks like an overkill.

    Why not use Arduino?

    How much carbon does it cost to build Pi + this hat versus Arduino?

    Then the class is going to think they really need so much processing power to turn the motor on.

    1. Anonymous Coward
      Anonymous Coward

      Re: Overengineering

      Arduinos are relatively slow and even a Mega 2560 has limited volatile ram. Cheap ESP devices have much faster clocking but they also seem to generate much larger base software loads. They also have fewer I/O pins.

      I only use my Raspi to run a standard screen saver slideshow of jpeg pictures**. Arduino Mega 2560 have become my staple control device - although UNO and Nano do service for simple operations that don't require much volatile ram or many pins.

      Even tthe Mega gets enhanced by some functions being implemented with either custom Vero board constructs or standard HW modules.

      Horses for courses.

      **The Raspi wouldn't be needed if someone made an 8" display that remembered (and restarted) the selected USB stick "slideshow" mode after a complete power-off. Not that the Raspi is totally reliable doing this simple task.

      1. elsergiovolador Silver badge

        Re: Overengineering

        Arduinos are relatively slow and even a Mega 2560 has limited volatile ram.

        These are excuses. That's also part of the problem - people instead of thinking how to create an optimal solution, would just throw more hardware at it until it does its thing reasonably well and call it a day.

        If you need performance for automation (to open and close that garage door at 100MHz), then Teensy 4.0 or 4.1 can probably deliver more performance than RPi in terms of I/O switching.

        1. Anonymous Coward
          Anonymous Coward

          Re: Overengineering

          "These are excuses."

          Laws of Physics. I started programming when 1MB was an enormous mainframe. Cramming quarts into pint pots was a necessary skill. I'm used to deciding a trade-off between cunning obfuscation and life-cycle supportability.

          1. elsergiovolador Silver badge

            Re: Overengineering

            Laws of Physics.

            Have they changed? You don't need MBs of RAM to flip GPIO.

    2. Fred M

      Re: Overengineering

      It is indeed overkill from a hardware point of view. The RP2040 that's on the expansion board and a bit of C would be enough, but that's not really the point.

      This easily links two things that kids (or more likely big kids) might already have lying around - Lego motors and a Raspberry Pi. I guess the idea is to take these two and help kids make the jump from block programming as used for Lego Boost, WeDo, etc. to a bit of Python.

      1. Joe W Silver badge

        Re: Overengineering

        Arduino-based:

        https://arduinolegotrains.wordpress.com/

      2. cornetman Silver badge

        Re: Overengineering

        I would say this is the primary reasoning here.

        It is much more likely that someone interested in this kind of thing might have a Pi hanging around already and this is merely a handy connector between two existing technologies. A pretty reasonable idea I would have thought.

        1. werdsmith Silver badge

          Re: Overengineering

          The pi is a little computer, it can do all sorts of things apart from just control its IO. It will provide you the interface to remotely connect and it will be your computer. I am typing this on a Pi.

    3. Gene Cash Silver badge

      Re: Overengineering

      Why not use Arduino?

      Because Arduino are a pain in the ass to use, especially if you're a young kid trying to learn things. They're ok as a 2nd or 3rd system to learn on.

  4. Allonymous Coward

    The Lego set is HOW much?

    Rhetorical question. I’ll climb back onto my chair now.

    1. Joe W Silver badge

      Re: The Lego set is HOW much?

      Yup. 1) the Danegeld and 2) the LabVIEW license (that is also not cheap)

    2. Anonymous Coward
      Anonymous Coward

      Re: The Lego set is HOW much?

      My first instinct was that I had missed a decimal point.

      I gave the neighbours' kids what I considered generous cash presents for birthdays and Xmas. Then they told me how much even their small Lego sets were going to cost - so I upped the ante.

      On the other hand they filch exotic bits from my "Lego Box" - which was bought from a charity shop that sells it by weight. Something like 10kg for a few GBP.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2022