Posted on

Basics of Iterative Design: Crumble Ball Launcher

One of the most crucial parts of any design-based work is the process of iteration. Put simply, it is the process of Design, Prototype, Evaluate. Improving our thoughts and ideas, and accepting that our own work will likely never be perfect and will always have room for improvement are important skills. It is also important as some problems with a design may only be discovered whilst making or using a product. Iterative design irons out the wrinkles, and makes for a better end result.

To give the process a go, we decided to make a ping pong ball launcher, using the Crumble. There was, however, a crucial design constraint. Could we design one whose only powered part was a servo?

It is worth noting at this point that this isn’t necessarily a project you SHOULD do with students, unless you can definitely trust them.

After thinking for a while, we came up with our first design: a trebuchet-inspired design with the servo providing the ‘throwing force’. If the servo is capable of launching a ping pong ball, then this method should prove it.

After extending the main launch arm to the point at which it is almost too heavy, we can say that it doesn’t work very well. It definitely shifts a ping pong ball, but it doesn’t have enough velocity to keep traveling very far.

After prototyping and evaluating the first main design, we decided to go down a different route. We were inspired by a cardboard ping pong ball launcher that we found on YouTube after some research. We realised that we could use a similar firing mechanism, which uses a rubber band to provide some elastic potential energy. The servo could then be used to release the mechanism, hitting and launching the ball.

Our first attempt was much more promising. It successfully launched the ping pong ball a surprising distance! There were, however, some improvements to be made. We decided first of all to address the point of contact between the aluminium rod and the ball. We thought that area wasn’t big enough, so we 3D printed an adapter for the end.

We added the adapter and launched the ball a few times – it definitely made better contact with the ball. But there were still a few issues. The servo arm would occasionally miss the main launch shaft (aluminium rod), the body was beginning to wear down from the impact of the wooden stop and the whole thing felt a bit flimsy.

Because of the success that we had had with this design, we thought that we didn’t want to come up with a new one – instead we decided to refine and model, and 3D print a big portion of it, using a lollipop stick in place of the aluminium rod, as it felt safer.

The final mechanism works really well!

Without going through the iterative design process, our design wouldn’t be anywhere near as good. This important process happens all of the time – whether it be a blog post, a leaflet or a new product. The process of evaluating and refining work is crucial.

Posted on

Improving Lives – Digital White Cane

It can be hard to imagine what life would be like if you were blind. The simplest of tasks become much more difficult, and yet those who are blind can lead very full and active lives. However, one of the larger challenges they face, is navigating the hazard-ridden hustle and bustle of outdoors.

The use of a cane to aid those with visual impairments has been around for centuries , but it wasn’t until the early 20th century that the more familiar white version came into existence.

The purpose of the White Cane is to enable the user to identify obstacles on the ground, and alert other pedestrians etc., to the fact that they have a visual impairment. The basic design has stood the test of time, but what if we could improve this design by bringing it into the modern era? By adding an Ultrasonic Distance Sensor and a motor with an off-centre mass, we can create a walking aid that picks up on objects before we get close to them and vibrates depending on how close we are to them!

To make our digital version of the White Cane, we are going to combine the Crumble (for our programmable electronics), along with some other design elements, including some 3D printed parts.

As this is more of a proof-of-concept, we are not aiming for a retail-ready design. This is much more of a prototype, enabling us to try out ideas; an important part of any Design and Technology work! We have put together a list of the key features we needed to think about:

We decided on 3D printing a mount for the Ultrasonic, which would also accommodate a ping pong ball to help the cane move freely over surfaces.

The Ultrasonic slots into the mount upside down to allow easy access to the connections, and the cylindrical adapter allows a snug fit with the main body of the cane (PVC pipe).

At the other end of the cane, we wanted an ergonomic handle, so we designed and printed a core, around which we could use polymorph to create a custom grip.

To make the grip, we heated our polymorph using a heat gun (take care – it can get hot!) and then wrapped it around the handle piece and squeezed to get a custom moulding of our grip. Make sure your polymorph isn’t too hot – it will soften the PLA!

