Skip navigation

STEM Academy

3 Posts authored by: shabaz Top Member

Introduction

Up until yesterday, I’d not seen a programming language which would go from a graphic oriented (pseudo Scratch-like) environment to a conventional source code view, from browser based execution to microcontroller execution, to mobile phone app execution. It was possible however to achieve all of this within a matter of hours!

 

same-result.png

TouchDevelop is a programming language created by Microsoft – it can instantly run in a web browser if Internet connectivity is available, otherwise it can be locally installed too to run as a local web server. I tested a quick local install on Linux but of course it can be installed on Windows too.

 

TouchDevelop will be used with the micro:bit that Element14 and the BBC have developed together with Microsoft, ARM, Freescale and others as well as product champions including the IET and Cisco.

 

What can it do? How does it work?

Some key characteristics are:

• Browser based development environment (private server, or public cloud)

• Cloud storage of your programs

• Development environment optimised for touch interface for rapid copy/paste/delete and so on

• Forward/backward conversion between graphical block coding and text coding at any time

• Run anywhere - in a browser (i.e. any platform) or on hardware (microcontroller or mobile app for Android/IOS/Windows Phone)

• Will be supported for the micro:bit

• Open source – run local copies on any platform and OS (Linux, Windows, etc), and fork it and improve it!

 

This is how to use it to write code:

how-to-code.png

 

The nice thing is that programs can be developed anywhere and retained in a cloud provided you have a suitable account (based on delegated authentication so it doesn’t have to be a Microsoft account).

Although the install instructions were for Windows, it was relatively straightforward to install on Ubuntu and get coding.

Here is my attempt at turtle graphics:

touchdevelop.png

 

There is also Arduino capability (see example code screenshot below) that can convert your program into C++ that can be used by the usual Arduino software tools – I didn’t get that compiling on Linux but I see no reason why this wouldn’t work with a little effort. The instructions for Windows are all published. With some more effort, other microcontroller platforms could in theory be supported since the output is standards based C++.

arduino.png

 

The screenshot above shows the blocks-based code view – clicking on the ‘plus’ symbol inserts a line. The syntax in blocks below changes dynamically as you create each row of the program.

Another option is to target your mobile device; if you have Android Studio and Apache Cordova installed then this is a quick affair (and I’ve never written a mobile app before) - here is the turtle program running on a Nexus device simulation:

android.png

 

As a personal opinion I think it is a far easier-to-use language than Scratch or Python, and the libraries and development environment are geared for modern scenarios where people want to be able to write code rapidly anywhere on any machine, even touch-based machines (e.g. iPads), and still have the flexibility to convert to the (relatively) low-level C++ so that native code can be built too, to run on as many different platforms as possible including resource-constrained ones such as Arduino.

 

Summary

The above was a very quick examination of TouchDevelop’s main features and what it could do. No real steps recorded since I was just exploring, but I think it is highly interesting and worthy of further investigation.

 

I think it is extremely powerful to have a single, simple language to learn for young and older people, and yet be able to target so many scenarios. The ability to write and access the code easily from any device is a significant advantage too.

 

A Getting Started guide will follow and will be indicated here so click on the Bookmark button if you’re interested to read it.

shabaz

Micro Bit

Posted by shabaz Top Member Mar 12, 2015

Interesting little microcontroller board, to be developed as part of a BBC plan to distribute them for free to 1M 11-year old children according to this news announcement.

_81579433_microbit.jpg (Image source: bbc.co.uk)

Apparently this is not the actual incarnation that will be distributed - it will also feature Bluetooth.

The shape looks interesting - like a robot with eyes : ) or a little professor.

 

I think it is a good concept - it is a nice blend of toy-like appearance combined with educational material. Some kids will use it for

cute animations on the LED matrix, and learn in the process! Others will probably fit (say) wires to what looks like screw terminal holes to connect

up multiple ones perhaps - no soldering needed : ) Like an electronic origami perhaps.

paper-chain-doll.jpg (image source: naturallyeducational.com)

 

<Edit: added some more pics from BBC news site>:

