Picture of Sparkfun RedBoard

Computer Club – Introduction to Arduino

On Tuesday, March 6, 2018, the Computer Club met formally beginning our Spring meetings.  Each member of the club worked with a SparkFun ReadBoard.  The RedBoard is programmed with Arduino and looks and acts very much like an Arduino Uno.  In fact, when uploading our programs to the RedBoard we tell the Arduino IDE the board is an UNO!

The programs we write are called Sketches.  For our first sketch, we used the example program called “Blink.”  Blink is a program that causes an LED to turn on and off.  The Blink program for Arduino is like a “Hello World” program we might write when trying out a new programming language.  Since there is no built-in display, we use the LED to show that we can make the Arduino “output” something.

Picture of Ardunio Sketch

Our programs for Arduino are called Sketches. Pictured is the sketch to cause an LED to blink.

After uploading our sketch and seeing the result, the blinking LED, we tried changing the delay line to see how that affects the rate of blinking.   We also saw that the LED is labeled with a 13 next to it.  This 13 represents the PIN number the LED is connected to.  This 13 is the same 13 on the headers along the sides of the RedBoard.  Each student was issued an additional LED to connect to PIN 13 and Ground to demonstrate that is was, in fact, the same on the onboard LED.  We also learned that when connecting LEDs we should use resistors to limit the flow of current through the LED which can shorten the life.

Finally, we took a look at the code at http://km2arc.wpengine.com/introduction-to-the-redboard-and-programming/ , copied and pasted it into a new sketch.  This showed us how the serial monitor works,  demonstrated the difference between local and global variables and showed how the setup() and loop() functions operate.


mrcampbell / March 7, 2018 / Computer Club

Computer Club Meeting 10-24-2017

In our meeting today we wrote a program to get user input and then display that input on the console.  The following listing is an example of the program:

/*we include the stdio.h header file which contains the prototypes for
* the printf and getc functions

#include <stdio.h>

/*the main function is the entry point of our program
*when we execute our program this is where it starts from
int main(int argc, char** argv) {

    /*We create a variable type char to store our user input.
    *Our variable which we call  UserInput and we allocate 255 bytes of storage.
    char UserInput[255];

    /*Another variable called PlaceHolder.  This is an integer and we initialize it to 0*/
    int PlaceHolder=0;

    /*We prompt the user to enter his or her name*/
    printf ("What is your name? ");

    /*Now we enter the do loop.  We will get one character at a time until the user presses return*/
        /*the getc  function reads one character at a time
         * We store that charcter in UserInput at the position indicated by
         * Placeholder

         /*We increment placeholder by 1 so that the next call
         * to getc stores the result in the next position

    /*We have to use PlaceHolder-1 in the line about to check for return
    *This is because we already increased PlaceHolder for the next position which we have
    *not read in yet.

    /*Now we display Hello and what the user entered at our prompt
    printf("Hello %s",UserInput);

    /*The program is complete*/
    return 0;

mrcampbell / October 24, 2017 / Computer Club

Robot Arm Progress and Servo Testing

At today’s meeting of the Intermediate / Advanced group of Computer Club we began testing servos and controlling the movement of part of a robot arm using the Arduino microprocessor.  Our teams were successful in moving the servo and arm from 0 degrees to 90 degrees and then 180 followed by a sweep back and forth.


mrcampbell / October 14, 2016 / Computer Club

Computer Club Update October 12, 2016

Our computer club is off to a good start – even with the days off.  Our beginners have only had a chance to meet once but we are already moving ahead logging into our Linux server using our iPads and the Putty client on the computers in the computer lab and library.  Be sure to log in to the Computer Club Google Classroom for links and instructions.  

Our Wednesday intermediate group has begun preparing for building a 3D printed hand that will be controlled by servos connected to an Arduino and a glove with flexible sensors attached. At today’s meeting we looked at the parts we will be using.  We also looked at the source code we will use as a reference for reading the flexible sensor and controlling the servos.  

