Maker’s Shield

Introduction-

Gizmotz Maker’s Shield is a kick starter for a beginner to learn embedded system programming in Arduino environment and understanding how to interact with physical world using various sensors and actuators.

makes1

It helps one to learn the basic protocols like digital and analog input and output, generating various LED patterns, buzzer tones, sensing the ambient light, using potentiometers, controlling an output with buttons and all this without getting messed up with wires and arranging the circuits over breadboards. Just fix the shield over the Arduino Uno board and start playing with it.

Description:-

This shield contains-

  • Six independent LEDs (at pin no. 6, 7, 8, 9, 10, 11) – These are there to practice basic output control with a microcontroller and generating various light patterns with LEDs.
  • Two independent push buttons S1, S2 (at pin no. 4, 5) – These facilitate digital input at pins 4, 5. These can be used to perform different tasks on press of different buttons.
  • Two independent potentiometers (at pin no. A0, A1) – This can be used to observe how ‘analogRead(pin)’ value changes with change in voltage at the pin.
  • A buzzer (at pin no. 3) – This can generate tones of a wide range of frequencies. It uses tone function provided in Arduino’s library.
  • A calibrated ambient light sensor (at pin A2) – A LDR (Light Dependent Resistor) is there to sense light intensity in its ambiance whose output can be taken at analog pin A2 using analogRead(A2) function of Arduino library.
  • Sample code for the components over the Maker’s Shield-

    /*Program to control LEDs’ glowing pattern with switches on the shield*/

    int s1=4,s2=5; //define switches’ pins
    int L1=6,L2=11,L3=10,L4=9,L6=8,L5=7,b1=3; //define LEDs’ pins, buzzer pin
    boolean button1=0; //variable to hold switch1 value
    boolean button2=0; //variable to hold switch2 value

    void setup()
    {
    //setting switch pins as input
    pinMode(s1,INPUT);
    pinMode(s2,INPUT);

    //setting led pins as output
    pinMode(L1,OUTPUT);
    pinMode(b1,OUTPUT);
    pinMode(L2,OUTPUT);
    pinMode(L3,OUTPUT);
    pinMode(L4,OUTPUT);
    pinMode(L5,OUTPUT);
    pinMode(L6,OUTPUT);
    Serial.begin(9600);
    }

    void loop()
    {

    //read the status of switches
    button1=digitalRead(s1);
    button2=digitalRead(s2);

    Serial.println(“Analog values are:”);
    int pot1=analogRead(A0); //get value of potentiometer
    Serial.println(pot1);
    int pot2=analogRead(A1); //get value of potentiometer2
    Serial.println(pot2);
    int light=analogRead(A2);
    Serial.println(light);

    //take decision according to switch condition
    if((button1==1)&(button2==0))
    {
    digitalWrite(b1,1);
    delay(100);

    digitalWrite(b1,0);
    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);
    delay(100);

    digitalWrite(L1,1);
    delay(100);
    digitalWrite(L2,1);
    delay(100);
    digitalWrite(L3,1);
    delay(100);
    digitalWrite(L4,1);
    delay(100);
    digitalWrite(L5,1);
    delay(100);
    digitalWrite(L6,1);

    delay(100);

    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);
    }

    else if((button1==0)&(button2==1))
    {
    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);

    digitalWrite(L6,1);
    delay(100);
    digitalWrite(L5,1);
    delay(100);
    digitalWrite(L4,1);
    delay(100);
    digitalWrite(L3,1);
    delay(100);
    digitalWrite(L2,1);
    delay(100);
    digitalWrite(L1,1);
    delay(100);
    digitalWrite(b1,1);
    delay(100);

    digitalWrite(b1,0);
    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);
    }

    else if((button1==1)&(button2==1))
    {
    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);

    digitalWrite(b1,1);
    delay(100);
    digitalWrite(b1,0);

    digitalWrite(L1,1);
    digitalWrite(L6,1);
    delay(100);
    digitalWrite(L2,1);
    digitalWrite(L5,1);
    delay(100);
    digitalWrite(L3,1);
    digitalWrite(L4,1);
    delay(100);

    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);
    }

    else
    {
    digitalWrite(L1,0);
    digitalWrite(L2,0);
    digitalWrite(L3,0);
    digitalWrite(L4,0);
    digitalWrite(L5,0);
    digitalWrite(L6,0);
    }
    }

    All the products displayed above can be purchased from following links:

    1. Arduino UNO R3
    2. Makers’ Shield

Comments