Arduino Star Trek control panel and love-o-meter

I have continued to learn Arduino programming using the Arduino Starter Kit.


The next project in the book uses the Arduino to control three LEDs in what it imaginatively describes as a Star Trek style captain's control panel.  In this project you learn how to write code to test the status of a push switch and then, depending whether it is pushed or not, set the voltage on the LED circuits to high or low. It's another really simple project and is the first introduction to using the Arduino to control components rather than just supply power.

The project comes with a template to help you imagine that you really are Captain Kirk, if you needed help with this.

The next following project is an imaginatively titled love-o-meter.

It uses some code to get read a value from a linear temperature sensor.  Depending on the temperature your program reads the Arduino will set the voltage on up to three LED circuits. The temperature sensor is a rather small component and it actually took me a while to find it! This project also comes with a handy cardboard template - complete with lips - to help bring it to life.  Put your fingers over the temperature sensor and watch the LEDs light up one-by-one.  I understand that the Enterprise was fitted with something like this to help test the compatibility of Federation captains with alien women, only Captain Kirk often chose to ignore it.

The love-o-meter also introduces you to the serial monitor - a console for the output of text so you can see what's happening inside your Arduino.  This is useful as in this project it is unlikely that the ambient temperature is as high as 20 degrees.  I had to adjust my program and found better results when I looked at the serial monitor.



Join me soon as I continue to work my way through the brilliant Arduino starter kit.  Coming soon we will look at using the tri-colour LED and the servo motor!

As it is customary to end an Arduino post with a Douglas Adams quote, here goes:

“It is a mistake to think you can solve any major problems just with potatoes.”

Still here? Well, you might like this post about the FUZE Basic Robot Arm Kit, or some noteworthy note apps for Windows.

Arduino project 1

Yesterday I showed you the Arduino starter kit.  Today I started to try the first project from the book.



After a short primer in the physics of electrical circuits, the book guides you gently into the first project, which is to create a push-button controlled LED light on the breadboad.

The project doesn't actually use the Arduino except to draw power; its just to get you familiar with the breadboard.  Once I had created the first LED in series with a push switch I added a second LED in parallel with the original circuit as shown below, and hey presto, two robot eyes (well, OK, two red LEDs).

It's not the most impressive project in the book, but at least I have got to grips with the components now.
Things I have discovered that it would be useful to have but I don't currently own:
  • a good light source (to see the colours of the resistor bands);
  • magnifying glass (to see any of the components at all - my eyesight is deteriorating);
  • digital multimeter (not essential, but should be in the toolbox of any electrician);
  • component box (there are a lot of small components).
It is time to stop there and attempt a more challenging project another day. Come back soon.

And since it is customary to end an Arduino post with a Douglas Adams quote - here goes:

A learning experience is one of those things that says, 'You know that thing you just did? Don't do that.’


Still here? Dang! Well, you might like to look at this LEGO TARDIS kit, or maybe you want to solve some puzzles.

My first Arduino

I've bought an Arduino UNO so I can learn about microcontrollers and hopefully build some interesting projects.  In this post I shall briefly show what you get with the kit and then end with some advice from Douglas Adams.

I chose the Arduino original starter kit available to buy here:



What is Arduino UNO?

The Arduino is a microcontroller board intended for novices to create their own devices.  The Arduino UNO board processes various inputs that can then trigger actuators. In other words you can build a device where when this thing happens then that thing happens.


What's in the box?

A very generous selection of bits and bobs.  You get the Arduino UNO microcontroller intself plus a breadboard and wooden base (this is easy to assembly, however if you follow the instructions that come with it, you might end up assembling back-to-front as I did. This is easy to fix).

The kit also contains various components including DC motor, LED display, servo motor, potentiometer, temperature sensor, and a very generous length of USB power cable; in addition to various diodes, resistors, filters, LED etc. You also get some cool stickers to promote your love of Arduino and open source.

