Thursday, September 8, 2011

Vernier Sensors and Arduino (or Teensy) for Data Logging

I've been thinking for a while about inexpensive data logging with Vernier educational sensors and a microcontroller development board. I played around with the TI MSP430 LaunchPad for a while, since it is only $4.30, but it's not quite as beginner-friendly as the Arduino. I eventually settled on the Arduino-compatible Teensy for its low price ($16) and small size.

Vernier does a good job of documenting sensor pinouts and calibration values in each sensor's manual, so I knew that this was a fairly easy project.

Unfortunately the sensors use a BT631A connector, which is difficult to find outside of the UK. I ordered this BT to RJ11 adaptor from DealExtreme, but unfortunately it's only 6P4C and we need 6P6C (6 conductors). All six pins are used by the sensor, but we really only need pins 2, 5, and 6. I'll try ordering something from UXCell or Vernier, but for now I've just used some breadboarding wires stuck into the back of the connector.

The required connections from the sensor are
pin 2 to ground (GND)
pin 5 to +5V (VCC)
pin 6 to an analog in (A0)
(I haven't gotten around to trying out the auto-ID function, but that's not an extremely useful function for my purposes anyway.)

Since this my first real microcontroller project, I followed the tutorials on the Teensy site regarding connecting something to the analog input. I modified some example code by Tom Igoe and came up with:

/*
 Analog input, serial output
 Reads an analog input pin and prints the results to the serial monitor.
 The circuit:
 Vernier probe pin 2: Ground (GND)
 Vernier probe pin 5: +5 V (VCC)
 Vernier probe pin 6: Sensor output (A0)

 created 2011-09-08 by David Hay (misterhay)
 Some code borrowed from example by Tom Igoe

 This code is Creative Commons Attribution (http://creativecommons.org/licenses/by/3.0/)
*/

// Constants, used to give names to the pins used
const int analogInPin = A0;  // Analog input pin that the probe is attached to
const int ledPin = 11; // The Teensy on-board LED is on pin 11

// Variables
int sensorValue = 0;        // value read from the probe

// The setup, which runs once when the sketch starts
void setup()
{
  Serial.begin(38400);     // initialize serial communications at 38400 bps,
                           // not that this matters since it runs at USB speed
  pinMode(ledPin, OUTPUT);  // set the digital pin as an output
}

// The actual loop that does the sampling and output to the serial monitor
// This will continue to run as long as the Teensy is plugged in
// Use the Arduino Serial Monitor or some fancy GUI to see the output
void loop()
{
  // read the analog in value:
  sensorValue = analogRead(analogInPin);           
  // print the results to the serial monitor:
  Serial.println(sensorValue);     

  // wait 10 milliseconds for the analog-to-digital converter to settle
  delay(10);
}


Watch the output in a serial monitor program on your computer, and paste it into a spreadsheet program for graphing. Eventually I'll build a GUI for adjusting sample rates and number of sensors and maybe some live graphing, add some calibration, and put it in a better enclosure.

Wednesday, July 13, 2011

thoughts from ISTE 2011

Here are some of my observations and thoughts from the recent ISTE Conference.


Links I came across:
manning.com/ceder/
nextvista.org videos for students (Rushton Hurley)

Met at the dinner reception:

http://www.fcps.edu/ChesterbrookES/qrcodes.htm

Free children’s audiobooks:
http://talesfromtheforest.co.uk/stories.html

Google Apps Education Training Center
http://edutraining.googleapps.com/

National Oceanic and Atmospheric Administration kids games
http://games.noaa.gov/

JASON Science
http://www.jason.org/public/whatis/start.aspx

Open Education Resources
http://www.k12opened.com/wiki/index.php/Learn_About


Topics I was interested in:
game-based learning
3D design/printing/CNC
student-owned devices
citizenship / online identity
science data collection
programming/computing science
girls in science/tech
flipped instruction

sturdy headset for language labs
distance/asynchronous/blended learning
assessment
asynchronous/flipped professional development
Administrators as technology leaders
open source
robotics
libraries
online collaboration
just-in-time teaching (versus just-in-case)
open content
student media creation (and portfolios)

Thursday, June 23, 2011

bringing technology to #ISTE11

We've had some discussion in my office about what technology to bring to the ISTE conference. Here are my thoughts and what I'm bringing.
  • iPad (or other tablet) for attending sessions
    • with audiobooks, books, and videos
  • laptop or netbook for writing and Skype/Google Talk
  • iPod Touch for walking around at night, and probably for the plane rides
    • also with audiobooks, books, and videos
Calling home:
Skype - for video calls between computers, iPad 2, iPhone, TVs, etc
Google Talk - free calls to Canada and US phones from within Gmail, free video calls to computers