Our Friday intermediate / advanced group has started exploring the Pitop computer build assembling them.  Our next steps with the Pitop will include coding and using the GPIO headers in projects, including out robotic arm. 

For all of our computer club groups, as we work on our projects, think about what else we can do with what we are working on.  What can it be used for?  How can it be extended?  What improvements can we make?   

mrcampbell / October 12, 2016 / Computer Club

2016 – 2017 Computer Club Schedule

We have a big group this year for computer club and I am excited to start working on projects.

Our Latin School Computer Club Members will meet on Mondays at 3:00 PM in Room 215

Our High School Beginners group will meet on Mondays at 3:30 in the Library / Library Conference Room

Our High School Intermediate group will meet on Wednesdays at 3:15 in the Library Conference Room

Our High School Advanced group will meet on Fridays at 3:15 in the Library Conference Room

We will hold general meetings on Tuesdays as needed.

All members should make sure they have joined the Google Classroom.  If you have an iPad, please be sure you bring it to our meetings!


mrcampbell / September 23, 2016 / Computer Club

Welcome Back!!

The 2016-2017 school year has begun!  We will hold our first meetings of the school year as follows:

Computer Club will meet on Tuesday 9/13/2016 at 3:15 in the library conference room.

Amateur Radio Club will meet on Thursday 9/15/2016 in the library conference room.

If you would like to sign up for either club and can’t make either of those meetings, please see Mr. Campbell by Friday 9/16/2016.  You will need to attend meetings and participate in club activities to receive credit for these clubs.


mrcampbell / September 10, 2016 / Computer Club, KM2ARC

Arduino to detect Valid Audio from Bridgecom Repeater

We are using a Bridgecom Repeater that we wanted to try linking to another site.  Based on the documentation we used the DB25 port on the back of the repeater to get audio in, audio out and trigger the PTT through use of a Signalink  USB.  We found out that the repeater audio output emits all audio regardless of whether or not it had a valid PL tone (CTCSS).

Pin 17 of the DB25 port of the repeater is documented as COS (Carrier Operated Switch).  We found that the pin outputs random voltages until a valid signal is detected at which point the voltage drops to zero.  Using analog pin 0 of the Arduino we read the voltage.  Once the voltage is 0 we turn on the relay which causes audio to pass through to the Signalink.

Here is a diagram of our wiring:

Bridgecom Repeater COS Detector

Click on image to enlarge.


Below is the code we are currently running to implement this operation:

//Connect pin A0 to Pin 17 on repeater
//Connect Ground of arduino to ground of repeater
//When sensor is 0 key radio

const int analogInPin = A0; // This is the COS output on the repeater.
int sensorValue = 0; // value read from the pot

const int relayPin = 2; //This relay is used to connect the audio output of the repeater to
//Audio input on the computer.

