obligatory obscure reference


self-deprecating yet still self-promotional witty comment

2009/04/02

Arduino MEGA is made of win

Filed under: Arduino,Hacking — jet @ 13:34

and it’s rather large.

Something that has continually bugged me about the various flavors of Arduino is the number of pins that there are not 8 of. As in, 5 analog pins or 6 PWM pins or whatever. I end up adding multiplexors so I can drive 8 PWM outputs or read 8 sensors or what-have-you.

Arduino MEGA fixes all my problems, at the cost of size and a few extra $$$:

PWM: 14 pins, I’ll try not to complain about it not being 16

Analog Input: 16 pins

Thanks to all the extra I/O, I was able to ditch a specialized, $25 PWM controller and some support hardware and move my entire project from a pc board to an Arduino MEGA shield.

[tags]arduino mega[/tags]

2009/01/08

Sanguino: First Impressions

Filed under: Arduino,Hacking — jet @ 18:59

The reprap people have a new arduino-like out, the Sanguino. It uses the Atmel atmega644p, so it has 4x the memory, 14 more i/o pins, and JTAG support.

I ordered a couple of kits and soldered them up. Instructions are easy to follow, both for soldering up the board and for modifying Arduino to support the new chip. However, I ran into two problems right off the start, one of which would have probably stymied someone without any arduino/microcontroller experience.

1) No bootloader was installed on the Atmel. This is not the end of the world if you have a bootloader lying around. We had one in studio, but I can’t find it and everyone else is out of country/town. I took this as a sign that I should have my own, so I ordered a couple of USBtinyISP‘s from Limor (always buy two of anything you rely upon), soldered them up, and bootloaded the Sanguino. I wrote a simple sketch that blinks the debug LED, pushed it to the Sanguino and yea, everything works now!

Now, to try replacing the Arduino nano or mini on one of my project boards.   

2) Oh. How cute. It won’t work on a breadboard. The spacing on the Sanguino pins is so wide that when it’s plugged into the center of ye olde standard breadboard, you can’t access one side of the Sanguino’s pins. That is, if you put one side of the Sanguino in column b so that you can use column a, the other side is in column j, not in column i. Looking at the board layout, I think this could have been completely avoided by moving the pins in a “row” on each side, and putting the labels for the pins inbetween the pins ala the Nano.

Yuck. I guess I’ll have to get clever if I want to use this with my existing projects.

[tags]arduino, sanguino[/tags]

2008/10/04

Eagle Library – Arduino Nano

Filed under: Arduino,Hacking — jet @ 15:39

After ~5 minutes looking on the interwebs, I gave up and just made my own EAGLE library file for the Arduino Nano. I haven’t used it to make a board yet, so I’m going to call this the “alpha” version until I do. Use as you like, just don’t blame me if it’s broken.

jet’s EAGLE lib o’ doom

[tags]Arduino,EAGLE,pcb[/tags]

2008/09/26

Which Arduinio is Right for You? (alpha)

Filed under: Arduino,Hacking — jet @ 18:13

Ok, first cut at a spreadsheet comparing Arduino types. I still need to add the LEDuino and probably some new columns, so consider this an alpha at best.

CSV, PDF, and Excel(-ish) formats.

[tags]arduino[/tags]

2008/09/18

preview — which Arduino is right for you?

Filed under: Arduino — jet @ 05:53

As part of figuring out which Arduino to use, I’m making a chart of the various characteristics of Arduino boards.

So far I have the obvious — # I/O pins, form factor, required power, etc. Anything in particular that you (collective) would find useful in such a chart that I might not think of? For example, do you care about weight? Physical dimensions without pins?

Let me know in email or in comments.

[tags]Arduino, survey[/tags]

2008/04/18

Arduino: Generating the Morse Code

Filed under: Amateur Radio,Arduino,Hacking — jet @ 16:08

Ok, this was stupid fun and really easy. I’m relearning the Morse code — I originally learned it using the excellent ARRL CDs. As part of re-learning it, I thought it would be fun to see if I could learn it visually as well, by looking at a blinking LED. It kinda makes my brain hurt, but it actually might be doable.

So here it is, my simple Morse Code arduino sketch.

I think I might try parsing Morse next, it’s a much more interesting problem…