Bits and pieces.  I suggest that you invest in a component box for these.
What's in the book?

The starter kit comes with a projects book.  This contains the set-up instructions; how to install the software and connect to your Arduino; a primer in electronics and fifteen projects to try.  The projects include a light theremin, digital hourglass, Arduino clock, Zoetrope, secret knock detector and more.

The book is well-written, clearly set-out and easy to follow instructions.

I am looking forward to learning how to build my own projects by trying some of these out first.

The excellent Arduino project book which comes with your kit.

First steps.

The very first project is to make sure your system works by compiling a 'blink' program onto the device. All this does is to make the on board LED blink on and off at a rate you specify. This is to get you used to the software and make sure that all is in working order.

Next steps.

The next steps are to make something interesting.  I am not sure where I am going with this, but I do know that it is for another day.

Anything else?

I also bought the book Arduino Projects for Dummies by B Craft.



This book contains some more 'out there' projects, including automated gardens; RFID detectors; GPS dataloggers and much more.  How about a project where everytime your cat leaves you house it updates its Twitter profile?  Well that is covered in this book.  It is almost worth getting a cat for.  If you need some advice from Douglas Adams, remember: if you try and take a cat apart to see how it works, the first thing you have on your hands is a non-working cat.

The opposite is true of Arduino projects.


Come back for more geeky stuff soon...

Still with us?  Still awake? Then you might like my post on the micro:bit moisture sensor, or a whole load of posts about the Raspberry Pi.

Micro:bit moisture detector

Admit it.

You've let a house plant die through neglect before. Probably not even just the once. Multiple times over. You are a bad house plant parent, but things could change around if you had one of these.

My micro:bit water sensor showing animated "don't water me".


The micro:bit water sensor connects to your micro:bit through the pins provided at the bottom of your device. Black to ground; red to 3V and the blue to whichever pin (0-2) you wish to read.



My first project is a simple soil-moisture detector for a houseplant.  When the moisture level is okay for the plant then the micro:bit displays an animated cross ("do not water"); when the soil is dry then the micro:bit displays animated drops of rain ("water me").

Very simple.

Feel free to get my code.

Here I am continually reading the analog pin (P2) and storing the value in a variable called 'water'. I found that a value less than 10 means 'bone dry'.

The micro:bit in the emulator showing the animated rain drops.
Future expansion of the project will be to connect the micro:bit to a water pump so that the system can automatically water the plant as well.  It might also be useful to store the time taken to dry up, or audible warnings if the soil is completely bone dry: Yes, you can get a headphones adapter for the micro:bit as well.

The water sensor is a fun addition to the micro:bit computer and there are clearly multiple fun projects to attempt. You can get your water sensor here.

BMI calculator in #python

Following a conversation with a student today, here is my version of a simple Python 3 script for calculating your body mass index index.



print("BMI Calculator")

while True:
    mass = float(input("\n\nEnter mass (kg): "))
    height = float(input("Enter height (m): "))
    bmi = mass / (height**2)
    underweight = 18.5 * (height**2)
    normal = 25 * (height**2)
    borderline = 30 * (height**2)
    
    print("Your bmi is : ", "%.1f" % bmi)

    if (bmi <= 18.5):
        print("'Underweight.'")
        print("To be 'normal' weight, your mass would need to be : ", "%.1f" % underweight, "-", "%.1f" % normal, "kg" )
        print("You are advised to gain ", "%.1f" % (mass - underweight), "kg") 
    elif (bmi < 25):
        print("Normal weight.")
    elif (bmi <30):
        print("Borderline high.")
        print("To be 'normal' weight, your mass would need to be : ", "%.1f" % underweight, "-", "%.1f" % normal, "kg" )
        print("You are advised to lose ", "%.1f" % (mass - normal), "kg")
    else:
        print("High")
        print("To be 'normal' weight, your mass would to be : ", "%.1f" % underweight, "-", "%.1f" % normal, "kg" )
        print("You are advised to lose ", "%.1f" % (mass - normal), "kg")
        print("To be 'borderline high', your mass would need to be : ", "%.1f" % borderline, "-", "%.1f" % normal, "kg" )
        print("You are advised to lose ", "%.1f" % (mass - borderline), "kg")
        
    
    
    

