Tuesday, January 22, 2019

Thermal Pollution Monitoring with Bitty Blue

Thermal pollution is an environmental issue that we don't hear a lot about. It involves the artificially induced, rapid changing of the ambient temperature of the sea, lakes or rivers and it's a serious problem which can have a devastating affect on fish and other organisms as they succumb to thermal shock.

The most common source of thermal pollution is industry. Power plants and factories which dump heated waste water directly into the sea can cause a rapid increase in water temperature and the death of aquatic life.

I didn't know anything about thermal pollution until a few months ago. In fact, I'd never heard of it and I'd like to share with you how it is that I came to learn about the subject, all thanks to two  schoolgirls, Nouf and Mawwadah who live in Saudi Arabia.

Nouf and Mawwadah contacted me by Twitter, asking for some guidance on how to approach a school project involving micro:bit. Their teacher had asked them to think about thermal pollution and how technology might help prevent it and to build a working solution.

The project idea goes like this; imagine the waste water pipes from every factory by the sea were fitted with special devices which could monitor their temperature. If the temperature got too hot or too cold, risking thermal shock, the device could inform a computer system wirelessly, raising the alarm that the factory was breaking the law and causing thermal pollution.

Nouf had seen a YouTube video of one of the Bitty Software smartphone applications, Bitty Blue and knew it had the ability to act as a temperature monitor, with a suitably programmed micro:bit measuring the temperature using its built-in sensor and sending information to the Bitty Blue application. Depending on the information received from the micro:bit, Bitty Blue would display an image and some text indicating whether the micro:bit was telling it that the temperature was OK, too cold or too hot.

Nouf and Mawwadah talked with me using Twitter instant messages and I explained how Bluetooth, one of the most commonly used wireless communication technologies was an important ingredient in the solution. They were quite new to programming and so I did my best to act as a tutor. We talked about the basic logic, the programming concept of an "event", how "events" can be used to trigger Bluetooth communication with the Bitty Blue application and what the transmitted messages would need to contain. With a little guidance and a few more Twitter conversations, Nouf and Mawaddah were able to use MakeCode to create a micro:bit project which did exactly what it needed to. It looped, measuring the temperature every second or so and then sent a Bluetooth message containing a number which meant "OK" (0), "Too Cold" (1) or "Too Hot" (2).

We had covered a lot of information in a short time, and Nouf came up with the idea of sitting down with her sister and explaining the code to her as a way of making sure she understood everything. A great idea and of course in professional programming, walking someone else through your code is something which is commonly done.

So what happened next? Late last year, Nouf made contact again and told me that their school project had been a success. Another friend, Heeba had built a (very impressive) model factory, complete with a pipe which could carry hot water and a pool into which water could flow. With a micro:bit fixed to the pipe, they were able to fully test the idea and demonstrate that their concept worked and worked very well. It sounds like the project was a result of excellent team work, with everyone contributing something important.

Best of all, the team shared a video of her project being demonstrated in class. With permission, I added some captions and published it on YouTube.

If I was a teacher at this school I would award an A+ for this project without hesitation! It's brilliant. I have to say I'd also award Nouf and Mawaddah an A+ for showing such initiative and determination in tracking me down and asking questions in the way that she did.  :-)

Here's the video of the team's project.


p.s. BittyWeb, the web-based micro:bit project system from Bitty Software contains an application called Bitty Event Monitor. It's like the Bitty Blue temperature monitor application except that you can use it to monitor *anything* your micro:bit can measure with or without additional components like sensors attached to it. CO2, humidity, atmospheric pressure, vibration... you name it, you can build a fantastic school project with it.

Information about Bitty Blue can be found here:  http://bittysoftware.blogspot.com/p/applications.html?m=1#bb and code microbit here https://github.com/bittysoftware/bitty_blue_device_code/tree/master/microbit/makecode

Sunday, January 13, 2019

Roger Wagner's MakerBit and Robo:Bunny

Roger Wagner's MakerBit is an impressive board for micro:bit projects with tons of very well thought through connectivity options, all of which are plug and play, leaving my soldering iron looking sad and neglected on its shelf!

You can buy MakerBit in several forms. As a standalone product, there are two variants. I used the MakerBit R which has additional features for robotics projects compared to the standard MakerBit. You can also get MakerBit in various kits with a wealth of additional components included for you to use in your maker projects.

You can of course invent your own projects, but MakerBit comes with several activity ideas to get you started. They're really well documented and I opted to follow the one for making a "smart car".

Interestingly, there's no chassis provided for the smart car project. Instead, you're encouraged to improvise and reuse a handy cardboard box, perhaps the one your MakerBit came in! I really like this idea. Anything which encourages kids to consider reuse and recycling is good in my book.

I built a "robot bunny" with interchangeable stick on face and programmed the micro:bit so I could control it from either the D-Pad UI or the touchpad UI of Bitty Controller.

My micro:bit code is available for you to use or adapt for your own Bitty Controller projects, as you see fit. See https://bittysoftware.blogspot.com/p/device-code.html#bc and https://github.com/bittysoftware/bitty_controller_device_code

MakerBit is highly recommended. I expect I'll be using it for other projects in the future, not just bunny related ones!

Here's a video to close this post with. Enjoy!

Tuesday, January 1, 2019

Bitty Controller 2.2.0

A new version of Bitty Controller was released today. A great start to 2019!

