Freebie – Make it functional

The 2015 Royal Society Exhibition entitled “The body you know” comes with a free smart badge that counts the number of body movements required to change the colour of an LED. Movements include walking, running, dancing and other activities, depending on the location of the badge on the body. 

In the core of the sensing electronics lies a tilt sensor that changes its internal resistance according to the movement of a small sphere inside a metallic tube as shown in the figure below. The sensor can be seen as a switch that is “on” when the sphere reaches the bottom of the tube, effectively closing the circuit between the two terminals of the sensor (the condition of zero resistance) and “off” otherwise (high resistance). For proper operation of the badge, the user must first insert a 3V coin cell battery in the retainer with the “+” sign facing up, then turn “on” the mechanical switch by sliding the actuator towards the tilt sensor. Then the fun starts! The average number of steps required to change the colour of the LED is 256, although it can vary according to the type of body movement. At first, the LED will remain off so don’t be disappointed if you can see no colour – this is the first level of the challenge! Just complete the first 256 steps and you’ll be delighted to see a beautiful blue light popping out of the badge. The more movements you produce, the more colours will be displayed – 7 in total!  If you want to know more about the electronics behind the badge just go through the text bellow and discover, among other things, the basic concepts behind the implementation of the binary code and the RGB colour system.  



Binary Code and RBG Colour System

The binary code represents the way modern computers interpret information that enable them to communicate together and with smart sensing devices. The code only makes use of two digits, 0 and 1, to set up any information-oriented operation between intelligent systems. Although humans are genetically programmed to use the decimal code (you have 10 fingers on your hands to start to count with), that might not be so efficient when it comes to coding information. The binary code as we know it today was invented by the german mathematician Gottfried Leibniz in 1679 during his attempt to convert verbal words into mathematical statements. Any real signal (like speech) can be represented by its binary counterpart so digital systems can understand it. For instance, in a 3-bit position system, each position can only take a value of “1” or “0”, which gives 2x2x2 = 8 different levels (or 23 in binary language) to code information. For a counter, that means that we can code the decimal numbers from 0 to 7 using a 3-bit pattern.

At the same time that Leibniz was experimenting with the binary system, British physicist Isaac Newton was trying to decompose white light into its elementary components. Prism experiments presented him with a rainbow of colours and the continuous spectrum of wavelengths was finally decoded with the advent of quantum physics in the early part of the 20th century. Although the spectrum for visible light extends roughly from 400 nm to 700 nm, the human perception of colours can be tricked into observing the entire spectrum by adding together just the three primary colours – red, green and blue. This code forms the basis of the RGB system of colours used for the display of images in electronic devices with image and video processing capabilities. The figure on the right shows the combination of the three elementary colours as a 3-bit pattern, with a “1” on a particular slot meaning that the corresponding primary colour is switched on. The resulting colour appears on the right of the binary pattern and you can see why the first level starts with the LED off – all 0’s in the binary pattern – and the first colour to appear will be blue. The last colour will be white, when all the primary colours are combined together – all 1’s.

Schematics and Printed-circuit-board

The figure below shows the complete electronic schematic for the badge. It consists of a 12-stage binary counter (the 74HC4040653 from NXP Semiconductors®) that advances on the high-to-low transition at the clock input terminal pin represented by CP. The source for these transitions is the tilt sensor (the CW1300-1 from ASSEMTECH®) configured as a pull-up switch that changes its state when actuated by any body movement. Since the tilting of the sensor produces a lot of signal ripple during the high-to-low transitions, a 1st order low-pass filter is employed in the form of a 330 kΩ resistor and a 4.7 nF capacitor at the output of the sensor. This filter ensures that transitions faster than 10 ms are effectively blocked and only the much slower transitions produced by body movements will be responsible for advancing the counter. The counter will change the colour of a multi-colour LED (the ASMT-YTD7-0AA02 from Avago Technologies®) as it reaches the required number of transitions to excite only the 3 most significant bits (Q9, Q10 and Q11) out of the 12-bit pattern. This means that 512 (29) transitions are required to change the colour of the RGB system.

The entire colour pattern will be complete after 4096 transitions (or 212) after which the counter resets to the first level. Of course, since one tilting movement of the badge can generate more than one transition (the sphere can bounce back and forth inside the tube), the real number of transitions (body movements) is lower than 512. This explains why the average number of steps required to change the colour of the LED is actually 256, as stated above.

The extra 1.5 kΩ resistors in the schematic are set to control the current that will flow through the LED to a level of 2 mA, a value that will extend battery life for a period of 19 hours in continuous operation using the 38 mAh cell coin provided with the badge (non-rechargeable unfortunately!). Finally, the above figure also shows the printed circuit version of the badge along with the positions of the electronic components in the top (red) and bottom (blue) layers.

Meet the 2014 Nobel Prize in Physics – blue LED technology

The Royal Swedish Academy for Sciences awarded last year’s Nobel Prize in Physics to Isamu Akasaki, Hiroshi Amano and Shuji Nakamura for their work in “the invention of efficient blue light-emitting diodes, which has enabled bright and energy-saving white light sources”. The light-emitting diode (LED) is a light source diode consisting in a p-n junction that emits light when activated by an electric current flowing in the correct direction, that is, from anode to cathode. Recent advances in LED technology have contributed to the replacement of traditional incandescent lights in many household and street lightening systems as well as on the screens and displays of modern electronic equipment. LED technology combines small sizes with lower power consumption and long lifetimes, while providing reliable light sources in the visible, ultraviolet or infra-red regions of the electromagnetic spectrum.

Build Your Own and Improve the Circuitry

When you start playing with the badge, you will soon find that the function can be improved and that you can 'cheat' the system easily without actually going for a run or walk around your local park. So how can we beat these cheats? We can either build additional circuits to make sure what the sensor detects is related to physical activities, or we can add a micro-controller to implement on-node processing to recognise gait patterns. To find out more, visit our stand at the 2015 Royal Society Summer Science Exhibition or come back to this website and check for updates. Have fun and see you soon!