Support Package for Matlab/Arduino Interface

So today I discovered the MATLAB support package for Arduino. It’s just some serial communication with a small server program for the arduino – nothing you can’t do easily with Serial.IO.Ports (or in Linux, simply write to the approprate terminal device – more detail here).

The interface is pretty simple, here’s part of their sample:

I’m a fan of ambient effects – enhancing user experience by moving beyond the usual display. I have an amBX kit which I’ve used for atmospheric lighting and mail alerts. I have been meaning to expand the ambient lighting of my system but I’ll be moving to a DIY arduino based system since I’d rather not invest in kit with a dubious future (the reason I got ambx in the first place was because it was cheap ‘cos no one was interested!). So my first thought was being able to have quick and dirty ambient notification of Matlab script status.

However, I think any half-serious programmer would choose to communicate between Matlab/Arduino with system calls or MEX code. The package is from the Classroom Resources Team, so I imagine it’s aimed at young students who may find it useful for quick, easy real-time interaction with their arduino.

I did a quick search for any projects using Matlab/Arduino, but didn’t find anything particularly special. Perhaps it’s a nice lightweight way for data acquisition as well. I just love how big Matlab is – the various teams that contribute it and the size and scope of the community.

Computing in Schools

The Royal Society published a much anticipated article last week on computing in schools. Shut down or restart? is a much needed analysis of the state of affairs for UK students. Personally, I’ve always felt let down by the computing education I received so I’m very glad to see this.

I appreciated Paul Nurse’s foreward to the report, mentioning that “certain way of thinking” computer scientists have that I see many young undergraduates struggle with significantly.

A prominent point from the report is “computer science as a rigorous academic discipline”. It seems to me that students are often only exposed to “computing” in a cursory approximation of digital literacy. So much time is wasted in boring lessons rehashing skills that are innate to modern students. Why?! If computer science was taken seriously in schools we could spark so many more potential programmers; increase the quality of futher education applicants and increase the product of computing education as a whole. Imagine if every first-year university students understood how their CPU worked, the difference between operating systems and flow control. They can do trigonometry, describe the phospholipid bilayer and explain fission – so why should computer science be any less important in this day and age.

The main negative points seem to be that curricula are open to broad interpretation, teacher ability is limited and undeveloped, and school infrastructure inhibits teaching. The scope of computing is also not well understood; particularly the academic discipline of computer science. Students should have a much broader selection of computing degrees available to them.

I’m particularly glad that the value of A-level computing is pointed out. Few higher education institutes require it. I took it because I wanted to study computer science and though it would be extremely valuable, but I regret it and wish I had chosen a different subject and done something worthwhile with my time.

Anyway, the report is substantial and I can’t claim to have read it all yet, but here are a few nice quotes:

The term ‘ICT’ should no longer be used as it has attracted too many negative connotations.

Computer Science is a rigorous academic discipline and needs to be recognised as such in schools

..the long-term aim should be to move to a situation where there are sufficient specialist teachers to enable all young people to study Information Technology and Computer Science..

Information Technology and Computer Science are distinct subjects, with different purposes, although they have areas of synergy. Computer Science is an academic discipline, in the same way that mathematics and physics are.

Computer Science is sufficiently important and foundational that it should be recognised as a high status subject in schools, like mathematics, physics or history.

..it is important that teachers have access to good quality CPD, particularly given the lack of specialists. This will be essential to support a new curriculum in schools.

I’m really excited about where this report could take us over the next few years. I’m also really excited because I just sent my little brother a Big Trak as an introduction to programming, hopefully soon he can have something Turing complete.

Related to this report, BCS Mid-Wales and Technocamps (both of which I am associated with) are holding a panel event titled “From Digital Literacy to Computing in Schools” on the 24th at Aberystwyth University, details and sign up here: http://technocampsbcsjan24.eventbrite.co.uk/?ebtv=C

Speaking of Technocamps, I helped out at a workshop in Aberystwyth towards the end of December, looking forward to a few more in 2012!

