Saturday 22 November 2014

Super-Animal Soundcard. Make your own sounds !!

Summary: This post discusses a simple,inexpensive Sound Card that reads bar codes and is used to generate animal sounds from animal-trading cards provided through our local supermarket chain. The post shows how you can make your own bar codes to create the sounds without (or in addition to) the cards.

Intro:  Collectable cards are a favorite again (right).
Our local supermarket giant (Woolworths) has started giving away cards with purchases above a certain value.  Theses card have animal pictures, names, a "did you know ?" question and Question/Ans section.

A nice feature of these cards is they have a bar code on the back (see image below).  With a purchased card reader (AUD$6) the card reader makes the animal sound associated with the animal when the bar code is swiped through the reader.
Super-Animal card & Soundcard Reader


Our idea was, could we get the Sound Card to make a sound of an animal from a bar code that we created ?  We started by looking at all the bar codes lined up as shown below.  The bar codes all show a very similar pattern (try it if you have your own cards).  There are 13 bar code lines over a distance of 52 mm, so that the spacing between each line (called the pitch) is 4mm. 

 The first 3 lines are always very thin and the last  line is always fat.  These are typically referred to as START bits and STOP bits.  Combinations of thin and fat lines in between the start and stop bits tell the Sound Card what sound to play.  We started by using a black sharpie pen (from any stationary store or newsagent) to draw lines on thick card stock (around 220 gsm).  Thin paper generally doesn't work (see later for explanation).  If your very careful, you can get hand drawn lines to work, but the lines must be drawn very carefully.  Start by trying to copy the lines of an existing card that you have.  Some of our examples are below.

 We found it hard to make sounds consistently (all the time) with hand drawn lines.  So we created a template which you can download and print on thick card stock (~200gsm, again available from stationary stores an some newsagents).  Be sure when printing that you do not select "Fit to page".  You must print the original size of the bar code pitch will change.  When we used this template to create new bar codes, the results were much better. 

Things to try:  Randomly make some of the lines thicker between the start bit (3 first thin lines) and stop bit (thicker line on the end).  If it makes a sound, then try to find the corresponding card from your collection.  BETTER STILL, we'd love to hear from any one who has found a bar code that makes a sound  that does not belong to any card !  Some software programmers often put these special bonuses into their programs and call them "Easter Eggs".  They are most often found on CD's or DVDs, but I'm interested to know if there is an Easter Egg on the Sound Card reader.
Template for creating your own bar codes (use the pdf provided).  The bar codes must be printed on thick (200gsm) card stock to activate the switch in the Sound Card (see How it Works below).  The template contains the correct spacing of lines. Tthe 3 start line and stop line should not be altered when you make your own.

How it works 

