STEM@Central Singapore 2017 STEM KIT

Getting Started

The STEM Kit provided for this year's STEM programme is based on the Arduino Nano.

You will need to download 2 things. The IDE in which to begin programming the Arduino, and the driver so that you can talk to it.

Download and Install the following:

Soldering The Kit

We've provided a soldering kit with parts consisting of the following electronic modules:
  • Neopixel RGB LED module
  • Piezo Buzzer
  • Push Button
  • Servo Motor

Soldering is easy! Download this comic book here and find out how!

You will need:
Soldering Iron, Solder Lead, Tweezer, Desoldering Pump

Quick Tip!

Refer to this image on what to solder first!

Here's how your completed board should look like.

Slot in your RGB LED module, plug in your Arduino Nano and USB cable and you're all set to start.

The STEM Kit board comes with the following electronic peripherals at these pins.

PIN ComponentRemarks
13Arduino LEDOUTPUT
9Servo MotorOUTPUT
6BuzzerOUTPUT
7Push ButtonINPUT
8RGB 

Here are some sample codes for you to get started.

Sounding the Buzzer

                    int I;
                    void setup() {
                       pinMode(6, OUTPUT);  //Buzzer

                       //beep once
                       for (I = 0; I < 2000; I++) {
                          digitalWrite(6,HIGH); //turn on the Blue LED
                          delayMicroseconds(250);
                          digitalWrite(6,LOW); //turn off the Arduino LED
                          delayMicroseconds(250);      
                       }
                    }
                    void loop() {
                    }

                    

Making a shooting sound

                    int I;
                    void setup() {
                       pinMode(6, OUTPUT);  //Buzzer

                       //Shooting sound?
                       for (I = 150; I < 400; I++) {
                          digitalWrite(6,HIGH); //turn on the Blue LED
                          delayMicroseconds(I);
                          digitalWrite(6,LOW); //turn off the Arduino LED
                          delayMicroseconds(I);      
                       }
                    }
                    void loop() {
                    }

                    

Using the RGB

When using the RGB, include the Adafruit NeoPixel library in your code
Example:

                #include <Adafruit_NeoPixel.h>
                #define PIN 8
                Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);

                #define RGB_Display(R,G,B) \
                  pixels.setPixelColor(0, pixels.Color(R,G,B)); \
                  pixels.show();

                void setup()
                {
                  pixels.begin();
                  pixels.show(); // Initialize all pixels to 'off'

                  RGB_Display(100,0,0); //Red
                  delay(250);
                  RGB_Display(0,150,0); //Green
                  delay(250);
                  RGB_Display(0,0,80); //Blue
                  delay(250);
                  RGB_Display(0,0,0); //Turn the RGB off
                }
                void loop() {
                }

                    

Getting input from the push button

            void setup()
            {
              pinMode(7, INPUT); //push button
              Serial.begin(9600);   
            }
            void loop() {
              if ( digitalRead(7) == 0)
              {
                Serial.println(“Button Pressed.”);

                while (digitalRead(7) == 0) { 
                  //wait for the user to release the push button
                }
              }
            }

                    

Serial Communication – Getting data

            int RxData;
            void loop() {
              RxData = Serial.read() ;
              if (RxData != -1) { //not equal to 
                if (RxData == 97) { //”a”
                  //turn on LED
                  digitalWrite(13, HIGH);
                }
                if (RxData == 98) { //”b”
                  //turn off LED
                  digitalWrite(13, LOW);
                }
              }

                    

Go beyond the kit!

Try out breadboarding or some of the projects seen here