Then it was just a case of putting all of the pieces together. We used elastic bands to secure our motor mount and other Crumble components.

Finally, we just needed to program the Crumble to vibrate according to our own requirements. As a start, we got the cane to vibrate when we detected an object that is less than 50cm away.

And there we have it, our Electronic White Cane prototype! You could progress on from here in multiple ways, including, but not limited to: extending the program to make it vibrate at different rates depending on the distance away of an object; building a full-size version and testing it out by using blindfolds etc.; building a self-contained ‘finished’ version.

If you have a go at this project, or any other, we’d love to see! Get in contact with us via email, or on Facebook, Twitter or Instagram.

Posted on

Pi Wars: a Story

Back in the summer of 2018, Joseph and I found ourselves at a ‘super secret’ meal after the first evening of Raspberry Fields. Apparently, staying in the same seats for the duration wasn’t allowed, and as such, we chatted to a few different people. Luckily, for our dessert, we ended up sitting opposite Michael Horne and Tim Richardson – famed for creating the infamous Pi Wars robotics competition. I had heard about the event on Twitter, and was especially interested in having a go.

To cut a long story short, I was very keen to take part! Furthermore, Joseph was definitely up for sponsoring the event with some prizes.

The good news came on the 30th of September 2018. Our application had been successful and we were set to compete in Pi Wars 2019! I was to take the reins on our entry, as Joseph is a very busy person, and as I was fairly new to python, it would be a great learning experience.

“I knew it was going to be challenging, but I hoped it would be rewarding as well”

The process of learning how to do any of this was going to be quite extensive. I’m a Raspberry Pi Certified Educator, and I had tinkered with the Pi on the odd occasion, including making a Wiimote controlled vehicle using the CamJam kit but I had never completed anything beyond this. I knew it was going to be challenging, but I hoped that it would be rewarding as well. One of the best ways to learn a programming language is to use it in context; a real application.

When discussing ideas for the robot (before we had applied), Joseph had mentioned that there was a Python library to control the Crumble over USB. This was brilliant. We could use the Pi for all of the processing power (to stick within the rules!) and the Crumble could be used as our Motor Driver board, and power any Sparkles we may want to attach.

My first step was to focus on learning Python. I’d become familiar with a couple of written/block-based languages in the past, and I had even gotten halfway through a Python course, but unfortunately it had been a while so I needed to start from scratch. I made it part way through an Udemy course, and then I started and completed the free Python course from Codeacademy. This was a big step for me. I had reached the end of a programming course, and I was feeling much more confident in getting started.

“After swearing I would get started before Christmas… January arrived”

After swearing that I would get started before Christmas, and not do my usual procrastinating, January arrived. It was very busy – we were heading to BETT this year to exhibit. I knew I wasn’t going to get started until February. As a part of a conversation with our Spanish distributor for the Crumble (Complubot), Joseph had been made aware of something very useful – The Pixy Cam.

After getting back from BETT, we looked into the Pixy2. It looked incredibly easy to use, it could detect coloured objects and lines, and it was possible to interface with it via Python – perfect! We purchased the camera, along with a pan and tilt mechanism, and couldn’t wait to get stuck in.

The included software for the camera was simple to use, and offered some great features – especially when it came to tweaking the camera’s settings to recognise colours (signatures) and lines (vectors). One of the steepest learning curves, however, involved interfacing with the camera via Python. It seemed that the device was much more suited to controlling via an Arduino than a Raspberry Pi, and as such, it was hard to find a great deal of information about using it with Python.

As a part of the installation process, four example Python programs were generated. I would rely heavily on these to work out what to do!

I was becoming overwhelmed with the ever-decreasing time left, and this caused me to take some drastic action – a mind map! I planned a very basic chassis to get something moving, and then wrote down what steps needed to be completed before the big day. This is called decomposition – breaking down a problem into smaller, more manageable pieces.

“I was feeling much better about the still mammoth task ahead”

One of my first steps was to control a motor connected to the Crumble, by using Python This would become my ‘Hello World’ style program. After this small, but important step, I was feeling much better about the still mammoth task ahead.