JY-MCU Arduino Uno and TM1638 display

I got some new goodies from JY-MCU Co in China today. Open-source hardware is great – the JY-MCU Uno is almost half the price of the original, which will work nicely with another side-project that involves circuitsathome’s USB host shield. Looks pretty much the same to me, soldering seems quality and it ran demo code fine.

They also have Mega1280 and Mini variants – so they’ll probably be my primary Arduino source. Though I don’t think all of their kit is lower priced, the ethernet shield for instance, seems about the same as any other.

I hope Raspberry Pi go a similar way with regards to open hardware designs. From my understanding, it’s been a thought for the Raspberry Pi Foundation, though there are various issues primarily concerning the GPU. But being able to go through different manufacturers for the same bit of kit seems a great way to encourage propagation and improvement. Either way, I’m sure we’ll be seeing that sort of thing soon. Incidentally, look how close we are to getting a Raspberry Pi, can’t wait!

Another toy I got was JY-MCU’s seven-segment/LED display module. A eelatively large board with 8 push-buttons, 8 LEDs and 8 seven-segment displays. This thing surprised me with a model number printed on it: JY-LKM1638. A nifty library is available here. Will make a nice general purpose numeric/status display.

I’ve gathered up a fair collection of components over the past few months. On my shopping list still is a GPS module, accelerometer and some enviromental sensors (gas, temperature, etc). I don’t have any real goals in mind, I’d just like to be able to build up/down some automated roamers with different purposes (monitoring/investigation, racing, tracking). Unfortunately, almost all of my kit including my robot chassis is back home, so there’s little I can do with it here in Aberystwyth. Though this is probably a good thing since I have lots of real work to do.

Having Fun With Capacitative Sensing For Arduino

Today I played with the CapSense library. Using just a resistor and some conductive material, you have a means to sense electrical capacitance. The coolest thing about it is that depending on the resistor used, you can use it as a proximity sensor – without contact. I used a a 1M resistor and had it working from about 2cm.

I did attempt to chain a dozen 1M resistors together, but it seems the capacitance of the broadboard causes wild fluctuations in results despite grounding. This even happened with a single resistor on a breadboard, so in the end I shoved the resistor straight into the Arduino. Much better.

And so I present another demo video, a further proof of concept for an arduino based theremin-like device:

One benefit with this technique is that you can create aerials, so it resembles a real theremin. I’ve only got one aerial to adjust tone, but a second could be easily added. I’m thinking a 20M resistor for tone control and 10M for volume.

I’m still using a piezo for output, but since there are considerably fewer delays in sensing input compared to the sonar module, the sound generated is much more continuous. In fact, until I add some normalisation/smoothing I had to extend the tone duration to get a more controlled sound (rather than to compensate for ping time). When I’ve got some bigger resistors I can work on normalising the values.

Like most arduino libraries, CapSense is easy to work with and has been demonstrated by people all over the web, so you should have no troubles getting started. Here’s a picture of the nasty hack that makes my sensor:

And the code:

It really is that simple! It’s worth exploring the CapSense code as well, it’s easy to understand and might be worth taking the time to reimplement/trimming it.

Since the hardware is so simple, all I’ll need now is a resistor and some tin foil to add a new button to projects as a quick fix.
Being able to interact this way is great, and I’m sure CapSense will be used for a great variety of UIs. I’m hoping to see a Star Trek style interface soon.

An almost identical circuit has been used to implement EMF detectors (also, a MAKE article here), which made me think of general magnetic field detectors and a blog on “sixth sense” magnet rings I read the other day (similar here). Could we implement user input using a Hall effect sensor (example here)? Combined with an electromagnet, we might even be able to produce feedback? erhaps with multiple sensors you could have some sort of gesture control, (eg swipe up/down for volume). Maybe create put an electromagnet in your mouse that fires when you get an email? I wouldn’t a serious resolution/range of IO values. but it would be a fun toy. As soon as I have some neodymium magnets, I know what I’ll be doing.