BITE SIZE ARDUINO – PIEZO BUZZER

Today we will have a look at how to connect a piezo buzzer to an Arduino and how to generate different audio signals with it. A piezo buzzer is a audio signalling device, it is the most basic electronic component by which to generate sounds at different frequencies.

A piezo buzzer has 2 connection terminals, one is connected to GND and the other to a PWM digital pin, for this example we will use pin 3.

piezo_bb

We will use the tone() function to generate tones at different frequencies, for an Arduino Uno the frequency rage is between 31 and 65535 Hz. Please note that the possible min and max frequencies differ between different models of Arduino boards. The tone() function takes 3 parameters, firstly the pin to use, then the frequency to use and lastly the duration to generate the tone in milliseconds.

Here is the code used:

#define PIEZO_PIN 3

void setup()
{
}

void loop()
{
     tone(PIEZO_PIN, 31, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 15000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 30000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 45000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 65535, 1000);
     delay(500); // Pause between Tones 
     noTone(PIEZO_PIN); // Silence Tones
     delay(500);
}
BITE SIZE ARDUINO – PIEZO BUZZER

Why Collect Retro Video Games?

games

I often get asked why I collect Retro Video games. Some people I have met find it bizarre that anyone would want “old” video games as they think anything other than the latest and greatest systems are simply junk that should be thrown away.

The reasons why people collect anything differs greatly, however I think it is safe to assume that anyone who collects something has some form of personal connection to the items being collected. For me personally video games are something I grew up with and I believe a large part of the reason I collect is an element of nostalgia. Many items in my collection reminds me of fond memories when I was a child; I believe this is a reason why many people collect a variety of things, the items act as a keep sake of a time period in someone’s’ past that they have a favourable connection with.

I also believe there is an element of unfulfilled childhood wish fulfilment when it comes to collecting; getting things you wanted as a child but could never have. This is a common reason for collecting video games that I have heard from many collectors.

On top of all these reasons I also collect video games because I love them. I enjoy playing them and I also play and collect current gen video games, not just retro. In my opinion video games are a form of art, how can anything created with such passion and talent not be. Only in very recent times have video games started to receive some of the recognition associated with being an art form, but this has come too late for enormous amounts of items that have been branded as trash and ended up in landfills. That is why many collectors of video games see themselves as curators; saving something they love from ending up in a dump and being lost forever.

I take a great deal of pleasure in owning and adding to my collection, and also to play and experience the games therein, be that a latest release or a game that is 25 years old in the same way that someone may listen to modern and classical music and appreciating both for what they are.

So why do I collect video games? And why do some people collect toys or records or comic books or anything really? Because of a love for something, be that video games or toys or comics books or something completely different.

Competition!

So I have another PS3 download code to give away! This time it is Sly 3: Honor Among Thieves. So get your comments in before 31 October 2015 to stand a chance to win!

Why Collect Retro Video Games?

BITE SIZE ARDUINO – RGB LED

A RGB LED is a LED that can change the colour of the light it produces depending on which of the LEDs’ Connectors have current flowing through them. The LED has 4 connectors, one connector for red, one for green, one for blue and then finally an anode or a cathode, depending if the RGB is a common anode or cathode LED.

So what is the difference between common anode and common cathode?

Well a RGB LED is actually a combination of 3 LEDs, a red LED, a green LED and a blue LED. All LEDs have 2 connectors, an anode and a cathode. So depending how these LEDs are connected together determines if they share an anode or a cathode, thus common anode RGB LED or common cathode RGB LED. The Anode\Cathode leg can be identified as it is the longest leg on the LED. Below are 2 diagrams that illustrates the difference discussed.

Common Cathode:

Common Cathode_schemCommon Anode:

Common Anode_schem

How these 2 different RGB LEDs are connected to a circuit also differs, let us first have a look at a circuit that contains a common cathode RGB LED:

common cathode arduino_bb

Here is the code used with this circuit:

int redPin = 9;
int greenPin = 10;
int bluePin = 11;
 
void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
}
 
void loop()
{
  setLEDColour(255, 0, 0);  // red
  delay(2000);
  setLEDColour(0, 255, 0);  // green
  delay(2000);
  setLEDColour(0, 0, 255);  // blue
  delay(2000);
  setLEDColour(255, 255, 0);  // yellow
  delay(2000);  
  setLEDColour(80, 0, 80);  // purple
  delay(2000);
}
 
void setLEDColour(int red, int green, int blue)
{
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

Now let us have a look at a circuit that contains a common anode RGB LED:

common anode arduino_bb

Code used with this circuit:

int redPin = 11;
int greenPin = 10;
int bluePin = 9;
 
void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
}
 
void loop()
{
  setLEDColour(255, 0, 0);  // red
  delay(2000);
  setLEDColour(0, 255, 0);  // green
  delay(2000);
  setLEDColour(0, 0, 255);  // blue
  delay(2000);
  setLEDColour(255, 255, 0);  // yellow
  delay(2000);  
  setLEDColour(80, 0, 80);  // purple
  delay(2000);
}
 
void setLEDColour(int red, int green, int blue)
{
  red = 255 - red;
  green = 255 - green;
  blue = 255 - blue;

  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

Although the circuits and code differ between the 2 types of RGB LEDs, the end results are exactly the same.

Try changing the values passed into the setLEDColour function to see what different colours can be created.

BITE SIZE ARDUINO – RGB LED

Book Review – The Legend of Zelda Hyrule Historia

The Legend of Zelda Hyrule Historia is a very high quality collectors’ book published by Dark Horse in collaboration with Nintendo. 

Hyrule

The book itself is absolutely beautiful, it is clear that a great deal of effort and care was taken in the creation of the book. The book is bound in a dark green hard cover and even looks like something straight out of one of the Legend of Zelda games. Regarding content, the book is a hybrid between an art book and an information guide and contains a vast amount of amazing artwork as well as detail on every single character (including all the enemies), item and weapon from the Legend of Zelda Games. 

One of the treasures contained in this book is an official timeline of the Legend of Zelda games, showing how the games are linked together. Prior to this book Nintendo has never officially explained how the games are linked and for a lot of Zelda fans this was a very big frustration. 

The Legend of Zelda Hyrule Historia is an example of a game tie-in book done right and will form an amazing addition to any Legend of Zelda collection. I cannot stress enough how beautiful this book is and would highly recommend it to any fan of the Legend of Zelda. 

Book Review – The Legend of Zelda Hyrule Historia