Site Logo

 
It is currently Fri Oct 24, 2014 7:25 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Arduino Projects!
PostPosted: Mon Jul 13, 2009 11:37 am 
Offline
Site Admin
User avatar

Joined: Sat Mar 14, 2009 4:14 pm
Posts: 1444
Location: Minneapolis, Minnesota
Here's a new thread to document and collaborate on Arduino projects!

Now that I have a Duemilanove Arduino, I'm bewitched, bothered, and bewildered. There's a universe of stuff to do with it!

I have a LOT of very cool chips and components to use with it: SN76477 synthesizer chips, op amps, CMOS logic chips, some photocells, a phototransistor, (power) transistors, magnets, hobby motors, diodes, zener diodes (I have dozens of 6.8V zeners!), resistors, capacitors, solenoids, etc.

Post here if you've built a cool Arduino project or have suggestions for others, esp. beginners!

_________________
612-293-MAKE World Community Grid Team Page | Blog | Promo Flyers | Dues Info
Active Topics | Twitter Page | TCM Photos | View Your Posts | YIM waynoid | AIM wammie777


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 12:43 pm 
Offline

Joined: Wed Jan 14, 2009 10:01 am
Posts: 47
I've had an Arduino Duemilanove for a few months now. Very fun little micro.
I've been able to talk to a Real Time Clock, a Temp Sensor, a 2X20 LCD and a Stepper Motor using an EasyDriver.
Example code for all of those can be found online.

I've been able to get a serial link working via LabVIEW to log ADC and temp sensor data.
I'm not a C programmer, but with lots of searching on the Arduino Fourms and help from co-workers I can usually get things to work.
Someday I'd like to build an Etch-a-Sketch clock.


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 1:09 pm 
Offline
Site Admin
User avatar

Joined: Sat Mar 14, 2009 4:14 pm
Posts: 1444
Location: Minneapolis, Minnesota
Cool, meat_raffle!

Well I just did one of the easy experiments that blinks an LED with PWM based on a pot slider position, but substituted a photocell and resistor for the pot. Works fine; the LED blinks faster when it receives a higher light level!

_________________
612-293-MAKE World Community Grid Team Page | Blog | Promo Flyers | Dues Info
Active Topics | Twitter Page | TCM Photos | View Your Posts | YIM waynoid | AIM wammie777


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 1:27 pm 
Offline
Site Admin
User avatar

Joined: Sat Mar 14, 2009 4:14 pm
Posts: 1444
Location: Minneapolis, Minnesota
I'm contemplating a somewhat involved project too. For this, I'll need to write a digital byte to eight of the I/O pins on the Arduino. From the Arduino Programming Notebook, I find the following:
Code:
digitalWrite(pin, HIGH); // sets 'pin' to high

Isn't there a way to write a byte of data all at once to eight pins, instead of having to write to each of the individual pins?

_________________
612-293-MAKE World Community Grid Team Page | Blog | Promo Flyers | Dues Info
Active Topics | Twitter Page | TCM Photos | View Your Posts | YIM waynoid | AIM wammie777


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 1:47 pm 
Offline

Joined: Wed Jan 14, 2009 10:01 am
Posts: 47
I've not seen anything along the lines of a "port write/read" for the Arduino, but I do it all the time in LabVIEW.
Perhaps there is a library out there that could do it?


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 2:22 pm 
Offline
Site Admin
User avatar

Joined: Sat Mar 14, 2009 4:14 pm
Posts: 1444
Location: Minneapolis, Minnesota
Yeah, seems there is. I found information on digital port use here:
http://www.arduino.cc/en/Reference/PortManipulation

But the resource discourages byte-wise manipulation for the following reasons:
Quote:
The code is much more difficult for you to debug and maintain, and is a lot harder for other people to understand. It only takes a few microseconds for the processor to execute code, but it might take hours for you to figure out why it isn't working right and fix it! Your time is valuable, right? But the computer's time is very cheap, measured in the cost of the electricity you feed it. Usually it is much better to write code the most obvious way.

The code is less portable. If you use digitalRead() and digitalWrite(), it is much easier to write code that will run on all of the Atmel microcontrollers, whereas the control and port registers can be different on each kind of microcontroller.

It is a lot easier to cause unintentional malfunctions with direct port access. Notice how the line DDRD = B11111110; above mentions that it must leave pin 0 as an input pin. Pin 0 is the receive line (RX) on the serial port. It would be very easy to accidentally cause your serial port to stop working by changing pin 0 into an output pin! Now that would be very confusing when you suddenly are unable to receive serial data, wouldn't it?