The image below shows a card in the Sound Card reader, with the back of the Sound Card open. 
Figure:  Center - Opened Sound Card showing the on/off switch and bar code Sensor (operational detailed in image below).  To the left, larger image of the Switch and Bar code sensor, To the Right - larger image of the memory chip containing all the sounds.
As the card passes down the reader, it presses against a micro-ON/OFF switch (see below in more detail).  This turns the Sound Card on only when the card slides down the reader, and means that the batteries are not wasted when the Sound Card is not being used.  It's also the reason you need to use thick card stock (200gsm) for the bar code paper, as  regular paper is too light and will not push hard enough on the switch to turn it on.  After the micro-switch turns the Sound Card on, the bar code passes by a Bar Code Sensor.

 This Bar Code Sensor consists of a light source (called an LED which stands for light emitting diode) and a light source detector.  The LED emits infrared light (IR=infrared).  The IR light is invisible to your eyes but some cameras can see this light - ask your parent/guardian to try using their phone camera to see the light just as the card passes the sensor (it's a very weak light).  Also use the phone to see if your TV remote control is working (they use the same wavelengths) - i-phones may not work to view this light as some use a filter to block this wavelength of light.  An illustration of how the bar code sensor works is shown below [Source].  When the IR light (from the LED) passes by a white section of the card, the detector sees the reflected light and reads this information as the code "1".  When the light strikes the black portion of the card, no light is bounced off the card, so the detector sees no light, and reads this as a "0". 
Source: http://abhitechstrong.blogspot.com.au/2013/01/basic-electronics-project-5-making-ir.html
Figure : Illustration of the LED (IR transmitter) and detector (IR receiver).  IR stands for Infrared and means that you can't see this light with your eyes (however some digital cameras can see this light) - Image Source
    So when the whole card is swiped past the Bar Code Sensor in the Sound Card it reads a code like 11101101001100101011111.  It then looks this code up in a list (often called a database) where it finds the correct sound for the animal.  An example list I made up is shown to the left (the codes are not correct). Using the code the brains in the Sound Card looks up and finds the correct animal/Sound from the list and then plays that sound. 
In the figure above which shows the opened Sound Card, the brains of the Sound Card (a small microcontroller) is covered up by this blob of black goop.  Manufacturers use this goop to cover up he part numbers to reduce the chance of someone reverse engineering the technology.  Actually, all the sounds (stored in the database) will be stored in the 8-pin chip (25L1605D) shown on the right of the image above (next to the opened Sound Card).  This is a 16M-Bit CMOS serial flash (technical datasheet).

 Let me know if you find any easter eggs using your own bar codes, or if you have any ideas on how you might use this Sound Card differently.  A great learning experience for AUD$6.  Please ask a parent or guardian before doing anything like taking the Sound Card apart.

NEWSFLASH:  We've recently found that Card #15 (Grater One-Horned Rhinoceros) makes what we think is a bird sound and the Southern Cassowary (Card #33) makes a grunting sound.  Did Woolworths mix these two sounds up in the soundcard reader (market name SoundKard) internal data base ? I suggest checking other cards for inconsistencies otherwise you or your children could grow up with a very distorted view of how animals sound.!!  Let me know if you find any other errors in these cards.

Adrian





Monday 4 August 2014

New term -6&7s

Last term I was very impressed by the years 3-5 efforts in Scratch with one student able to  to talk to an Arduino. This term the yeas 6&7s have blow me away with both their enthusiasum and their ability to quickly learn the basics of Scratch.  At least 2 students have moved straight onto programming Arduinos.  We are using a computer club book to keep track of each weeks tasks and what each student has completed.  This will help me as well as the students look back and see how much they have learnt.  It also keeps a record of the tricks they have learnt to solve complex problems.  Please ensure you work at this a little bit each week to develop your skills.

This week's task which I pasted into the Student Journal is to create the game of PONG.  The assignement is:

  1. Cretae a ball (centered) and 2 blocks on the left and right  to use as bats (example shown)
  2. Start the ball moving left to right when the space bar is pressed. If the ball does not hit your block, then the ball is lost off screen. Move left block up/down using [Q,Z] keys,move right bat up/down using [up arrow, down arrow].

Extra things to do:

  1. Add a score – you get a point in the other player misses
  2. stop the blocks (bats) moving off then screen when moving up and down.
  3. Add a random angle to the ball after it hits the bat to add difficulty to the game
  4. When the ball strikes the bat, make sound “pop” and return the ball (like tennis).
  5. Change service (ball goes in the other direction when space bar is hit) if you loose (miss the ball)

Sunday 1 June 2014

Monday 26th (4th Meeting)

This week we discussed how to turn the sprite around in Scratch.  To achieve this we need an understanding of the concepts of how a circle can be broken into 360-degrees - think of how a clock is divided into twelve and that after we rotate once, we are back at 12 again.  If we breake the cricle into 360 small sections we call each of these sections degrees (see the image).


If we want to go right we need to point in the direction of +90.  If we want to go up we need to point in the direction 0 (or 360).  More importantly, if we want to point in a direction say between up-and-right (on a compass called NE) we would point in the direction of 45 degrees.  We can use any angles of degrees to point in any  direction we choose. 


This week we also said that we would see some students Scratch programs at the next meeting (on the 9th June).  So if you have not got an account yet, best talk to your parents about setting one up so you can practice and save your projects.

Thursday 22 May 2014

Monday 19th May (3rd Meeting)

This Monday we discussed how we can use the backdrop "XY GRID" in scratch (see image) to help understand how to move a character around
the screen using either the "goto" or "glide" blocks.  We discussed that moving requires use to use a number-line. The center of the screen is zero and moving to the right of the center uses positive numbers - we call this axis the X-axis.  To move to the left, we extend the concept of the number line to negative (minus) numbers, so that any negative numbers move the chaarcter to the left of the center.  We can further extend this concept in the up and down direction by rotating the number line in the up-down directions - postive number move us up, while negatve numbers move us down.  We call this the Y-axis.  This concept of a X annd Y axis (cartesian corodinates) is very powerful and is used not only for computer programing but for mathematics, engineering and geograpical sciences (for spaital analysis) .

Keep thinking about what kind of game or story you might create and try some programming to move your character around is a specific way.  Next week will will discuss how rotation works..

Monday 12 May 2014

Building stories in Scratch (2nd Meeting -12 May)

12 May meeting.
Today we discussed what kind of game or project in Scratch we might make.  The idea is for students to create/storeyboard backdrops, characters, sounds and actions that might be used.  We can then look at how to achieve these goals in Scratch.  There is considerable breath in the skills of the students and lots for them to teach each other.

Some students have been using Scratch for some time and are very proficient at it.  For these student I will look at introducing the Arduino microcontroller and it's programming language (based on C).  For those really interested, follow the (windows) installation instructions for the Arduino here (if you haven't mastered Scratch yet I wouldn't try this yet).  Locally you can pick up an Ardiuino from Jaycar for ~AUD$40.  They are avaiable online (overseas) for around half this price - I will bring in some arduino boards (unos) next week for us to look at.

Keep programming :)

