Archive | Uncategorized

Science with the Crumble: Colour mixing

Red, Green & Blue:

Can you make your Sparkle baton display a rainbow? The simplest way is to set each Sparkle colour, in turn, with the computer’s colour picker:

Simple “sparkle baton rainbow” program
Sparkle baton displaying a “rainbow”

But do you know how a Sparkle LED can display all these colours? The primary colours of light are red, green and blue (RGB). Each Sparkle has a red, green and blue LED inside and the relative brightness of each of these determines the colours that your eyes see. Mixing equal amounts of red and green gives yellow; green and blue make cyan; and blue and red make magenta. Red, blue and green mix together to make white light.

Under the “Sparkles” menu in the Crumble software is a block which allows you to set the level of each RGB emitter (0 is off; 255 is maximum brightness). The following program will, therefore, display the primary and secondary (yellow, cyan and magenta) colours along the baton.

Primary & secondary colours

If you are interested in seeing how other colours are made, the colour picker will tell you the RGB values of the current colour and allow you to change them, via sliders or by typing the value. Here, for example, we have chosen orange:

The red emitter is fully on (255), green is at half-brightness (127) and blue is off. If we now increase the blue to fully on, we get pink:

Note: this is the MacOS colour picker, Windows may look different but should still have the same information. You might also notice a Hexadecimal colour code (Hex code #FF7F00): I won’t go into more detail, here, but if you are interested in computer programming and/or graphic design you should investigate this further. 

Colour & the Human Eye:

We can use the block

to show that equal amounts of red, green and blue light mix together to make white light. The program, below, though, also demonstrates our eyes’ persistence of vision.

Sparkle cycling between red, green & blue

The last Sparkle on the baton (“sparkle 7”) cycles round the primary colours more and more quickly. The time interval starts at y=1000ms then halves after every z cycles while the number of cycles starts at z=1 and then doubles. As the LEDs cycle faster our eyes will first perceive a flickering and then a steady white light. You can show, though, that the LEDs are still cycling, even when the white light appears steady, by rapidly moving the baton from side to side: now our persistence of vision lets us see separate red, green, and blue “lines”.

Further Colour-mixing Activities:

Can you use your colour mixing knowledge recreate the “rainbow” display, above, but now get it to scroll along the sparkle baton? This diagram may help:

RGB colour mixing diagram

If you have a sparkle matrix, you can experiment with more colour effects. For example, what do you think the following program does?

Or pick your favourite colour(s) to draw a picture:

Sparkle matrix displaying a pink heart.
Happy Valentines Day!

The next blog post will explore using variables as RGB values and show how to use an input to control the Sparkle colours.

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.

Crafty Crumble Creations: A “police” helmet.

Whenever our 2-year-old finds something with a flashing light on it, he holds it on top of his head and runs around shouting “nee-nah nee-nah”. I decided we would make a flashing helmet, using a variable to set the Sparkle colour and brightness in the Crumble Software.

We used:IMG_9210

  • 1 laptop with Crumble software installed
  • Crumble controller & Sparkle
  • 1 battery box with croc-clip attachments; 3 AA batteries
  • Croc-leads and a micro-USB cable
  • A switch/Switch Crumb
  • Plastic dome; glue; tissue paper; blue paint; cardboard; & sellotape

Connecting the Crumble

Screen Shot 2015-05-18 at 16.49.34This diagram shows one way of wiring up a Crumble, battery box and switch. The switch is connected to Pad “A” on the Crumble and to the +ve terminal of the battery box. By default, the input pads are at zero Volts (“low”). When they are connected to the batteries they receive 5 Volts (“high”).

In this case, when the switch is pressed, input A is connected to the batteries. In the software, therefore, we can use the “Wait until A is Hi” block to tell the Crumble what to do when the switch is pressed.

The croc-leads on the right-hand-side of the Crumble connect to a Sparkle (see previous blog posts)

IMG_9053The photo, left, shows the Crumble and Sparkle connected with a standard push-to-make switch. There are a couple of problems with this set up, though. Firstly, 2 IMG_9056croc-clips have to connect to the top-left “power-in” pad on the Crumble. Also, the tips of the two croc-clips connected to the switch are very close (see right) and can easily short-circuit.

IMG_9061A tidier soloution is to use a Switch Crumb (the one pictured is designed and sold by 4tronix ). This has pass-through power lines, like the Sparkles, meaning it can be connected in line with the battery box and the Crumble.

A pad at the bottom of the Crumb connects to an input on the Crumble (the yellow wire in the picture), in this case to Input A.

Programming the Crumble

Screen Shot 2015-05-18 at 15.25.18Within each Sparkle there are actually 3 LEDs: red, blue & green. Their relative brightnesses are varied to create any colour from the visible spectrum. The RGB Sparkle block (below) allows us to precisely control the colour, by setting each of the LEDs to a value between 0 (off) and 255 (maximum brightness). In this program we keep red and green at 0, only changing the blue.Screen Shot 2015-09-19 at 08.37.25

 

The Crumble program used is shown above. It continuously checks to see if Input A is high (i.e. if the switch has been pressed). When it is, a loop is executed five times. This gradually increases the brightness of the blue LED within the Sparkle then decreases it (by incrementing the variable “t” from 0 to 200 then decrementing back to 0).

Constructing the HelmetIMG_9191

IMG_9197IMG_9204

IMG_9211

The plastic dome came from a supermarket package of profiteroles. A hole was cut in the top so the lid of a fabric softener bottle could be inserted. We glued bits of torn tissue paper all over the plastic (a la CBeebies “Mr Maker”) so that it could be painted blue.

The Sparkle was positioned so that it shone up into the the bottle top and the rest of the electronics was sellotapIMG_9205ed into the dome then covered with a circle of card, leaving the switch exposed.

I was planning to construct some sort of headband, attached to the bottom of the dome, with the switch mounted on it like a badge. The two-year-old, though, had already decided we were done. After that, he was never still enough for me to take a better photo than this (see right), so I think I can claim the project was a success!

DISCLAIMER: Clearly this is not a “toy” that would pass any of the safety tests required to make it suitable for under-threes.  The construction of the helmet was an afternoon distraction and our child was closely supervised at all times.