The remote control portion of the project was quickly finished – I had used the ApproxEng library for connecting to, and controlling motors, in the past, so it didn’t take much to adapt the code to work for the Crumble. Theoretically, that was the programming completed for half of the challenges!

The steepest learning curve, and the point at which I repeatedly questioned why I was doing any of this, was programming the autonomous challenges. After tinkering with the example Python programs, I decided to start with the Line following program. This wasn’t too difficult to do – I had experience with various algorithms for line following. Once I had worked out what information I could use from the Pixycam, it all fell into place quite quickly! After this, I set to work on driving towards a colour signature. This was with the autonomous maze in mind as I felt that this would be more challenging than the Nebula. Once I had the working maze code, I could reuse elements of it to help recognise, and correctly approach the four colours in the Nebula task.

I learnt a lot whilst programing these challenges:

  • Things fail – a lot. I spent a lot of time thinking, staring at code trying to make sense of why it wasn’t working.
  • Take breaks. I regularly found myself slumped at my desk, getting increasingly frustrated. I stopped, came back to it the next day and more often than not, immediately solved my issue.
  • Don’t be afraid to redo something. Some of the functions I had written were messy, and didn’t work properly. A whole new line of thinking enabled me to produce better, and more efficient code!
  • Not everything has to be perfect. This is was an amateur robotics competition, of which I am a beginner. It was better to have something clunky but working, than something that doesn’t work at all. The day before the competition, in consultation with Joseph, I decided to put my ‘fancy’ maze following code to bed, and develop a simpler version. Given that the maze was preset, and we had access to the plan, why would I even bother looking for the next alien to the left, if i knew it was a right turn?

We both thoroughly enjoyed our time at Pi Wars. It was a day of both success and failure, but it was a very rewarding task to undertake. I managed to battle my way through to the Grand Final of Pi Noon ( a 1v1 balloon popping battle), coming second after a close final. But more surprisingly, we won the beginner category! Our slow, solid and steady Crumble Robot had powered its way round to victory!

Here are just a few pictures from the day!

This whole experience has proven that one of the best ways to learn programming is to give it a context. Trying to learn something whilst not giving it a real-life context makes it very difficult, and it doesn’t ‘stick’. It is worth mentioning that this is one of the main ideas behind physical computing – blurring the lines between a computer and physical components and pieces. Programming and controlling something that you’ve made yourself gives you a fantastic feeling, and I definitely have a stronger urge to continue, more so than in the past.

Posted on

I’ve got a Crumble Starter Kit – now what?

note: some links in this post go direct the the home of the Crumble, Redfern Electronics.

You’ve been lucky enough to get your hands on a Crumble starter kit, you’ve connected bits together and managed to get a Sparkle shining red, but now what? What else can you do with it apart from make a red light?

We’ve decided to collate a list of inspiration and ideas for projects that you can make using only the contents – and container – of the starter kit.

We’ll start with the simpler projects, before looking at a couple of more advanced ones. First up we have a simple timer. This can be made as simple or advanced as you like, but the main premise behind it is that a timer for 30 seconds will start when you press the button.

The program is simple. Wait until the button is pressed, turn on the Sparkle white, then after 30 seconds, turn it off. The program then repeats, waiting for the user to press the button to start the timer again. This could easily be extended by adding in a nice pulsing effect every second, getting faster near the end of the time limit.

Next up we have the classic ‘police lights’ project. You can start off by making only the lights, which you can then ’embed’ into a model police car. If you are feeling particularly creative, you could use the starter kit box to make a chassis, which you can then turn into your own ‘moving’ vehicle! As a starting point, we want to make the two sparkles alternate between red and blue. This could then be elaborated on, to create extravagant flashing patterns, or even use the switch to cycle between various styles!

This is one of the simplest, yet most satisfying programs! To represent police lights, we turn the Sparkles on red and blue, then after a short time, we switch their colour.

