Author Archive | Daniel

Community Spotlight: Problem Solving Club

Through multiple conversations we’ve had with people over the last 18 months, we have known for a long time that we’ve wanted some kind of ‘community’ blog. This would be a place for us to share and showcase the fantastic work that you’ve all been doing with the Crumble.

Our first guest in the Community Spotlight is Sway Humphries (née Grantham). After having a chat with Sway at Raspberry Fields back in 2018, we had come to the conclusion that we definitely wanted to showcase the ways in which the Crumble was/is being used. Sway told us all about the fantastic ideas that her pupils had been having, and that she would send across some videos. Fast forward seven months, with everyone having seemingly forgotten, we received an email. Sway was at BETT and suddenly had a Crumbly epiphany. Attached was the information for a blog, so here goes!

The following footage and ideas stem (excuse the pun) from a group of 7-9 year olds, taking part in a ‘Problem Solving Club’. All of the creations were planned and created in a single session!

First up, we have a ‘Flood Defence System’. When the water level gets too high, the alarm sounds.

The Flood Defence System in action

Next, we have a ‘Fire Navigating System’. When there is a fire, the alert is switched on and it shows you which way to go to get to the nearest exit.

The Fire Navigating System being put to the test

Finally, we have the ‘Stress-o-meter’. Every time something stressful happens in the day, you press the button, and the scale, as shown on the Sparkle Baton is increased. When the meter reaches the top, a separate LED worn on a wristband is switched on. This then alerts everyone else not to give you any more bad news as it’ll all be too much!

The Stress-o-meter showing us when to steer clear!

As you can see, all of these ideas are fantastic – and given the fact that they were planned for and achieved within one session is incredible.

If you have any great work you want to share with us, get in touch!

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.

We are on YouTube!

Check out the first of our Crumble-based videos, which we have uploaded to YouTube.

This video focusses on the Starter kit, along with how to use Sparkles.

To stay up-to-date with our video releases, why not consider subscribing?

The Crumble Heads to Bett

The team here at Redfern Electronics/Mindsets, along with Mike and Beckie from UKSTEM, are going to along to exhibit at Bett – the British Educational Training and Technology show. The show takes place at the ExCel centre in London, and is one of, if not the largest educational technology show(s) in the World.

Why not come and visit us on stand D413 – It’s free!

Boasting over 34,000 attendees from 136 Countries spread across 4 days, Bett is no small feat.

We will be there, showing off the Crumble, amongst other things, to quite literally the World! As well as interactive Crumble demonstrations, Mike and Beckie from UKSTEM will be there showing off their fantastic new initiative, ‘The Global STEM Award‘ as well as another exciting project, Supergrid.

Bett is free to attend and it runs from 23rd – 26th January. Why not pop along and see us on stand D413.

More Christmas Crumbling

As we draw closer to Christmas, we thought that it would be nice to share a few festive ideas. If you end up at a loose end over the holidays, especially if you have kids, then why not give these seasonal makes a go? They’re a great use of any cardboard that won’t fit into your recycling bin!

First up, we have our uber-christmassy Crumble-powered Rudolph, complete with flashing red nose. A quick internet search brought up loads of different cardboard reindeer templates. After cutting out all of the pieces, we got to work on the nose. For this, we used a ping pong ball. We sliced part of it off, and then glued it to the nose. We wired up a Sparkle, and wedged it inside the nose.

We then secured the rest of our reindeer together, and wired up the Crumble. We stuck the components towards the back of the head which allowed it to stand up on a table.

There we have it, one quick Rudolph, ready to guide your sleigh.

🎶Rudolph the red-nosed reindeer, had a very shiny nose, and if you ever saw it, you would even say it glows.🎶

Next up, we have another festive-favourite. If you, like the vast majority of people over Christmas, don’t need more cakes in the house, then why not have a go at a gingerbread-free faux gingerbread house? There is a wealth of inspiration to be had, just by doing a quick image search on the internet. Once your house is made and decorated, then we covered the windows with some tracing/baking paper, to diffuse the Sparkles inside. We then wired up our Crumble with a Sparkle baton, because you can never have too many lights – especially at Christmas!

