Shopping Cart:
now in your cart 0 items
Home New Products Specials My Account Contact Us
Top » CDS
Categories
  Breakout Boards
  Components
  Controllers
  Gift Certificate
  Mechanical
  Motor Controllers
  Programmers
  Sensors
  SFE Widgets
  Wireless Communication
   Specials
Skinny (Compatible with Arduino)
Skinny (Compatible with Arduino)
CAD $23.66
CAD $16.99
Browse by Manufacturers:
   Links
ARM Microprocessors
AVR - Arduino
AVR Microprocessors
DIY CNC
Electronics
Magazines
Mechanics
Robotics
Robots - Hobby
Software
Software Tools
Controlling Sparkfun Laser Module using Arduino/WIRING and AVR ATMega644
You've probably seen dev-board demos that show you how to flash LEDs. Well, we decided to produce similar demo using WIRING programming language, AVR ATMega644 M-32 dev-board and Sparkfun laser module instead of the LED. One thing is for sure - lasers are fun. This particular laser module can reach walls as far as fifteen meters away and it doesn't seem to be the limit.

The laser module requires POWER (RED), GROUND (BLACK), and TTL control (WHITE) wire connections. For the setup we used M-32 dev-board that comes with on board power and ground pins that we used to power the laser . TTL control line was connected to B0 pin of ATMega644 micro. Here is how SPF laser module connector looked like after we were done hooking up the wires.

Laser Module connection to a ATMega644 micro The program logic is pretty simple.The program sets pin to HIGH then goes to sleep for one second then sets pin to LOW and goes to sleep again. This will be repeated in the infinite loop. We used one of the WIRING/Arduino blinking LED examples to produce blinking laser demo.

This is how the source looks like.

int laserPin = 8; // Laser connected to digital pin 8 - PB0 of M32

void setup() // run once, when the sketch starts
{
pinMode(laserPin, OUTPUT); // sets the digital pin as output
}

void loop() // run over and over again
{
digitalWrite(laserPin, HIGH); // sets the Laser on
delay(1000); // waits for a second
digitalWrite(laserPin, LOW); // sets the Laser off
delay(1000); // waits for a second
}

Here is the ZIP with source code and HEX file for ATMega644 with clock speed of 8MHz.

This how the result looks like once you get everything together and working :)

ATMega32 and SPF laser module demo

   Shopping Cart
0 items
   Your Account
Your Email Address
Your Password
   Article Search

Search Articles Text

   Advertise
MiniroboticsTeam
Log In   |   Cart Contents  |  Checkout
Copyright © 2012 RobotCraft Components  |  Privacy Notice  |  Terms of Use