Now we have an example of a simple project, with a bit more ‘making’ involved. The lightbox is made using either the starter kit box, or another box, and a piece of paper. We then can light up the message using the supplied sparkles. To make the programming more difficult, we can control the lights via the switch, make them change colour or even fade through the RGB values.

The programming for this project is surprisingly simple, once you know how. We are going to wait for the button to be pressed, and A to become HI. Then we’ll turn on the Sparkle(s) white (you can use as many as you like with this code!). Then, each time the button is pressed, the Sparkle(s) changes to another colour, or off. The wait statement allows us time to remove our finger from the button, setting A LO. If we didn’t have it, the program would skip through repeatedly, as it runs faster than we can move!

For our final basic project, we have our very own model Zebra crossing, complete with flashing Belisha beacons! Using most of the starter kit box as the ‘crossing’, we’ve made two beacons out of  some of the lid from the box. Programmatically, this isn’t too taxing – its an infinite loop, alternating each light.

This code is nice and simple – set one Sparkle to Orange, and the other one off. After one second, switch them around so that the orange one turns off, and the one that’s off turns on orange. Wait another second before repeating. This will then give us the effect of them flashing alternately.

Now we move onto some projects for those of you who are more experienced. First up, we are going to look at a simple reaction time gamer. One Sparkle will light up after x milliseconds, then you have to press the button as quickly as you can. Within a set amount of time, and you get a green on the other Sparkle, but too slow and you’ll get red.

Now that we have moved onto something more complicated, the code has gotten longer, however, it is just as easy to understand! This program waits a random amount of time (0.5 – 3.5 seconds) before turning on the Sparkle white. It then ‘times’ us by adding 10 to our ‘Time’ variable, every 10ms, until the switch is pressed. If we took less than 350ms, we get a green flashing Sparkle, but if we took longer, it goes red! If you have a Sparkle Baton, check out this project.

On the theme of reaction-based games, we have our ‘Sparkle Snap’ game – The two Sparkles light up a random colour (from a predefined list), if they match you must press the button as quickly as you can. Succeed, and you’ll be rewarded with flashing green Sparkles. Get it wrong, and you’ll get red.

We’re starting off by lighting each Sparkle one of three colours. We’ve assigned ‘ColourOne’ and ‘ColourTwo’ a random number between 0 and 2, and then using selection (if statements), we’ve lit the Sparkles depending on the variable values. It’s worth noting that this section could be far longer, if you want a wider range of colours. The Sparkles are then on for either 500ms or until the button is pressed. If the time elapses, the game just continues, whereas if the button was pressed, we check to see whether the two colours (variables) are the same. If they are, then we flash green for 2.5s, if they weren’t, then we flash red for 2.5s. This game could be taken a lot further if you wanted too – making it get faster after each correct guess, adding in a penalty if you miss a pair etc.

Next up we have a slightly simpler project to the previous two – morse code. Using a Sparkle, it is possible to flash an array of messages, using morse code. This one is fairly self-explanatory, and using a variety of wait statements and repeat loops, it is easily achieved.

This is the less efficient way of making this program, but it works nonetheless! Put simply, we have flashed our Sparkle based on something in Morse Code. This is achieved by using the wait statements, to correctly display a dot, dash, the gap between letters and the gap between words. If you want another starter kit, ‘code’ based Sparkle project, check out our Lighthouse.

Finally, we have another ‘maker’ based project, using the starter kit box (or other). By colouring the box in black, and poking some carefully placed holes, we can easily make a ‘constellation’. We can then add some realistic twinkling, by randomly choosing shades of bluey-yellowy-white. Although simple to make, it is a nice programming exercise using repeat loops and variables.

Our last code segment is actually quite simple. By defining the range of various random number blocks, and placing them in the RGB sections of the Sparkle variables, we can define a random set of colours. Then, by waiting a random amount of time for changing them, we can get a realistic twinkling effect!

There are numerous possibilities when it comes to deciding ‘what to make’ using the starter kit – many more than we’ve listed here. Hopefully you’re now feeling more inspired, and have some fantastic ideas of what to make at home, or with your class. If you have other Crumbs and components laying around, don’t forget to head over to our Projects to see what else you can make.