void setup() {
     // initialize serial communications at 9600 bps:
     Serial.begin(9600); //We will use the serial line to debug this program
     pinMode(relayPin, OUTPUT); // set pin as an output

void loop() {
     // read the analog in value:
     sensorValue = analogRead(analogInPin);
     // map it to the range of the analog out:
     // change the analog out value:

     Serial.print("sensor = ");
     if (sensorValue==0){ //When the value goes to 0 that means a valid signal is detected.
          Serial.println("Relay On");
          digitalWrite(relayPin, HIGH); // turn the relay on
          do{ //Keep the relay on until the the COS is not 0
     digitalWrite(relayPin, LOW); // turn the relay off


mrcampbell / July 20, 2016 / Computer Club, KM2ARC

Computer Club Addendum for Meeting on 5/10/2016

At our meeting on 5/10/2016 we went through our presentation on installing the Java Development Kit and Netbeans.  After installing the we went through the creation of our first Java program “Hello, World” within the Netbeans IDE.

A question came up as part of the meeting.  What happens when we want to execute on a mac?  This was after we demonstrated executing a program on the Windows command line and how you would do the same in a Mac shell.  To execute one a Mac hit the command+space bar keys to start Spotlight Search.  Then type terminal and press return.  Once in terminal go to the location of your jar file and type java -jar [name of jar file].

Remember to “Clean and Build” from the run menu (or shift+F11) to create the dist folder with the jar file.

mrcampbell / May 10, 2016 / Computer Club

Thermometer Project

Our ongoing project is to build a weather center.  We have discussed the many components involved with creating a weather center.  Now let’s start experimenting with the components we already have available to us.

Using our Sparkfun Inventors Toolkit we will use our potentiometer, LCD Display, and the TMP36 to build a thermometer.

Here are the parts and their use:

  • The TMP36 is used to measure the temperature.  Read more about the TMP36
  • The LCD Will be used to display the temperature in both Celsius and Fahrenheit.
  • The potentiometer is used to control the contrast of the LCD

The first step is to set up your RedBoard and breadboard (note: the Redboard is equivalent to the Arduino UNO for our purposes).  Please use the following diagram to help you connect your components.  Click on the picture to open a larger copy:

Connections for Thermometer Project

Connections for Thermometer Project

Next copy the following code into a new Arduino sketch.  (hint: highlight code from the bottom up to prevent the line number from being copied)

/*Kellenberg Memorial High School Computer Club
 * TMP36 and LCD 
 * The following code is used to read the temperature using the TMP36 sensor
 * and display it on an Liquid Crystal (LCD) display
// include the Liquid Crystal (LCD) library code:
#include <LiquidCrystal.h>

//TMP36 on Analog pin 0
int tmp36=0;

// initialize the LCD library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
 // set up the LCD's number of columns and rows:
 //Our LCD has is 2 rows of 16 characters
 //lcd.begin initializes the library for our LCD
 lcd.begin(16, 2);

void loop() {

 //First we will read voltage the tmp36 sensor. the 
 //variable tmp36 = 0 for the analog pin it is
 //connected to. 
 int input0=analogRead(tmp36);

 //convert the reading to voltage 
 //This formula converts the number 0-1023 from the ADC into 0-5000mV (= 5V)
 //voltage = (input*5.0)/1024
 float voltage=input0*5.0;

 //converting from 10 mv per degree with 500 mV offset
 //to degrees ((voltage - 500mV) times 100)
 float tempCel=(voltage -.5) * 100;

//now we can convert celcius to fahrenheit
 float tempFar = (tempCel * 9.0 / 5.0) + 32.0;

//Set the LCD to the top line first position (0,0)
// (position,line)
//display the temperature in degrees centigrade
 lcd.print("Temp (c) = ");
//set the LCD cursor to the next line first position (0,1) 
// (position,line)
 lcd.setCursor(0, 1);
//display the temperature in degrees fahrenheit 
 lcd.print("Temp (f) = ");
//wait for one second to keep the display from flashing
 delay (1000*1);

Once you have copied and pasted the code, compile it and upload it to your RedBoard.

mrcampbell / February 15, 2016 / Computer Club, Computer Club Projects

Computer Club Meeting 1-5-2016

Club Member Paul Bartolemea (2020) Drew our initial flowchart.

Club Member Paul Bartolemea (2020) Drew our initial flowchart.

At today’s meeting we discussed our long term project.  The project proposals included either a activity tracking device or a weather station.  The club members voted for building a weather station.

Our next steps are to identify the initial specifications of the weather station.  We discussed incorporating the following features:

  • Temperature
  • Humidity
  • Barometric Pressure
  • Tides
  • Wind Direction
  • Wind Speed
  • Earthquake Detection
  • Daylight
  • Precipitation
  • Probability of Rain or Snow
  • Position of the Earth Relative to the Sun

For our hardware development platform we discussed using the Arduino Mega and Raspberry Pi.  We would like to log data from the station in a database and eventually present live and historical data from the station on the web.

A feature of the web presentation will include a live video.

For power of our station we will look at using solar power with a battery for night and times when there is not enough sunlight to power the station.

mrcampbell / January 7, 2016 / Computer Club