Microsoft have updated the Band 2

I just got back from a walk to discover that my Microsoft Band 2 wanted to update.  The new update includes a feature that I had previously voted on for development - walking as an activity.  I wish I had know this before I went for a walk.

Microsoft Health App on my awesome Lumia 950. When you are on the Internet nobody knows that you are a dog.

The 'walk' feature boasts the ability to track your distance, elevation change and to record points of interest on your map.  I am looking forward to trying it out soon.

The latest update also includes a universal Windows 10 version of the Microsoft Health app, so you can get the same functionality of the phone app on your desktop, although the web app is much more useful in terms of the information it provides (such as four week history and comparisons) but it is good to have the live tile spinning round with my info.

Not got a Band 2? I am really pleased with mine and I can highly recommend this product.
Microsoft Band 2 - Medium



You will need a Windows 10 phone to get the full functionality out of your band, however it works on Windows 8.1 phones as well, including several latest versions of Android phones.  It even works on those phones from that struggling fruit company - I can't remember the name of right now, but I know that the last good thing they developed was the Apple II.

History fans will be interested to know that the smart watch was not created by Apple.  I saw the following advert on the back of a copy of The Micro User magazine from about 1984 ish.


The Seiko-RC 1000.  It featured 2K of RAM and was the first watch to interface with a computer. I would certainly buy one of these for my BBC Micro if I could be certain that they still worked or had the correct cable.  You occasionally see them on eBay, however I've never seen one that isn't just sold for the packaging.  Functions included: scheduling, memos, world time and a four-function calculator app.  Cool, though.

Fun fact of the day: Queen Elizabeth I received a wrist watch as a gift from the Earl of Leicester in 1571, but she had to wait over four hundred years for a reliable app store.

Some of the best marble runs

In a tsunami of marbles watch this video of 11000 marbles. Yes, 11000, all at once. Enjoy!



If you can endure the cheesy Christmas muzak then here is a really good one from someone who seems to have no other use for their house than as a playground for marbles.


The little ball that could.


Place your bets!


This one went viral recently, and no surprise, one of the best marble runs you will find on the Interwebs today.



Feeling inspired by some of these videos, then you might need to do some shopping for marble run equipment.

More awesome particle art

You may remember our original posts on particle art, or probably not, so here's another one.

Earth Editor


In this game you create and destroy a virtual planet: shower it with rocks, ice, water or fling meteors at it.  Whatever you fancy really.  When you are bored of this one, there is a whole post of apps that let you create your own solar system to try too.

Plus one geek experience point for the guys at Dan Ball.

Particle Art


Particle Art is an app for Windows 8-10.  You can add 'attractors' of various 'mass' then send in a stream of particles which produces such pretty images as you can see above.

Fractal Viewer


Fractal viewer for Windows 8-10 lets you explore the Mandelbrot, Julia, Burning Ship and Lyapunov Fractals. You can create Custom Julia Set and set as your as LockScreen Wallpaper.  Although not truly 'particle art', it's good stuff and well worth a look.

HTML5 Canvas Particle System


The HTML 5 Canvas Particle System is well worth a look.  It is an opensource project from Richard Teamnco. You control the colour,  number of particles, particle lifespan, dispersion range, direction angle, particle speed and particle size. It uses the HTML 5 canvas so will run in a modern browser.

Plus one geek experience point for Richard Teammco.

If you enjoyed this post on particle art systems, then you might like:

Weird Particle Art Thingums
OR
'Particles':- Our own particle system for Windows.

My virtual pet, Phil

This is Phil.  He is my virtual pet.

As you can see, Phil has done a little poo.

