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 = ");
     Serial.println(sensorValue);
     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
               delay(500);
          }while(analogRead(analogInPin)==0);
     
     }
     digitalWrite(relayPin, LOW); // turn the relay off
     delay(2);
}

 

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;
 voltage=voltage/1024;

 //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)
 lcd.setCursor(0,0);
//display the temperature in degrees centigrade
 lcd.print("Temp (c) = ");
 lcd.print(tempCel);
 
//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) = ");
 lcd.print(tempFar);
//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

Computer Club Meeting Notes: 11-03-2015

Today we will be working on the Button Project.  This Project led us to the “Guess What Number I’m Thinking” project.  Keep in mind that in the Guess What Number I’m Thinking project the Arduino will select a number from 1 to 4 and using the 4 buttons you will attempt to guess what number the Arduino has thought of.

The following is a diagram for how to wire the Arduino and components for this project:

Project 5 - Push buttons Diagram

The code for the project is as follows:

/*
SparkFun Inventor's Kit
Example sketch 05
http://www.sparkfun.com/
This sketch was written by SparkFun Electronics,
with lots of help from the Arduino community.
This code is completely free for any use.
Visit http://learn.sparkfun.com/products/2 for SIK information.
Visit http://www.arduino.cc to learn about the Arduino.
Version 2.0 6/2012 MDG
*/

// First we'll set up constants for the pin numbers.
// This will make it easier to follow the code below.

const int button1Pin = 2; // pushbutton 1 pin
const int button2Pin = 3; // pushbutton 2 pin
const int ledPin = 13; // LED pin

void setup(){
      // Set up the pushbutton pins to be an input:
     pinMode(button1Pin, INPUT);
     pinMode(button2Pin, INPUT);
     // Set up the LED pin to be an output:
     pinMode(ledPin, OUTPUT); 
}


void loop(){
 int button1State, button2State; 

 // Since a pushbutton has only two states (pushed or not pushed),
 // we've run them into digital inputs. To read an input, we'll
 // use the digitalRead() function. This function takes one
 // parameter, the pin number, and returns either HIGH (5V)
 // or LOW (GND).

 // Here we'll read the current pushbutton states into
 // two variables:

 button1State = digitalRead(button1Pin);
 button2State = digitalRead(button2Pin);

 // Remember that if the button is being pressed, it will be
 // connected to GND. If the button is not being pressed,
 // the pullup resistor will connect it to 5 Volts.

 // So the state will be LOW when it is being pressed,
 // and HIGH when it is not being pressed.
 
 // Now we'll use those states to control the LED.
 // Here's what we want to do:
 
 // "If either button is being pressed, light up the LED"
 // "But, if BOTH buttons are being pressed, DON'T light up the LED"

 if (((button1State == LOW) || (button2State == LOW))&&
 !((button1State == LOW) && (button2State == LOW))){

       digitalWrite(ledPin, HIGH); // turn the LED on
 }
 else
 {
       digitalWrite(ledPin, LOW); // turn the LED off
 }
 
}

mrcampbell / November 3, 2015 / Computer Club

Computer Club Meeting 10-27-2015

Here is the wrap of our meeting from 10-27-2015.  We reviewed our projects to date and looked at the projects we will be taking on in the next couple of weeks.

  1. Next week we will be working on the “Button Project”
  2. After the “Button Project” we will work on the “Guess the Number Project”
  3. We have two problems to solve:
    • lqef ef s fehzwa fgpflelglevt oezqak. dwsj ef tvm_jv_fejt_gz_sti_iv_lqa_kasw_oqswwatjaf
    • x = raw_input("enter the password");
      y = ""; 
      for c in x: 
               y += chr(ord(c) ^ ord(" "));
      if y == "nottherightcase":
               print "congratz the flag is "+y;
      else:
               print "nope";
      

       

For our second problem, the language is Python.  Go to http://www.asciitable.com/ for an ASCII table.

and remember ^ = bitwise exclusive or

Computer Club Update 10-27-2015 -> This is the presentation that was used in the meeting.

mrcampbell / October 27, 2015 / Computer Club