Have a cool idea that we’ve not listed here? Please don’t hesitate to drop us a message on our contact us page, or Twitter!

Posted on

A Crumble-Powered Automatic RGB Nightlight

Sometimes inspiration can be hard to come by. We have known for a while that we’ve wanted to make a nightlight, but didn’t know how to make it different from all the rest.

We stumbled across an interesting video on YouTube which peaked our interest and gave us the inspiration we needed. How awesome would this nightlight look if we added a whole heap of Sparkles (a Matrix display) and gave it a Crumble kick?!

The Crumble-powered RGB nightlight was born.

Although this post will be a whistle-stop tour of the process, when we have our finished Sparkle Matrix display, we will definitely work on some in-depth instructions and teaching resources.

We started off by preparing a cardboard box, by removing all of the sellotape. We then glued it back together, to make sure that it was sturdy.

We then cut the faces of the box off, leaving a border. This would give us the frame for our light.

After this, we drew some straight lines on a word document and printed off 5 copies. We then trimmed each sheet so that it could be glued inside the 5 faces of the frame.

When we had finished our light, we decided that we didn’t like the bare cardboard, so we used a silver permanent marker to give it a metallic look.

Wiring up the Crumble was simple enough.  After connecting the Sparkles (inside the shade), we connected a light-dependent resistor (LDR). One end connected to a + output, in this case from the batteries, and the other end connects to an input (A, B, C or D). We used A.

It’s really easy to use an LDR with the Crumble. Take a look at the following program. When the analogue value of the LDR (we’ve renamed it to be helpful) is above 90, turn all of the Sparkles off,  if it isn’t above 90, and therefore less than it,  then turn the Sparkles on.

To get the nice RGB effect, we have cycled through the red, green and blue values.  This graph shows how increasing or decreasing the different values gives us different colours. Doing it in this particular order gives us a lovely rainbow effect!

We have created variables called Red, Green and Blue. We then set the corresponding red, green and blue Sparkle values to our variables. We have cycled up/down the RGB values to give us our transition of colours. Each time the colour changes, we check to see the value of the LDR, and whether or not to turn the lights on/off.

And here is our RGB nightlight, in all of its glory! When the Sparkle Matrix gets finalised, we will create some more in-depth teaching resources for this project, as it’s easy to make and really satisfying.

Posted on

Getting to grips with the Crumble line follower

We often get asked questions about how to use the line follower with the Crumble, so we thought that we’d provide some updated examples on how to use it.

For those of you that aren’t familiar with it, the ‘Crumble Line Follower Widget‘ is a small board with two infra-red sensors in. Their resistance changes depending on the colour/ amount of light they sense. This means we can use the analogue values on the Crumble, along with some motors, to make a buggy follow a line!

There are many different ways to program a line-following buggy, and we are going to have a look at these. It is worth noting before we go any further, that there are many factors that can influence how successful your line-following adventure will be. Everything from how white your surface is, how reflective it is (for infra-red), how close the line follower is to the surface, to how charged your batteries are.

First of all, we need to wire up our Crumble and line follower. If you look at the back of your buggy, the right motor needs to connect to the motor two pads (red + and black -). The left motor connects to the motor 1 pads, but because the motor is flipped, we need to reverse the wiring so that the ‘forwards’ block still makes the motor move forwards. So we will connect the black to + and the red to – . The line follower then needs connecting. The power (+ and -) connects to the corresponding pads on the Crumble or battery box and then the ‘left’ and ‘right’ pads need connecting to two of the I/O pads e.g. A and B.

Note: This may be different depending on your motor configuration/set up. If you are in doubt, have a play and find out!  

Method One: The Simple One

We will first look at the shortest and simplest way of getting the line follower to work. This method links the analogue values with the corresponding motor speeds.

There are occasions when this technique doesn’t work so well – it will depend on the materials you are using and how tight the ‘track’ you are following is!

Method Two: Treating Them Digitally