And I'm leaving my phone at home, since even with a US plan it's still about $40 for 40 minutes and $30 for 0.01 GB of data.

While I'm at #ISTE11, I'll be posting to Twitter (@misterhay) and this blog.

Monday, June 13, 2011

amusement park accelerometer data

I collected some data with my phone accelerometer using the app AccDataRec. I've graphed all three axes on each of the spreadsheets in this Google Docs folder.

The best one is the Flying Galleon. I cropped off the messy data at the start and end so it's a nice sinusoidal curve.

Feel free to share and use these however you'd like.











Creative Commons Licence
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Friday, June 10, 2011

setting up Moodle Language Lab

Moodle Language Lab is an activity module developed (and being developed) by Campus Saint-Jean and Oohoo.biz that:
replaces the traditional cassette tape language lab. There is a module for students to record themselves and teachers to review and grade the work. This version also includes a class monitor. So, if a teacher uses it inside the classroom, he/she can monitor student progress the same way they used the traditional language lab by listening to live streams of the students, responding live to students, giving a thumbs up and so on.
It also offers an integration with the Moodle WYSIWYG, allowing recordings to be done virtually in any activity or resource wihtin Moodle. This feature has been used in our classes throughout the past year. For example, we had an oral forum instead of a written forum. Professors would leave spoken messages in the grade book.
It requires three programs running on a server (on the same server or separate ones):
  1. Moodle 2.0.x
  2. Red5 Media Server (version .8)
  3. Palabre XML Socket Server edit: Palabre is no longer needed
Here's how you can set up the three parts of Moodle Language Lab on a Windows server. The process will be similar for other operating systems.

Red5
  1. Download version .8 from code.google.com/p/red5/ (I recommend the ZIP file, and 1.0 RC1 worked for me)
  2. Unzip the files into some folder (not publicly accessible)
  3. Install Java, if it's not already installed, and make sure your JAVA_HOME variable is defined
  4. Run Red5.bat
  5. Go to http://localhost:5080/ to test that Red5 is running, and click "Install a ready-made application"
  6. Install the oflaDemo
  7. Make a note of the server's Internet-accessible IP address (or FQDM)
Palabre
  1. Download the source files (Windows installer didn't work for me), untar into some folder (again not a publicly accessible folder)
  2. Install Python (2.7 or so)
  3. Edit the Palabre\etc\palabre.conf file, these are the two lines that I changed
    • ip = 
    • alloweddomains = 127.0.0.1 moodle.______.ca #put your own value(s) on this line
  4. Run Palabre.py
  5. Test by running one of the Palabre clients
  6. Make a note of the server's Internet-accessible IP address (or FQDM)
Moodle (this is just pasted from the Developer's readme file)
  1. copy all folders (filter, mod, lib ) into the appropriate moodle(root) folder.
  2. Login to Moodle with admin rights.
  3. In the Site Administration block, click on Notifications. This will setup the database tables for the languagelab module
  4. In the settings block, select Site administration -> Plugins -> Activities Modules -> Manage activities -> Language lab -> settings
  5. Enter the IP address or the FQDN that you noted previously in the appropriate fields and save changes.
  6. You're done. Go into a course, turn editing on and add a language lab activity.

Tuesday, April 26, 2011

Xbox 360 tool control mat

Inspired by a blog post about making tool control mats with a CNC router, I made a "tool" control mat for a video game club's shelf.

Using Inkscape I imported a vector drawing of the 360 gamepad by grumbel on the Open Clip Art Library as the basis for the outline of the controller, resized it to the dimensions on the Wikipedia page, and made 12 copies of it (since that's how many controllers the club owns).


The slots for the games were just rectangles using the dimensions from another Wikipedia article. I discovered that I had to convert these objects to paths (under the Path menu in Inkscape) before I saved the file as a DXF file (or PDF file, depending on which CAM program you're using).

I converted the drawing to G-code for a 1/2 inch end mill as a roughing pass, thinking that I'd then do a finishing pass with a smaller bit, but decided that it was good enough after the first pass. I milled it from two inch thick extruded polystyrene foam (Styrofoam), then cut it down to size on a radial arm saw (which explains the mistake you see on the side in this last photo).

Not bad for my first successful CNC project, if I do say so myself.

Tuesday, April 19, 2011

CAD CAM CNC routing workflow

After experimenting with many different programs for CAD (3D design) and CAM (turning that design into code for a CNC router), I've come up with a good workflow using easy and free tools:


The process that works for me is
  1. design a 3D model in Sketchup
  2. export the model to an STL file using the guitar-list.com plugin
  3. load that STL file into FreeMill
  4. generate the toolpath and post it to a G-code text file
  5. import the G-code into Mach3 and run it on the CNC machine
Hopefully this will be simple enough for students to start designing and cutting things.