This Tutorial describes a digital system and uses the Kookaberry STEM platform to illustrate its fundamental principles
What is a digital system?
Digital systems receive information from Input devices such as a mouse, motion detector, microphone, or steering wheel, and make decisions (Processing) about what to do with the information depending on the circumstances.
The decisions are transmitted to Output devices such as buzzers, LED’s, servos or displays
Even doorbells you can buy at your local hardware store are now digital systems.
Go to the Alarm app and see how a burglar alarm works
The Kookaberry is a digital system
It’s a little digital system just like all the other digital systems that help us in our workplace and home and in our lives generally.
It contains its own input and output devices as well as connections to external ones – called Peripherals
Download the poster from the Side Bar to the top right
How do digital systems sense things?
What is data?
Data are facts that describe something – like temperature; or how far away something is; how fast something is moving; how loud a sound is; or if a gate is open or closed.
Data can be numbers; words; or a voltage or current that is changing according to what a sensor is detecting.
Data is a funny word, as it is spelt the same whether it is singular or plural. Sentences using the word can look peculiar sometimes…
How do sensors collect data?
They change their electrical state – generally by varying voltage or current – in harmony with the continuously changing analogue data that they are measuring.
Human sensory receptors (eyes, ears, nose, etc) rely on analogue signals to interpret the natural world around them.
A microphone is a sensor
What does a digital system do with the data?
Sensors (an Input device) connected as to the digital system detect change in voltage or current and turn it into something shown on a display (an Output device) – like the temperature in degrees Celsius, or the intensity of light as a percentage.
It can also use the processed data or information to make a decision like a turning on a fan (if it is too hot), or a light (if it is too dark)
- Go to the LightMe app to see how the Kookaberry measures ambient light level and switches on a light when it falls below a preset level
- Go to the Recreating the LightMe app in KookaBlockly to see how easy it to code the same app yourself in KookaBlockly
- Go to the Conserving Energy Project to see how you can use these apps in a project.
Why is it called a digital system?
Every digital system has a digital computer – also called a processor or a microcontroller – at its heart. That is why it is called a digital system.
Digital computers work with data that is represented by just two digits – zero and one. As there are only two digits it is called binary code – where “bi” means two.
Morse code is also a binary code, but its two states are not zero and one, but a long and short dash.
How do you convert decimal numbers into binary numbers?
We are used to counting and measuring in units of 10 – probably because we have 10 fingers…..
We don’t want to change our way of counting because a digital system only has a choice of two states (0 and 1) so we need to be able to easily convert decimal numbers into binary numbers and back again.
This is the BinaryNumbers app on the Kookaberry. Check out the video and try it out…
How is an analogue signal changed into a digital signal?
An analogue signal, which has an infinite range of values or levels, can be reproduced if it is measured very rapidly, and the value transmitted in binary form.
This is usually done in blocks of eight bits called “bytes”. A byte full of “1’s” is 11111111 which is the number 255. Counting “0”as a number, there are 256 different levels in full.
The greater the sampling speed, the greater the accuracy of the digital measurement.
Are all sensors analogue?
A microswitch, for instance detects whether a door or a window is open or closed. ON or OFF – truly digital…
Some analogue sensors are hybrids which have an Analogue to Digital Converter (ADC) built into them which transmits the analogue information in digital form to the digital system.
They are more expensive but more stable over long distances
A good example of a hybrid sensor is the DHT11 which measures Relative Humidity. A detailed explanation of how it works can be found here, but go to the SenseDHT app and then measure the temperature the temperature and relative humidity where you are located.
How does a digital system work?
A set of instructions – called algorithms – are created to tell the system how to collect the data and what to do with it.
The algorithms are re-written by programmers in a language that the system’s computer can understand, process, and implement.
Programming languages (code) have their own rules and syntax just like any normal language.
The programme, or code, contained within the computer for a specific task is called an app or application.
Programmers use software editors to create, edit, and install the apps.
Software editors come in two basic forms.
- Visual editors, which use blocks like jigsaw pieces. These blocks contain lines of code which totally define what needs to be done i.e Print
Can the Kookaberry store data?
It will store measured values over time in a little semiconductor memory chip on the board. It operates just like a USB drive.
This is called data logging.
These values can be transferred to a PC for later display, visualisation, and analysis.
Go to the Data Logging Tutorial to see how the Kookaberry measures and logs ambient light levels
Can the Kookaberry communicate?
Go to the Semaphore app for a simple and fun demonstration of transmitting and receiving data over a wireless network
It has a built-in radio which broadcasts data to any other Kookaberry within classroom range.
This data can be received and displayed by Kookaberries running apps designed to receive the data (eg, alarm events from the Alarm app or measurements from the range of SenseXX apps)
Kookaberies connected together in this way – or by leads between their connectors – form a digital network.
Do you have to know how to code to use the Kookaberry?
The apps it uses have already been coded, and you can select them through the menu on the screen.
That means that you can be measuring things, or controlling something, within a few minutes of switching it on and plugging in the peripherals.
Like measuring the temperature of a cooling dish of water using the SenseDS18 app.
What does the code look like?
Text-based programming language
This is the MicroPython text-based code for the FeedMe app which writes “Water Me” to the screen and then “Thanks” on exit.
It can be viewed and edited with the KookaIDE software editor.
Visual programme language
This is the visual programming MicroPtyhon code for toggling (turning on and off) the LED’s on the front of the Kookaberry.
It can be viewed and edited in the KookaBlockly software editor.