Sunday 11 May 2014

Update from 5th May (1st meeting)

Late update - last week (5th May) was our first official meeting.  It's clear many of the students have some advanced programming skills in Scratch and I'll be looking at some attactivities to push them.  The club is all about peer assistance, so as much as possible I'm trying to get the kids to learn from each other and share experiences.  I know some of the students want to show off what they have created, so I will fit in a time every 3 weeks or so for the best scratch project to be demonstrated to the club.  Hopefull this will allow everyone to understand each other's skills and to have ideas shared arround.  This week I'm hoping to discuss a concept each student can focus on, to make them ask "how do I do that in Scratch".  We'll try to discuss story boarding, backgrounds, characters and their abilitites.

I visted the first CoderDojo of the year at UWA this weekend.  This is a forum for teenagers to learn abotu programming (Scratch, HTML, Python).  I was happy to see that our format and the skills of some of our students are competitive with what's being done for students at the secondary school level.

For those at home: If you're following along with this blog and can't attend the club, think about a game you might want to make,  where is it set - draw out the setting on paper if you wish (you can later scan this image and upload to use as a background).  Think about you character - what do they do (shoot, hug, skip)... What sounds are made (bang, burp, meow) and what's the aim of the game ( get the aliens, find the easter eggs anything).  Once you have these ideas, we can think about what scratch can do to make it happen.  As much as possible we want to make our scenes,characters and sounds ourselves.  This is fun and avoids copyright issues - especially for those who are keen on "selling" their game:)

Wednesday 9 April 2014

Great kickoff meeting today.  The kids were lining up at the door.  We discussed:
  • What do you (the students) want to get out of this group ?
  • What is a robot ?
  • What is programming - example of scratch ?
I really appreciate the student's enthusiasm and the diversity of their interests

Over the break students are encouraged to try out the Scratch tutoral - Click the CREATE tab at the top and run through the 13 steps to your first program.  Please supervise your children whenever they go online.  Once the tutorialis completed, I suggest you sign up (Join Scatch button). You need to join Scratch to have any programs you create saved.  Joining requires a parent as the process required an email address.  When signing up 1) please do not use your last name as a user name 2) chose a password your child can remember.  If you have trouble remebering passwords, I suggest using a password manager such as KeePass (free).  All the tools I will use in this forum are open source applications, so they won't cost you anything but time.

Other points:
  • This blogg is the first port of call for discemmination of information.  Please provide me with feedback.  This is my first blogg so I may miss some posts before I figure it out so stay with me.
  • If I use words you don't understand, please let me know
  • I suggest students use a bound note book for this group to keep all their notes in one place (especially once we start storey boarding)
  • Programming required screen time - I suggest asking students to trade off existing screen time, that is, program instead of TV, gaming (phone, Tablet, console) or other.  I hate the idea of adding more screen time to our lives.  Scratch is also avaiable to run on a Tablet so consider programming in the park.  
  • Some degree of just trying stuff out is required by stduents to understand what this programming thing is all about.  However, eventually, students should write out their concepts in a flow chart before sitting down to program [idea to self - spend a day on learning about flow charts]
  • Please use only first names [never last names] in posting comments and do not identify the location  of the group
The next meeting with students will be the Monday 5th May (2nd week of term 2).



Thursday 3 April 2014

Possible syllabus

Here is a brief idea of some of the material I may cover.  This will largely be dictated by the skills and knowledge base of the group.  Material to cover may include:
  • What is a robot ?
  • Introduction to programming
  • Scratch - Intro  
  • Scratch -the 2D Number line (Cartesian coordinates)
  • Scratch - loops
  • Scratch - Events
  • Scratch - Designing a Game - Story boarding to coding
For the older in the group:
  • Introduction to controlling the world - The Arduino
  • Intro to C & The Arduino
  • Affect the world - blinking lights
  • Sense the world - sensing an input
  • Arduino - Designing code to turn on/off different lights
  • Copying the world -3D design
  • 3D printing - starting with 2D
  • 2D slicing - create 3D art from 2D slices

For these who want to be pushed:
  • How motors work - measuring speed and turning power (torque)
  • Gears and how they work
  • A basic robot - where motors and gears come in
  • Talking to the Robot with an Arduino
  • Talking to the Arduino with a Computer
  • Putting it all together

Saturday 29 March 2014

What this Blog about

Blog Under Construction from - 30 March 2014
Expected Live date - 1 May 2014