So you might be saying to yourself, great, why would I ever want to use this stuff then? Here are some of the positive aspects of direct port access:

You may need to be able to turn pins on and off very quickly, meaning within fractions of a microsecond. If you look at the source code in lib/targets/arduino/wiring.c, you will see that digitalRead() and digitalWrite() are each about a dozen or so lines of code, which get compiled into quite a few machine instructions. Each machine instruction requires one clock cycle at 16MHz, which can add up in time-sensitive applications. Direct port access can do the same job in a lot fewer clock cycles.

Sometimes you might need to set multiple output pins at exactly the same time. Calling digitalWrite(10,HIGH); followed by digitalWrite(11,HIGH); will cause pin 10 to go HIGH several microseconds before pin 11, which may confuse certain time-sensitive external digital circuits you have hooked up. Alternatively, you could set both pins high at exactly the same moment in time using PORTB |= B1100;

If you are running low on program memory, you can use these tricks to make your code smaller. It requires a lot fewer bytes of compiled code to simultaneously write a bunch of hardware pins simultaneously via the port registers than it would using a for loop to set each pin separately. In some cases, this might make the difference between your program fitting in flash memory or not!

_________________
612-293-MAKE World Community Grid Team Page | Blog | Promo Flyers | Dues Info
Active Topics | Twitter Page | TCM Photos | View Your Posts | YIM waynoid | AIM wammie777


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Mon Jul 13, 2009 8:39 pm 
Offline
User avatar

Joined: Sun Jan 18, 2009 11:06 am
Posts: 217
Location: Brooklyn Park, MN (EN35ic)
My steampunk ghost detector is controlled by an Arduino. Lights, a meter and a hobby servo (inside the big meter), a "power switch" to put it all in a quiet mode, and a hidden button to make it detect a ghost.

I just got a Smokenator 1000, and now I have this idea to build a temperature sensing rig using a thermocouple and some kind of display. And maybe an Xbee module to pipe the temp data inside, to another display. And maybe to a logger, so I can graph the temp...

_________________
73 de KC0DZY


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Tue Jul 14, 2009 8:34 am 
Offline
Site Admin
User avatar

Joined: Sat Mar 14, 2009 4:14 pm
Posts: 1444
Location: Minneapolis, Minnesota
DanBackslide wrote:
My steampunk ghost detector is controlled by an Arduino. Lights, a meter and a hobby servo (inside the big meter), a "power switch" to put it all in a quiet mode, and a hidden button to make it detect a ghost.

I just got a Smokenator 1000, and now I have this idea to build a temperature sensing rig using a thermocouple and some kind of display. And maybe an Xbee module to pipe the temp data inside, to another display. And maybe to a logger, so I can graph the temp...

Oooohhhh! Your steampunk ghost detector makes me giddy! :D :D :D . I love steampunk! Man, I'm going to build something spectacularly steampunk with my Arduino sometime, I'm sure! Mwhahahahahahaaaaaaaa!

Another project I had in mind would need to read data off of a USB thumb drive... I'm looking for code for that. Like everyone else though, I tend to want to run before I learn how to crawl, so I'm taking some time to learn the basics first.

_________________
612-293-MAKE World Community Grid Team Page | Blog | Promo Flyers | Dues Info
Active Topics | Twitter Page | TCM Photos | View Your Posts | YIM waynoid | AIM wammie777


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Tue Jul 14, 2009 11:11 am 
Offline

Joined: Tue Jan 13, 2009 8:26 am
Posts: 378
I'll save you some trouble, Wayne- the Arduino can't read a USB drive.

Somebody MIGHT release a shield that will allow it to do so, but that would be a very expensive and complex shield.

I'd look into SD cards- that should be do-able, and I bet there's a shield out there that'll do it.

_________________
Mike H.
My maker blog


Top
 Profile  
 
 Post subject: Re: Arduino Projects!
PostPosted: Tue Jul 14, 2009 8:15 pm 
Offline
User avatar

Joined: Sun Jan 18, 2009 11:06 am
Posts: 217
Location: Brooklyn Park, MN (EN35ic)
FTDI makes a couple of devices that can read from USB flash drives. They have both serial and SPI interfaces:

Vinculum Vmusic2
Vinculum Vdisk2

I have a Vmusic2, but I have not made it work yet with the Arduino. This is mostly because I have no idea what I'm doing...

_________________
73 de KC0DZY


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL Flash Games