The next method treats the inputs digitally – so that the readings are either HI or LO. If the left or right are reading low, we only want the opposite motor running. Or when a side is on white, we want that motor to keep running.

Method Three: Analogue Alternative

When the digital method doesn’t work correctly, whether it is the surfaces you are using, or the height of the line follower from the floor, we can use analogue values instead, to achieve exactly the same effect.

Method Four: Comparing Left & Right

The other methods we are going to look at rely on comparing the left and right values to one another. This one works as follows: If the left analogue value is less than the right one,  gradually turn left- else gradually turn right. The motor speeds can be adjusted depending on the complexity of your course.

Method Five: Joseph’s Brainchild

The other comparison method we are going to look at is the brain-child of Joseph, the Crumble’s creator. It involves finding the difference between the left and right values, and then adding/subtracting from the relevant motors.

These five different programs are just a snapshot of the vast number of ways you can program a line follower. If you wanted to use a white line on a dark surface then it is just a case of inverting the motors, or the comparisons.

Posted on

Mindsets head to the Education Show

Last week, a few of us travelled up to the NEC, Birmingham for the Education Show. We were there mainly to exhibit the Crumble Controller as the show tends to be geared towards Primary and Home Educators – and the Crumble is perfect for Primary Computing and Design and Technology. Loads of people had a go with the Crumble and there was a real excitement surrounding the stand.

We were sharing our stand with Mike and Beckie from UK STEM – they were launching their fantastic new initiative called ‘The Global Stem Award’ which you can find out about here.

When the show had quietened down, we even found time to set each other some Crumble challenges!

We thoroughly enjoyed our time at the show and it was great to meet so many new and familiar people, all of whom share our excitement and passion for education. We look forward to the next one.

Posted on

Make a 7-Segment Display with the Crumble

Here is our latest Crumble project, hot off the press!

Once again it all started with an idea. We wanted a better way of displaying numbers (and some letters) with the Crumble – and that got us thinking. In essence a 7-segment display is made of seven bars, which get lit up. So we decided to give it a go.

We started out with all of our resources. Along with this we used a glue gun and a pen.

After cutting out our templates, we stuck down borders around each segment and the whole display.

This is the basic ‘shell’ of the 7-segment display. It just needs Sparkles, and a paper covering to diffuse the light.

We then wired up the display, Starting with 0 at the top and working in an anti-clockwise spiral shape, connected them all together, gluing a card support to hold the Sparkles in place.

After wiring it up, connecting to the Crumble and programming it, we have our very own 9 second timer – using real numbers!

If you would like more information about this project and others, most of which include  free lesson plans, PowerPoints and worksheets, head on over to Redfern Electronics, our partner site and home of the Crumble.

Posted on

Getting musical with the Crumble

A Crumble powered instrument that can play a tune? You must be mad!

Don’t worry, we thought we were too, but after having this idea in our head for a long time, we finally bought a glockenspiel to try it out-  and lo and behold our Crumble powered glockenspiel is alive.

Surprisingly, you don’t need many parts to make the instrument work. A glockenspiel with a beater, two servos, some cable ties and a sticky pad or two. We placed it on a spare piece of corriflute so that we could keep the servos and the glockenspiel aligned.

We needed two servos for this. One servo with the “cross” attachment, and the other with the “double arm”. These were then wired into the Crumble, one on A and the other on B.

The two servos were then connected with sticky pads and cable ties. The bottom servo moves along the X axis (left to right), and the top servo along the Y axis (up and down).

To allow us to easily play the given notes, we created a variable for each one and worked out, through trial and error, which notes were at which angle.

We then moved onto setting out variables for a crotchet, a minim, and then the angles at which the top servo needs to be to hit the glockenspiel, and where it should rest at.

This is the block of code to hit the ‘F’ key, for one crotchet (same as the beat). The total of the wait statements is 750 milliseconds, which equals 80 beats per minute.

And there you have it, one Crumble-powered Glockenspiel! Our instrument came with some free music, so we decided to use one of those pieces. After piecing together many snippets of code, here is Beethoven’s 9th Symphony – well the first line, in all of its Crumble-y glory.