This app is very reminiscent of the classic Tamagotchis of Lore.  Wildagotchi is available in the Android store, or for your Windows Phone.

Game play is very simple.  You need to keep him from going hungry (so feed him when you do); you need to give him rest (so put him to bed when you go to sleep) and you need to play games with him. In one such game you need to guide your virtual pet across a busy road in the hope that he doesn't get squashed under the heavy traffic. This is virtually impossible not to do.  Despite being squashed countless time's your virtual pet will thank you for the fun times and his/her happiness will increase. The games are different depending on which of the twelve creatures available you currently have.

At the start of the game you get to choose a type of creature, its gender and give it a name.  There are just two types of critter to choose from, but you unlock more as you progress.  Your virtual animal will start off as a baby, and grows each day.  Phil is currently three days old and has reached 100% maturity without dying.  Go me.  This means that I can now unlock the gorilla or the panda.

The app is perfect for children, or for grown-up children who want to relive their Tamagotchi days, or indeed for people like me who are not even responsible enough to look after a goldfish.

One aspect I really like is that they haven't gone all out with the cartoon graphics.  The LCD like display looks just great.

Phil, in his early days, running on my awesome Lumia 950.

I bought an Amazon Echo

I couldn't resist it.

Echo is a voice-activated speaker and home device controller.  She responds to the wake-up word 'Alexa' and is capable of creating lists, checking your calendar, the weather, traffic reports and more.  Those of you who follow my blog know that I have an interest in chatbots and digital assistants, so I couldn't resist purchasing the Echo.

Even though Amazon Echo is not available in my country.

I managed to find a UK seller on eBay who shipped a brand new device to me that arrived a couple of days later. Getting the Echo to work in the UK is not an easy process.  Anyone thinking of doing so should read the guidance on Amazonechouk.com very carefully.  Please do this and be careful who you buy from.  I hear stories of people purchasing devices that have 'fallen off the back of a lorry' from unscrupulous sellers.  These devices have already been reported to Amazon as 'lost in transit' and will not work for you at all.  You will have simply purchased an expensive paperweight.

I had a lot of trouble getting my device to work in the UK.

In summary:

  • You need to create an American Amazon account. That is amazon.com, not your usual amazon.co.uk account.
  • The Echo app is likely to be unavailable in your country. Attempting to use the web app will result in tears and frustration, or simply an error message saying that you need the desktop app (which is unavailable in your country). 
  • Following guidance online I used the web app in chrome on my Android tablet. You can get around the problems above by going to 'settings' and selecting 'request a desktop app'.
  • I then attempted to connect to my Wifi over and over until it finally connected.

It really did take a lot of attempts to connect the device to my Wifi, but I got there in the end.  I wish I could say what I did differently on the last attempt but I just don't know.

I haven't yet got fully to grips with everything she can do.  The main problems are the fact that she thinks I am in America.  I get American news and weather, and I need to say "what is the time in the United Kingdom" for local time.  She can't find local weather for me and I need to specify the I want "BBC" radio 4.

And then there is the irritating American accent.  They really need to release this product in the UK with a Yorkshire accent.

Despite the language barrier she responds well to voice commands and has no problems with my accent.  She can search the web and pull facts from Wikipedia within a couple of seconds.

I am looking forward to exploring all of the other things Amazon Echo can do for me, such as IFTTT integration, so keep tuned for more posts soon.

Before I go I need to say that at this moment I am inevitably reminded of Talkie Toaster from the wonderful Red Dwarf:

I bought some dinosaur poo

Yesterday I went on a day trip to Robin Hood's Bay in Yorkshire and was delightfully surprised to discover the Yorkshire Coast Dinosaur & Fossil museum.  If you are ever in the area then it is well worth a visit.

I couldn't resist buying a piece of fossilized dinosaur poo, which just goes to show that you can indeed polish a ****.