microbit-zoomed-out.jpg

 

microbit-in-hand.jpg

 

microbit-led.jpg

 

microbit-rear.jpg

Introduction

It is one thing to check the temperature of something with a thermometer. However logging data and observing the change over time is a great way to see trends and gain more insight.

This blog post covers just a simple experiment but the aim is to have a more general solution for good quality temperature measurement, monitoring and logging at low cost.

 

What is needed?

A temperature sensor and logger is needed. Thanks to support from Element14 and element14Dave check out the blog post for a Raspberry Pi based temperature measurement solution. Of course, any temperature logging system could be used (e.g. off-the-shelf system, or an Arduino based solution mentioned in the comments section below).

 

Is it interesting?

In general, I believe so – perhaps if students are curious then they can measure anything within limits of hundreds of degrees C technically. Practically that would depend on their age and supervision.

 

As a suggestion for further discussion, maybe it could be turned into a game:  A challenge could be, "how long can one keep a drink hot", using nothing other than insulation or materials around the home/school and an hour of time? (by the way It turns out that the answer is: quite a long time. There is some more information on that later).

 

The challenge would involve researching parameters like thermal conductivity, area, and material thickness.

 

Variations of the challenge could involve guessing the temperature of an object at different times on a spreadsheet, and seeing who gets closest to the actual temperature curve – i.e. like a temperature based variation of battleships :  ) This could be automated of course.

therm-battleships.png

As a first step, I tried an easier experiment to check out the performance of disposable cups – I wanted to know, is it really worth doubling-up on cups to keep a drink warm?

 

How to do it

First, get some water heated up (or use hot water from a tap).

 

Set up the temperature logging device and get it recording data. At this point the data is just recording room temperature.

 

Measure out an amount of the water into a cup placed in a tray or bowl (in case it leaks or is knocked over), and insert the temperature sensor.

 

I tried a paper cup (make sure it is intended for hot drinks) from the supermarket (Tesco in my case) with no lid, and measured for an hour. It didn’t keep the drink hot for very long. I used 200ml of water from a kettle. Room temperature was about 21 degrees C. I then repeated with a lid, and then a third experiment was with a doubled-up cup but still with one lid.

 

The conclusion (which I knew from experience since we have very similar cups at work!) is to drink quickly or always use a lid :-)

 

This is a very basic experiment of course, but it did help test out the Raspberry Pi temperature logger. The graph below shows the measured temperatures for an hour.

coffee-cup-results.png

 

For the “how long can you keep a drink hot” challenge, here is my entry; I decided to use expanded polystyrene (Styrofoam) about 15mm thick sheets. I chopped it up using a piece of resistance wire connected up to a power supply. I used Nichrome wire of about 40 ohms/metre, and used 50cm of it connected to a 15V supply (outdoors in case the fumes were toxic) – this gently cuts, or turn up the voltage for a more aggressive cut : )

 

The pieces were glued using epoxy resin adhesive (Araldite) – other glues may damage the polystyrene. It was very tricky to get it absolutely watertight but eventually it was (a ready-made polystyrene cup would be an easier option, but my local supermarket didn’t have any : (

 

I also made a tight-fitting lid using expanded polystyrene. I again used 200ml of water, and started at around 51 degrees C, ambient temperature was 21 degrees C. Over the space of an hour, the temperature dropped by just under 8 degrees C. So that’s my record – looking forward to hearing if others can beat it (it shouldn't be hard : ).

therm-challenge.jpg

 

To do the measurements, I used a temperature sensor known as a thermocouple, type ‘K’. It was an ‘exposed junction’ type, which isn’t really intended for liquids but is low cost – dry it thoroughly afterwards to prevent corrosion. Some thermocouple models have an exposed junction (such as the one in the photo below), others are enclosed in a probe where the end is either grounded to the probe or insulated, which affects response time.

 

Some of the enclosed models can handle over 1000 degrees C; others have insulation which functions up to about 250 degrees C, so it is worth checking before using it.

thermocouple-tip.jpg

 

If you’re interested in building a thermocouple sensor solution for the RPI, check out the blog post here.