[tags]arduino, morse[/tags]

2008/04/11

Arduino: Reading the SHT15 temperature/humidity sensor

Filed under: Arduino,Hacking — jet @ 14:04

Ok, this was a bit more fun and geeky. The SHT15 is a temperature/humidity sensor made by Sensirion. I bought mine from Sparkfun, and at $42 it’s a bit pricey, but it’s pre-mounted on a breakout board saving me a nasty soldering job.

The SHT15 isn’t as fragile as a lot of other electrical components — you can get it wet, put it in the sun, etc. I’ll probably just mount it at the end of some very long leads and not bother putting any sort of protective case on it.

Being the rocket scientist that I am, I didn’t download the specs until I decided to actually write code. Turns out that the SHT15 uses a serial protocol developed by Sensirion; but they were kind enough to post some sample code for the 8051 so it wasn’t too hard to get working on the Arduino.

If you’re trying to get this working, take a look at my Arduino sketch. Writing code to read serial protocols using clock and data pins isn’t for the newcomer, but it isn’t terribly difficult if you know a bit of C, bit-wise operations, and have sample code to reference along with the timing diagrams.

[tags]arduino,hacking,sht15[/tags]

2008/03/15

Arduino: Reading the ADXL 3xx Accelerometer

Filed under: Arduino,Hacking — jet @ 17:08

Reading the ADXL 3xx is pretty straightforward — give it power, run lines from the x,y,z pins to three analog pins, and do analogRead()s on the pins.

What’s a bit trickier is dealing with the sensor values. Resting flat on my desk, the x, y, and z values all vary on each read. It’s only by one or two steps, but it’s still noisy and could introduce a lot of jitter into your code. One way of eliminating/reducing noise is to take a running average of sensor readings, then use those to make your decisions.

Here’s an example Arduino sketch that reads the sensors, computes a running average, then displays the previous average, average, and current raw value for each axis.

A couple of related notes:

  • The power you give the ADXL needs to be the same as the reference voltage on your Arduino. If you power the ADXL directly from the Arduino, then everything is fine. If you power it from another source, you might need to use the external power reference features on the Arduino.
  • While you put power to the ST pin, the ADXL will force all three outputs to the middle value. This is useful for calibrating the ADXL by reading what it things its middle values are for each axis. However, it’s not something the average person will probably care much about, I find it useful as a “is it really working” test while I’m debugging a circuit.

[tags]adxl,arduino[/tags]

2007/12/02

Arduino: Reading the Maxbotix Ultrasonic Rangefinder

Filed under: Arduino,Hacking — jet @ 18:32

This was so easy it wasn’t even funny. I think I spent more time discovering that I was trying to read the wrong pin than I did actually getting this to work. The main reason I’m posting it is so that people considering this rangefinder can see just how easy it is to use compared to some of the other rangefinders out there.

This reads the voltage from the AN (analog) pin on the Maxbotix LV-EZ1 Ultrasonic Range Finder (I got mine at SparkFun). Connect power and ground on the Maxbotix to a reference ground and power, then connect the AN pin to the analog input of your choice.

Here’s a simple program to read the sensor and report the range in inches on serial:


//-*-C-*-
// read values from a LV-MaxSonar-EZ1 sensor
// this is for the Arduino MINI -- change the pin values to suit your board.
// jet@flatline.net
// 1 Dec 2007

//Output
int statusLed = 13;

//intput
int ez1Analog = 0;

void setup() {
pinMode(statusLed,OUTPUT);
pinMode(ez1Analog,INPUT);

beginSerial(9600);
}

void loop() {
int val = analogRead(ez1Analog);
if (val > 0) {
// The Maxbotix reports 512 steps of information on AN
// but we read that as 1024. Each step is 1", so we need
// to divide by 2 to get the correct rough range in inches.
//
// this value should also be calibrated for your particular
// sensor and enclosure
val = val / 2;
Serial.println(val); // inches
}
blinkLed(statusLed,100);
}

void blinkLed(int pin, int ms) {
digitalWrite(pin,LOW); // turn it off it was on
digitalWrite(pin,HIGH);
delay(ms);
digitalWrite(pin,LOW);
delay(ms);
}

[tags]arduino,maxbotix[/tags]

« Previous Page

Powered by WordPress