Robots - microcontroller vs computer (Raspberry Pi)

Page content

robot types

Do You Need an Operating System?

Using a small computer that runs an operating system (OS), like the Raspberry Pi for example, adds an overhead which can be uncessary if you’re just wanting to turn things on and off, or read whether a pin is set high or low. If you’re doing more complex calculations, such as doing live image recognition with open CV, then an operating system might be required. An operating system also takes some time to start up, connect to the network, and any other things it may need to do. A microcontroller board such as an EPS32 or BBC micro:bit will usually boot up relatively fast, and then run a script. Such boards are often relatively lighter, in both physical weight and overheads, and if they just need to read pins for sensor readings or turn things on an off, they’re often much simpler to deal with. Most of these just require plugging into a computer to initally write the firmware (maybe the bootloader which essentially hands control to your script on boot, depending on what you’re using) and then start running your script as soon as they restart. With a computer, you initially write the whole operating system to a ROM or sdcard, and then maintain that operating system which runs a kernel and a multitude of software packages running on it. If you’re just teaching a group of kids how to put together a robot and get it to do things, then you might find that a microcontroller robot is a simpler solution. Examples of microcontroller boards used in education include the BBC micro:bit and the Circuit Playground Express, which can both be programmed using MakeCode or a flavour of Python. The corresponding robots for small microcontroller boards are also typically a bit smaller and easier to transport than some of the computer-driven ones.

Block-based or Text-based Programming

Depending on the age and skills of students, there are various levels at which hardware can be accessed by a robot. For those younger or less skilled an abstraction layer makes things easier. Others may find it simple enough to read a value from a pin that a sensor is connected to, or send a number to change a value sent to a pin to drive a servo. The more experienced may create their own functions to send, receive, and interpret raw bytecode values to hardware devices that do not yet have a library available to interact with them. It’s also important to remember that the level of functionality available when a robot ‘supports Python’ can vary immensely, depending on which incarnation of Python may run on it. Where a Raspberry Pi robot will generally have a more capable version of Python available, most microcontroller boards will usually have a cut-down version such as MicroPython, or Circuit Python, with variances between different hardware running the same language. For example, Circuit Python does not support embedded assembly language, while MicroPython on the micro:bit does; and many functions or importable libraries may be available on a PyBoard but not a micro:bit. The small Edison robots that sport Lego-compatible studs, for instance, can be programmed in Python, but it is a rather limited Python, only accessible from the proprietary software supplied with it. Constraints that may influence the amount of functionality in a programming language implementation include the processing power, amount of memory, and storage available on a piece of hardware.

Balancing Budget and Use Cases

To get some robots for your code club, maker group, or school usually requires some sort of funding, be it donations, school budget, or just scrounging parts and making your own. For our code club, I ended up donating a couple of old Raspberry Pis we had, and then the school got the robot parts for that first year. I think we also got a Raspberry Pi 2 with a case. We were also able to make use of a Mindstorms and use a Raspberry Pi model B and a Dexter Industries BrickPi to run the EV3 parts. It wasn’t an ideal case, but it meant that we could run robot workshops for small groups of students. We were able to show a bit of value to the school wider community by doing some demos of what we’d learned. THis is important, as it can help with getting or maintaining funding, however large or small that may be. Later, I was able to do some introductory coding in MakeCode at a school open night, which got us a small fleet of micro:bits that came from the parents group. This led to the school being able to spend a small amount of money on a few Adafruit Circuit Playground Express boards, and some soft cases to prevent damage to the micro:bits. Other times we were able to get equipment donated for helping out other groups with coding demonstrations. We even got some MakeyMakeys for our efforts. Our young code club kids ended up teaching others too, which led to improvements in what they could learn! We had heaps of small issues to deal with when setting up the robots, from getting them connected to a usable wireless network, and creating cheat sheets for students to navigate the operating system (it helps to keep things clear and simple by including only what is required for the activity). We also had a few issues with the robots being a little less robust than we’d have liked.

Create Content and Help Teachers with Coding

It helps to make robot activities as easy to replicate as possible; this can be through teacher training, or just putting together good activity sheets with notes on how to set up and run things. Our school has been using the code.org material to teach some of the Victorian curriculum, but there’s also a strong mapping between the Code Club Australia curriculum and the Australian curriculum. They also offer teacher training, which is delivered in a fun and engaging way (I’ve sat in on some of these and in my opinion, they’re very much more about fun while learning, than some of the boring trainings I’ve seen). At the end of the day, it is just easier for places that may host your code club to justify contributing when they know there is a strong benefit to one of the services they provide; for schools, this means putting on exhibitions for parents, or open nights, or making sure that your robots can be used by teachers to teach. That last point can take a while to achieve, but once we can make coding 101 easy for everyday teachers, we’ll be able to get stuck into more interesting and exciting projects in our code clubs/maker groups.