The Calliope mini is a tinkering tool built to help with STEM education in german schools (in the beginning – in the meantime there are user-groups all over the world) – some call it the german microbit, which is not totally wrong. Find a nice comparison of the two boards here. Or listen to this podcast episode where i gave a bit more background on the project.
The reason why i am writing this post is a brand-new version of the Calliope mini that just came out a few days ago. It only has one big feature upgrade, but i think it is a very significant one – especially when it comes to using the board as a day-to-day tool in a real classroom situation.
The version 2.0 comes with a built in flash-memory chip that can hold up to 20 programs for the board. These programs can be flashed onto the board without a computer, just by using the onboard controls.
A quick explanation by a german teacher can be found here:
So why is this important for a class-room situation? In my experience one big hurdle for using a microcontroller for teachers is the fact, that you need lots of computers, too. And a working internet connection. Getting all this up and running for 30 students can consume 50% of the available time, easily. But maybe you just wanted to use the board to measure humidity of the soil of a plant. Or you want to measure conductivity of some material. Or use it as a math-trainer. Or explain the concept of randomness to your students by using a built in oracle program. In all these cases it’s not so much about programming, it’s rather using the board as an educational tool. And maybe raising kids interests in coding on the fly, too.
For all these situations the Calliope 2.0 is the right tool – and way better than any other classroom-STEM-tools on the market. Because you can either use one of the pre-installed programs (overview here) and perform a nice lesson around that (no computers needed). Or you have your own little selection of programs that you want to use here and there – and upload them to the used minis in you classroom beforehand.
In my opinion (and from my classroom-experience so far) this can really be a game-changer for the everyday use of a tool like that in a real classroom situation.
Calliope mini is – comparable to the famous BBC micro:bit – a micro-controller (32bit Arm Cortex M0 Nordic NRF51822) that comes with a couple of built in sensors and extensions (Bosch BMX055 mag/acc/gyro, temp and light*, microphone, touch-sensitive, analog and digital pins, speaker, 5×5 LED matrice, RGB LED and a t-bridge to drive a motor + 2 grove connectors and Bluetooth or Nordics proprietary mesh-rf protocol). This can be called a pretty well equipped platform – the reason for this is obviously to build something where teachers and kids can start playing around and coding without having to deal with extensions, cables etc.
This has a reason to exist as an educational tool – but recently it striked me that the board could become a relevant hacking tool for makers as well.
Just within the last couple of days i stumbled upon three occasions where i needed a quick something and the Calliope turned out to be the fastest solution. First i was playing around with amazons alexa implementation for the Raspberry-Pi, an amazing playground to start building voice-controlled applications. As i am trying to combine it with a micro-controller that drives some LEDs on a puppets face, i had to find a way to tell the micro-controller when alexa was speaking on the Raspberry. And just by accident** i figured out that sound output is linked not only to the audio-connector, but also to PIN18 of the PI (the only PWM pin). So my question was/is (will try tomorrow): Is this audio PWM-Output significant enough to measure “is speaking” on the microcontroller? Usually i would have grabbed an Arduino from somewhere on my desk, find a cable, plug it into an Analog-Pin, open IDE, configure a small program to set the pin, read it, configure serial, write to serial, open serial console. On the Calliope mini it is so much easier, the analog PIN is easy to access with a crocodile clip or banana cable and with the browser-based blockly-IDE reading the analog PIN and outputting the value on the built in “screen” is just three little drag&drop operations. In a future version the board will even carry 25 “default routines” on a flash-chip, and measuring analog will be one of these routines (because in school you can check whether a plant needs water for instance). From this point on the Calliope would have the potential to become a kind of swiss knife for makers (these default routines will be accessible without connecting the board to a computer at all).
The other occasion from today was a completely different scenario: we were discussing possibilities to measure presence of a car in a parking lot. This is actually possible without having to hazzle with infrared-sensing or ultrasonic – you can just measure the magnetic field (of the earth) and detect when the presence of a car changes it significantly. The maker-heart starts to beat and i immediately wanted to go out and check whether this can really be done. Again with an Arduino (or Raspberry in this case) i would grab the board, find an appropriate sensor (magnetometer or any 9DOF or so), check pinout and connect it to the board, find the according library, install it, check demo code. Read a little bit about raw-values from the sensor and how to translate them into meaningful values. Configure serial, write to serial, check console. Attach a battery, because i want to put it outside underneath my car. But wait – i wouldn’t be able to see the console then. Attach an I2C or SPI TFT Monitor or LCD-Display, install library, check demo code etc.
With Calliope mini i have the sensor installed already. There are easy to acces standard function-blocks that give me access to the values from the magnetometer. It’s easy to display them on the built in 5×5 matrice. But even better: with only a few more clicks i can enable the radio-module and transfer the measurements to a second Calliope mini that displays them (check out this amazing remote controlled car in our image video). I could even try the light-sensor instead. Or sound. I could even shout at a parkin car “DONT YOU DARE…”.
The third one is measuring whether an elevator is working properly or not. Again the Calliope has built in functions for detection of movement or shake-events. It’s very easy to create a counter that counts every time the elevator is moving (it’s actually one of the things we do with 8yr old kids after 1-2hours of getting in touch with the platform – as a step-counter…).
Of course my view is totally biased and yes there are limitations of this approach as well (one of the biggest hurdles at the moment is adding other sensors). But somehow i believe that there will be more cases where i use it as my personal swiss-maker-knife in the feature…
However, if you feel like needing one, our crowdfunding is still active (but only for three more days). In a couple of weeks the board will also be available via normal distributors – and of course it will be released under an open hardware licence, soon.
—– UPDATE —-
Measuring Pin18 was not succesful, but measuring the audio-signal directly on the audio-output connector works!
** actually i was trying to drive my WS2812 LEDs from the PI as well (yes, this is possible!). As you need a PWM-Pin to do so i noticed the interference because i got strange sounds when i activated the RGB-signals on PIN18…
Today i did my first model with OpenScad. It follows a completely different approach than most other 3D modeling enginges – instead of creating objects with the mouse and and a tools palette like it’s done in Sketchup or Blender, OpenScad let’s you actually program new objects with code.
This is a little tougher in the beginning, but it pays off extremely fast. I did most of my 3D objects in the past with Google Sketchup, a nice and handy tool. But like always – nice and handy comes at a price. If you are moving into more complex objects or have to create very specific shapes it can get a pain in the ass. Because stuff is suddenly flipping or behaves nice on the screen, but creates a mess in the printer. I can see myself shouting at the screen several times over the last few years using the follow-me tool…
Gave Blender and some of the Adobe tools a try as well, but nothing better. Blender is really a crazy tool, tons of functions presented in the most unusual style. You can be absolutely sure, that you forgot almost everything only one week later. And – like many of these tools – it is very much focussed on 3d modeling for the screen and not the printer. Which makes a lot of difference.
If you want to get a nice and smooth entry into 3D modeling use Sketchup. But always keep in mind that there is OpenScad – whenever the clicky guy falls on your nerves give the nerd tool a try.
And if you need one more argument to try it as a Maker – if you ever experienced having to change some details at a print later, e.g. remove some mounting holes and add a snap-in mechanism, you will definitely love OpenScad, because these kind of modifications are usually a pain in modeling programs like Sketchup, as it is hard to really remove anything or modify created stuff in a controled way. OpenScad objects are always created out of a couple of lines of code – which can easily be modified and run again whenever you want.
Sometimes batteries suck. They are expensive, can be dangerous and tricky to handle. And it takes often too long, to load them again.
Think of an experimental board with an Atmel 328 microprocessor (the one that powers Arduino UNO) that should run for an hour or so to do some experiments, like in a classroom for instance. Imagine the teacher having to handle 30 different Lipo-Batteries that have to be charged in advance of the lesson. You get my point.
So there are these fabulous Super-Caps, that are available for not so long. Instead of dealing with micro and nano-Farads, these suddenly are carrying “FARADS”, no nano or micro! You can get an 15 FARAD surface mountable thing at digikey easily.
Of course, compared to real batteries this still is not a lot, but you can actually run something for quite some time from this capacitance. So i just gave it a try. Below you see my custom 328 circuit which runs two LEDs and has no power-saving modes activated whatsoever. Which means, it consumes about 6mA when LEDs are off, and roughly 12mA when they are turned on. I attached a 2.7v 5F SuperCap, which was able to run this guy for 7:30minutes. This translates roughly into 1mAh power, so this device could run a circuit which consumes 1mA for one hour. But of course energy consumption of the 328 could be drastically lower if energy saving modes would be activated when LEDs are off. If you take the 4micro-amp measured here you could run that device for 10 days with that SuperCap.
But for one hour of teaching a 15F Cap combined with a slightly less hungry circuit could be sufficient. And if not – it take just 30seconds to charge the cap from a 3v source again.
Another field where this could be of significant relevance is wearables of course.
As we are currently investigating the ARM-Platform i was at first deligthed to see an Arduino Board with the ARM Cortex M0+ as a processor instead of the well known 8-bit ATMEL guy. Ordered it at my distributor and it arrived this morning.
The experience with this board is really a mess. Tried to install support via the board-manager on my 1.6 IDE – and got the support, but it didn’t work (couldn’t find any board while flashing). Upgraded to the new Version 7, which in fact is a fork that only comes with support for the new Board but nothing else (in fact the new invented board-manager from Version 1.6 is missing again…). Now i had three ways to program the Board, “Arduino M0 Pro (Programming Port”, “Arduino M0 Pro (Native Port)” and finally “Arduino M0”. Awesome. Indeed the board comes with two Micro-USB connectors as well – one named “Programming”, the other “Native USB”. Once cable gets plugged into one of them also the Serial-Port changes, so be aware to change that as well (does not work automatically). It turned out the only the Option “Arduino M0” combined with the native Port worked and i could finally upload a Blink-Sketch to the board.
But the weirdness did not stop. Our code uses Hardware-Serial and for some reasons the M0+ Pro has only Support for SerialUSB and Serial5. But even as we changed the code accordingly we got compiling errors all over the place.
Guys, please settle this fight as soon as possible. At this level of quality and user experience i see the whole Arduino project at risk in the near future.
As mentioned in the previous article i wanted to figure out how to connect the Arduino over Bluetooth to my Mac, including flashing the device.
I managed to get the serial console over the air with the HM-13 module as described before, but unfortunately flashing seemed to be a bit of an issue.
This is because the Arduino needs a clean reset signal which usually comes out of the DTR-Line of the module. But: most BT-Modules (and FTDI-Cables etc.) do not make this port available.
But i found three solutions that work nevertheless.
1. easiest and most straightforward, but also most expensive: buy the EZ-Link module from Adafruit. It has the DTR pin (don’t forget to use a 100nF ceramic capacitor “104” to connect to the reset pin) and everything works well just out of the box. This module also has an automatic baud-rate detection and some other useful features like voltage regulation both for power and the TX/RX Pins. The other modules below require 3.3 voltage for power and also for the logic, so be careful if you plan to work with a 5v controller like the UNO.
2. the RN-42 BT Module comes with a DTR-Pin as well, but unfortunately it has a reverse signal on that pin – when it should be high it is actually low and vice-versa. If you want to use it nevertheless you have ot apply an invert circuit or buy an inverter module. You can find a nice explanation on this and the module in general in this video. Although i believe from the video that this setup can work, it did not for me – the DTR-PIN just did not generate any signal…
3. You can also use the above mentioned HM-13 module from Seeed – although it does not have the DTR PIn available. I used a nice little hack described here to make it work. Just reuse the status-led pin to trigger the reset signal! To do this you have to use a short AT-Command on the module “AT+PIO11” which will tell the module to shut off the LED when unconnected and turn it on while connected. This again has to be inverted to be useful as a reset-signal, but if you do so it really works (other modules like the HC-05 for instance even make this available via another AT-command, so no inversion is needed here). The good thing with this solution: the HM-13 is a dual-mode BT-Module which can work as classic BT to simulate a serial connection _and_ as BLE Module at the same time!
Yes, really. Scratch is this wonderful MIT visual programming toolbox that you can get for free in many different languages. Its an excellent starting point to teach children how to program. But you can go even further: Some weird spanic guys wrote an Arduino sketch that let’s the Arduino interface with a modified version of Scratch called S4A (“scratch for arduino”). Brilliant. Yes, you can build robots and control them with the visual programming language. But: the Arduino has to stay connected to the computer permanently because the interaction works over a Serial connection. Hm… As i am working on some kind of school teaching electronic project at the moment (some info in german) i wanted to bring that further by introducing Bluetooth (the docs are mentioning an xbee RF connection but i can’t believe this would be a feasible way for a normal teacher + it requires an adpator on the pc side as well). So i wanted to control the serial connection to the Arduino over the air, ideally from o broad set of possible devices like Laptop, Tablet, iPhone etc. – wait: iPhone?
The iPhone introduces another special hurdle to the project as Apple decided not to support standard ‘classic’ Bluetooth connections, but only BLE (“bluetooth low energy”). I am pretty sure there is no technical background for this as Android phones have no trouble to support all kinds of BT connectivity, but anyway, i had to deal with that as well.
Fortunately there are numerous BT-boards and adaptors out there so it shouldn’t be hard to find one matching my requirements. I quickly digged into the modules from itead/seeed that are easily available, cheap and normally well documented etc.
I first tried the HM-06 module, connected it to my Arduino Uno just like described in this nice tutorial on instructables, launched S4A and voilá – Scratch was reporting values from the distant Arduino!
But it didn’t work for my iPhone or iPad – so i tried the HM-11 which works with a TI CC2541 chip. Although the documentation mentioned a passthrough-mode for UART and the module came with TX/RX connections, it was not possible to pair it to a computer or mac and get the serial link over the air. Obviously a misunderstanding as the TI-Chip clearly only supports BLE 4.0 and no “classic” Bluetooth.
So i ordered another module, this time the HM-13 which can be ordered on a nice Grove-Breakout board including voltage regulator etc. (which is very important – the modules are quite sensitive regarding over-voltage and require straight 3.3 volts on VCC).
After some struggles i managed to get this working as desired – had to fix the baud-rate as the module is communicating with 115200 baud by default and Scratch tries to do 38400 initially. So please check the baud-rate at which your BT-module is communicating and try to set the Serial-speed in the S4A-scetch accordingly.
As the HM-13 is a dual-mode BT chip it can be run in both modes – as classic BT device that has to be paired to the other device and then simulates a serial connection, or as BLE 4.0 device, that can be seen on an iPhone with a specific app (i used the ones from TI that ship with their SensorTag.
Of course this setup cannot only be used for Scratch but any Serial connection can be routed over the air – it should even be possible to flash new firmware onto the Arduino that way (will be tested once i get my 100nF capacitor to connect the reset line). And BTW – if you only need serial over the air i’d recommend the HM-06 module mentioned above – it does this job very nicely as a single purpose device.
One of the coolest projects i stumpled upon recently is the mysensors project by Henrik Ekblad and his team. The aim of the project is to offer a framework for a network of sensors and actuators in an environment like your house or appartment. The sensors are connected with 2.4Ghz RF technology, and the system comes with a sophisticated network management including a controller, a gateway and even a repeater functionality that can be enabled on any node with just a flag.
The idea as such is already brilliant because everyone wants to have sensors and it’s just frustrating to a) build everything on your own or b) use crappy and proprietary technology from specific vendors.
Mysensors is open-source, but even more important: IT JUST WORKS!
I have come across many projects, platforms and technologies but this is really not the usual experience, especially for an early stage open source project. The project is extremely well an even nicely documented, you pick up your Arduino Uno, Upload the gateway code with not a single modification and it just worked. I then plugged it into my Raspberry where my FHEM home-controller was running, installed the mysensors module there and…baam…had my sensors integrated into that place as well.
But it doesn’t end here: The mysensors package comes with tons of just working examples for different kinds of sensors and even actuators. I tried light, moisture, binary switch (for my doorbell), relay actuator and many others. And believe me – every single example just worked without any problem (ok i had some issues with the rf-connection, but the excellent forum helped me out of that quickly).
This is just a brilliant job Henrik, if every open-source project out there would work like that we would be in heaven.
The list of supported controllers is growing and there even is MQTT support built in for some.
Want something more? They should think about customized, low-power optimized hardware? Even that is available, i ordered the brand-new Itead Sensebender Micro which is a tiny (really tiny) Atmel 328 with a few Pins, absolutely low-power focussed and can hook up the recommended NRf24l01+ RF-Board easily. Can run with two AAA-batteries for months (if not years). Although this is really a rough and specialized board for experienced users (no power-regulators or reverse polarity protection etc.) it’s exactly what you would want to have for setting up your own low-power sensor network.
Recently the guys from IFTT integrated a new way to trigger events – now you can call the platform with so called “Maker Events”, which are basically customizable http/api requests. Find more details here: iftt.com/maker
The request looks like this: https://maker.ifttt.com/trigger/plant_thirsty/with/key/[your key]
“plant_thirsty” is the name of the trigger that i created. If this request is fired it can trigger anything IFTT can do, you even can install the IFTT app on your iOS/Android device and get event notifications.
This is a feature that has been requested by the community since ages, but it is really awesome that it is now available!
Currently i am investigating ways to wakeup an Arduino out of deep sleep mode with an IRQ Event. If you think of low power standalone measurement applications, this can be very interesting, because the board can sleep with very low power-consumption (less than 10 milli-amps) until something happens.
It works that way (see code example below): After starting the Arduino you call the function sleepNow() which does two things. Define an interrupt for waking up and attach him and then put the device to sleep. For waking up different patterns can be defined, “LOW”, “RISING” and “FALLING”. If the according event is being observed on the wakeup pin the device will wakeup, proceed with the wakeup function (in this case wakeUpNow()) and then execute the loop again.
In my example i am using a tiny solar cell that can output up to 4volts under full sunlight to trigger the RISING-Event on PIN2. The interesting detail about that is that this sensor can power itself obviously, therefore the Arduino could even shut down it’s PINs during sleep and would still wakeup. This setup could be used to turn on a sensor if a box is opened for instance (think of a intrusion detection in your house or a smart geo-cache for instance). In combination with our ArduFona Board this could then trigger a GSM action or call a WEB-API etc.
In my future research i will try to identify more sensors that can be put to work like this – which is not as trivial as you might think because most sensors are working with a more complex output like I2C or do not provide the right output by other means in the first place. But i think many cases can indeed work like this, ultrasonic-sensors for distance, acceleration sensors with analog outputs etc. – i’ll keep this blog posted.
See it in full operation here:
Here is the code for the above example:
#define buzzer 9
#define led 13
int wakePin = 2; // pin used for waking up
void wakeUpNow() // here the interrupt is handled after wakeup
attachInterrupt(0, wakeUpNow, LOW); // use interrupt 0 (pin 2) and run function
sleepNow(); // sleep function called here
void sleepNow() // here we put the arduino to sleep
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // sleep mode is set here
sleep_enable(); // enables the sleep bit in the mcucr register
attachInterrupt(0,wakeUpNow, RISING); // use interrupt 0 (pin 2) and run function
sleep_mode(); // here the device is actually put to sleep!!
sleep_disable(); // first thing after waking from sleep:
detachInterrupt(0); // disables interrupt 0 on pin 2 so the