Macro photo of my fossilized dinosaur poo, or coprolite.
Me: Is this really dinosaur poo?
Curator: Yes, it is?
Me: Where does it come from?
Curator: From America.  America is full of it!
Me: It still is...

Yorkshire Coast Dinosaur and Fossil Museum - School parties welcome.  Plus one geek experience point awarded!
Robin Hood's Bay, so called because according to the legend, Robin Hood defeated a bunch of French pirates here and distributed the booty to the poor-folk of the village.  The beach makes for a fantastic walk and you will likely find some interesting shells and maybe even a fossil or two.

Woop woop woop woop woop!

Woop!

I've just discovered this virtual theremin with delay, feedback and scuzz.  Enjoy!  You are very welcome.

Thanks to Unofficial Talisman Computer Game fan Matt for finding this beauty!
Still here? Well, if you need more crazy weirdness from the Interwebs, then do check out these posts as well:

Happy Star Wars day from Cortana

Cortana greeted me today, in the form of Yoda, with a cheery "May the Fourth be with you" (chortle).

This image is courtesy of PC World, because I wasn't quick enough to grab a screenshot.
If you ask Cortana whether she likes Star Wars then you get the following pearl of wisdom:

+1 geek experience point awarded to Microsoft.

If you are sticking around with us for the rest of Star Wars day, then you might like to try our Star Wars name generator.

Sending SMS from a Raspberry Pi

I recently discovered how to configure my Raspberry Pi to send myself SMS (text messages).  Here's how:

First, get yourself an account with Twilio. This a free online service that allows you to send SMS from your Pi to a registered phone.  Once you have registered with Twilio you get an AccountSid and Auth Token to use the Twilio REST.  Keep these numbers private.

Next step is to boot up your Pi and connect to the Internet.  In the LX Terminal type:

  sudo apt-get update
  sudo apt-get upgrade
  sudo easy_install twilio

Once installed you are ready to play with the Twilio API.  I found that this only worked in Python 2.

Here is my first 'Hello World' program.

#Send SMS from Twilio account
#Needs to use Python 2
from twilio.rest import TwilioRestClient
account_sid = "YOUR ACCOUNT SID HERE"
auth_token = "YOUR AUTH TOKEN HERE"

client = TwilioRestClient(account_sid, auth_token)

while True:
    message = raw_input("Enter your SMS message\n-->")
    message = client.messages.create(to="NUMBER TO TEXT", from_="YOUR NEW TWILIO NUMBER", body=message)

    print(message.sid)
    print("Message sent.")
...And the results...

Messages sent from my Pi to my Lumia 950.  The possibilities for custom SMS-based alerts from Pi are now limitless.
Before I go, did you know you can also send SMS from Cortana on your dektop Windows 10 PC?   You will need a Windows phone and you simply have to say: "Send SMS to <contact name>".  Give it a go now.
Sending SMS from your Windows 10 PC.

Today we celebrate one year in space

On this day exactly one year ago we launched the world's first hypothetical Internet space mission.

Project Proxima is a light-speed space mission to the Proxima Centauri star system. The aim is to create a teaching tool that helps explain the vastness of interstellar space.



Today, Proxima has travelled over nine trillion km - that's 23% of the way to Proxima Centauri.


A lot has happened in the time since launch: the conservative party won the UK election; we have said farewell to countless well-loved legends of music and screen; Ireland voted for same-sex marriage; liquid water was found on Mars; all countries agreed to reduce carbon emissions; the WHO announced an outbreak of Zika virus, to name a few.

You can get involved in the mission by following on Twitter, or tracking the progress on the website.

You can also become an official supporter and sign up for email alerts.

Here are some nice things people have said about the project:

An interesting thought experiment, wish I'd heard about it before launch.

Travel to Proxima Centauri was (the) theme in Carlsagan Contact nook which my self and my daughter loved very much. To relive the experience is exciting.

Supercool!! Can't wait for launch!

Some other popular Project Proxima posts from last year:


Label

Blog Archive