Once it’s all wired up, simply program your required lighting sequence – we went for a flickering fire-like program (as seen here). Pop it inside the faux gingerbread house, and you’re all set!

If you have been inspired by any of these projects, or want to share something else awesome with us, then give us a shout on the forum or Twitter.

Add some Magic into your next Project – Magic Candle

The leaves are turning, conkers are coating the path and the ground seems to be permanently wet. This can only mean one thing – it’s Autumn. This means that it is nearing Halloween, and Harry Potter can be found on the tv most weekends. Who doesn’t love a bit of magic, right?

We wouldn’t declare ourselves the biggest of Harry Potter fans, but, one of the team has decorated his downstairs bathroom with all things Potter… Anyhow, we thought it would be a perfect opportunity to perform a bit of magic with the Crumble!

You could do much more than a candle, we’d love to see some of your magic creations!

We have made a ‘Magic Candle’. Spoiler Alert: we have used a reed switch and a magnet to control the Sparkle!

As you can see from the photo, we’ve made our candle using a rolled up piece of white card. We’ve used a glue gun to add some ‘dripping wax’ too. Inside the top we’ve placed a Sparkle, and a reed switch. We then placed a piece of plastic over the Sparkle (we cut up a scrap of frosted polypropylene) and put it through the ‘top’ of the candle. We’ve used our laser cut wand (with a magnet in the end).

After making the candle, it’s really easy to program and control… ahem, I mean cast a spell, to light it up.

The program (code) for this is simple, once you get your head around it. The reed switch (as the name suggests) is a type of switch. This means that when a magnet is placed near it, it closes, and the current flows through to the Crumble. When the magnet is moved away, it opens and the current stops.

Our code waits for the wand to be waved, which will set A HI, then it runs a ‘flickering’ Sparkle algorithm. We set the Sparkle to random shades of Red, Orange and Yellow, and wait a few random milliseconds before changing it again.

Note: the wait 100ms allows you time to move the wand away from the switch again.

When the wand is waved again, it sets A Hi, waits again and turns the Sparkle off. Simple!

And there you have it! One ‘Magic Candle’ ready to mystify and amaze.

We would love to take credit for the magnet and wand idea to set off a reed switch, but that comes courtesy of Mike and Beckie at UKSTEM. (We are definitely bigger Harry Potter fans than they are, though!)

Global STEM Launch and the Scottish Learning Festival

Last week was a very busy week for us here at Redfern Electronics. We attended two different event, one in York, and the other in Glasgow! This meant one thing – road trip!

Tuesday saw the official launch event of the ‘Global STEM Award‘, by UK STEM, at the highly-acclaimed National STEM Centre in York. We were there to integrate our products into the Global STEM Award, and all in all, it was a brilliant day. The event was well attended, with over 90 students from local schools, and as far afield as China! The Chinese students were on a trip to the UK, partially organised by Mike Cargill (Director, UK STEM), and it made sense to have more of a global audience for the launch of the Global STEM Award.

After Tuesday’s launch, we drove straight up to Glasgow, to set up for the Scottish Learning Festival. We knew it was going to be tight – but we managed to arrive with 30 minutes to set up – and we finished with time to spare! After our very busy day, we decided it was time to unwind…

We were at the Scottish Festival of Learning mainly to exhibit the Crumble. We are finding that whilst the Crumble is well established in England and Wales, it seems that most of Scotland haven’t heard of us! It definitely made sense to exhibit.

We had a great couple of days at the exhibition, and we had a great number of interesting conversations, with some fantastic people. Everyone was pleasantly surprised to find out how easy to use the Crumble is, and how it’s a perfect first step into the world of Physical Computing.

I’ve Got a Starter Kit – what next?

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!

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.

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.