The new version offers a 5th user interface variant which is designed to let you drive a machine of some sort *and* control ancillary features of the machine like LEDs and servos. From the options screen you can enable up to 12 buttons and give each a short text label. These buttons will then appear either side of the main touchpad control.

Pressing a button sends a Bluetooth event with ID=9016 and a value equal to the button number in the range 1 - 12 inclusive.

I transformed a GiggleBot into my very own robot dog and used the new UI to take it for a spin. At times... literally. As you'll see, it's very evident from the enthusiastically wagging tail that robodog is a happy dog :-)


Full source code for a MakeCode project is available from the Bitty Software web site as well as a ready made hex file.

Go on! Have a giggle with Bitty Controller and GiggleBot!

Tuesday, December 18, 2018

No more DRAW A CIRCLE

Bitty Data Logger users will probably have played with the micro:bit's magnetometer (AKA digital compass) at some point, as will many other micro:bit users, with or without the involvement of Bluetooth.

The magnetometer needs to be calibrated in the environment in which it is to be used, for accurate data to be acquired from it. Originally, simply including the MakeCode "Bluetooth magnetometer service" block was enough to both make the magnetometer data available over Bluetooth *and* initiate the calibration procedure automatically when the micro:bit code started. If you've seen this happen, you'll know that the old procedure starts with the text "DRAW A CIRCLE" scrolling across the micro:bit screen. A single LED then appears and by rotating the microbit with its edge facing upwards, you light each LED on the outer edge of the display. Once a complete "circle" has been drawn, calibration is complete and your micro:bit will continue starting up.

Here's a very simple MakeCode project that could be used with Bitty Data Logger to log magnetometer data:



Things changed in the latest release of the micro:bit firmware (known as the DAL). Now, calibration does not happen automatically. To calibrate your micro:bit's magnetometer you must now explicitly request this in code. There's a block available for just this purpose so you could, for example initiate magnetometer calibration when button A is pressed, like this:


This change may affect Bitty Data Logger users. Magnetometer data will not stream into the micro:bit, even with the right code on the micro:bit until you have calibrated it. Luckily it's possible to initiate calibration from within the Settings screen of Bitty Data Logger:


That's it! Happy data logging!

Saturday, December 15, 2018

GiggleBot and Bitty Controller

GiggleBot is a wheeled "bot" from Dexter Industries which you control with a BBC micro:bit.



There are quite a few bots available for micro:bit enthusiasts now, but this one does have a certain je ne sais qoi. Perhaps it's the integral line following and light level sensors or maybe it's the neopixels mounted on its surface. Or maybe it's the expansion possibilities, with multiple points to connect external sensors and dedicated connectors for up to two servos. Or perhaps its the slot through which you can drop a marker pen so that your GiggleBot can draw as you drive. Either way, GiggleBot is full featured, full of potential for some very exciting educational projects and on the whole, tres, tres cool. Oui. Le GiggleBot, c'est bon (with apologies to French speakers everywhere!).

It's also a tough little bot. I drove mine right off the top of a table and it landing with a sickening "crunch" on a hard, wooden floor. Not a problem. GiggleBot shrugged off the impact and got right back to work.

And giggling GiggleBots, Batman! GiggleBot has the best name too :-)

But enough of my thoughts on GiggleBot, already. What's this?

GiggleBot and Bitty Controller work together!


"Really? Oh wow!" I hear you say! Well, yes kind reader, it is indeed true. With the right code on your micro:bit, you can use the GiggleBot's I2C interface to take full control, driving your GiggleBot from your phone using the Bitty Controller app or web browser using BittyWeb. You can also collect sensor data and display it on Bitty Controller's enhanced touchpad controller UI.

C'est magnifique! And it really is :-)


Here's a video demonstration for your viewing pleasure.



You'll find code and information about using Bitty Controller with a GiggleBot right here.

And more information on GiggleBot itself at https://www.gigglebot.io/


Saturday, December 8, 2018

Bitty Event Monitor V1.0 now available

BittyWeb now has a new application called Bitty Event Monitor.

Monitor anything you like using your micro:bit and report significant events to this BittyWeb application and it will indicate whatever is going on with the colour and text that you choose. Suitable for a huge range of classroom and maker projects, you could monitor temperature bands, atmospheric pressure ranges or motion. If you can measure it on a micro:bit using the right code, you can report different states to Bitty Event Monitor for it to indicate visually on your screen.

Watch this video of Bitty Event Monitor working with a micro:bit running some simple temperature monitoring code:




Code for the temperature monitor is available here:

https://github.com/bittysoftware/bitty_blue_device_code/tree/master/microbit/makecode



Tuesday, December 4, 2018

Bitty Polyhedra V1.0 now available in BittyWeb

BittyWeb has a new application. It's called Bitty Polyhedra and it's designed to help teach and learn about 3D geometric shapes known as polyhedra. Start by loading our hex file onto your micro:bit or follow the Bitty Software tutorial to make your own. Then, in BittyWeb go into the Bitty Polyhedra application, scan for your micro:bit, select and connect to it.

From there you can explore shapes in the shape library, rotating 3D images of the selected shape on screen using your micro:bit as a controller, tilting or rotating to control the shape on screen.

Test your knowledge by taking a quiz!

Lots of fun and educational too.



BittyWeb is no longer available.

micro:bit V2 - key information