The Need for Physical Computing Part 3:

Recap:

In the previous post I delved further into how Physical Computing works and what tools are available to use when merging code with the physical world. Two tools really emerge with this: the micro:bit and the Arduino. In my Smore newsletter, I also highlighted both of these tools. Both of these tools allow for incredible projects and programs with the physical environment. In fact, both of these tools can be used in similar ways to almost similar ends. The difference really is the programming tools to meet those ends though even the micro:bit can be programmed with almost any language by using the mbed compiler.

Power differences:

The Arduino will allow for more power (at 5 volts) to external sensors and devices (such as servos and motors) in comparison to the 3.3 volts of the micro:bit. The pin differences are negligible because the Arduino has 1 more digital pin than the micro:bit. Both have 6 analog pins.

Arduino, Micro:bit, Pi Comparison
Arduino, Micro:bit, Pi Comparison, Courtesy of Simon Monk @simonmonk2

The addition of sensors, motors, and servos can easily be added with the use of a breadboard to either device (such as the breadboard adapter for the micro:bit.) The Arduino can be wired directly to a breadboard as displayed here:

Programming the micro:bit

Programming the micro:bit is easy using block coding, Javascript, or MicroPython. Makecode.com from Microsoft is the initial site to visit to code the micro:bit and microbit.org to code in MicroPython. Personally I like using the Makecode environment only because I like the emulator that it provides to show how to connect devices – even motors and servos.

Screenshot of Makecode environmentmakecode.com servo pins

 

The MicroPython environment is amazing but takes a bit of understanding in order to program. I suggest Programming the BBC micro:bit from Simon Monk if you’re interested in diving into MicroPython programming.

 

 

 

 

What I enjoy about Makecode is that there are many other projects that you can import and then use in your own code. I did this recently with my own students as they programmed the Hyperduino Makerbit as they made a smart car. They imported the code for a Junk Bot and used a block they built for an ultrasonic sensor.

Programming the Arduino

Programming the Arduino can be a bit trickier. The Arduino IDE is the mainstay of programming the Arduino but if you are unfamiliar with text-based coding, it can seem a little daunting. Because of that, there are many different visual environments to code the Arduino:

However this is not even near complete so I suggest looking at other sites and blog posts that lend more insight.

My personal favorite is iForge:

In the above program, my 7-year old son programmed an Arduino for flashing LEDs in order to have a flashing light strand for a gingerbread house project he did for school. iForge works quite similarly to Makecode in that you simply (or rather in a super simplified manner) program the ‘pins’ for device to be on or off. The reality is that the programs can be very detailed and complicated but the heart of either the micro:bit or Arduino is controlling the pins.

It is one thing to write a program and watch it work on screen. It is a whole other thing to write a program and see it work in the real world. The micro:bit and Arduino are the bridges to physical computing. How we get them to work is the programming language. In the end, it depends upon what works best for you. I like working in iForge with Arduino. The recent updates have made it even easier to work with. For the micro:bit, I’m going to side with Makecode first and MicroPython second. Makecode can be as simple or as complicated as the programmer wants. Using other blocks and programs from others makes it even more robust (remember the ultrasonic block.)

What tool? That’s up to you. I like both. For entry level, I totally am for the micro:bit. There is so much to do with it using only the micro:bit and alligator clips. If you add a breadboard or a board such as the Hyperduino Makerbit, you have more opportunities to affect the physical environment. The Arduino by itself is bland. It does need additional boards (also known as shields) or a breadboard to get it to do much. Additions such as the Hyperduino-R makes connecting sensors and devices much easier.