Posts with «accelerometer» label

Insert Coin: Twine connects your whole world to the internet

In Insert Coin, we look at an exciting new tech project that requires funding before it can hit production. If you'd like to pitch a project, please send us a tip with "Insert Coin" as the subject line.

Wouldn't it be great if your laundry emailed you when it had finished? You got a tweet every time the room got too cold, or your basement sent you a text if it began to flood? "Easy," says the Arduino expert in the peanut gallery, but what about those with neither the time nor inclination to solder and program it from scratch? Fortunately, the gentlemen who founded Supermechanical feel our pain and have just the tonic for our maladies -- head on past the break to find out more.

Continue reading Insert Coin: Twine connects your whole world to the internet

Insert Coin: Twine connects your whole world to the internet originally appeared on Engadget on Thu, 24 Nov 2011 12:18:00 EST. Please see our terms for use of feeds.

Permalink | Email this | Comments

HexMotor 2.3 and pressure-sensor boards

Top view of my second PC board. 3 copies of HexMotor 2.3 and 2 copies each of 3 different breakout boards for a pressure sensor.

I got the boards back from 4pcb.com about a week ago.

The HexMotor rev2.3 boards have several new features: LEDs for +5v and +6.25v, a reset button, 16-bit shift register instead of 8-bit, servo outputs connected to pins 13, 7, 2, 9, 10 (rather than to the pins used for PWM).  The new board should be able to do either 6 PWM motors or 4 PWM motors, 5 servos, and 2 non-modulated reversible motors.  I was going to have the robotics club solder the board today, but they did not have time.

[Note: as of 1March 2012, I have put the HexMotor Eagle design files on the web.]

I made some breakout boards for the MPXHZ6250A pressure sensors from Freescale Semiconductor,  which gave me my first taste of SMD soldering.  At least the design uses gull-wing pins, which can be hand soldered.  The breakout board that I think that the robotics club will end up using puts a pressure sensor on one side and headers for a piggyback ADXL335 breakout board on the back.  that way there only need to be one set of wires for connecting the analog inputs and power to the sensors.

That is the board I soldered a sensor to.

Top view of the breakout board with the sensor and headers soldered in place.

The pressure sensors are tiny! I found it fairly difficult to solder the  sensor to the boards, even holding it with clamping tweezers. I did eventually get everything to stick with no shorts between the 3 signal wires, but I did have some trouble with the unused copper pads delaminating from the board.  For future reference: all pads should have wires going to them (even the unused pads) to have enough surface area for good adherence and so that some of the pad is tucked under the solder mask.

Here are the solder connections on the side where none of the pins are used.

Here are the solder connections for the power and signal pins (and an SMD capacitor).

Despite the rather sloppy soldering, the pressure sensor does work.  It turns out that the port size is just the right size for Lego pneumatics components, so testing was pretty easy.

Sensor attached to Lego pump and gauge for testing.

Here are the results of calibration tests with the (probably not very accurate) Lego gauge, done by my son and me.

Pressure (psi) Arduino analogRead
0 367
5 518
6 542
7 576
8 599
9 632
10 657
11 683
12 710
13 734
14 775
15 801
16 832
17 861
18 887
19 915
20 941
21 967
22 1000

The range is about right, since 22 psi plus one atmosphere is about 250kPa, which is supposed to be the high end of the sensor’s range. Also, 600″ (50′) of water is 21.67 psi, so the range from 367 to 1000 corresponds to about 50′, so the sensor should give the robotics team a resolution of about 1″ for measuring depth, as expected from the spec sheet.

The data are well fit by The club members will have to recalibrate the pressure sensor in water, to get calibration as depth in cm. They’ll probably have to re-zero the sensor every day they use it, to compensate for atmospheric pressure, since it is an absolute pressure gauge.


Tagged: Arduino, Lego pneumatics, pressure sensor, Printed circuit board, SMD soldering

New board designed

I’ve just sent a new set of boards for fab.  The HexMotor rev2.3 boards have several new features: LEDs for +5v and +6.25v, a reset button, 16-bit shift register instead of 8-bit, servo outputs connected to pins 13, 7, 2, 9, 10 (rather than to the pins used for PWM).  The new board should be able to do either 6 PWM motors or 4 PWM motors, 5 servos, and 2 non-modulated reversible motors.

I’m also making some breakout boards for the MPXHZ6250A pressure sensors from Freescale Semiconductor, which will require doing some SMD soldering.  At least the design uses gull-wing pins, which can (supposedly) be hand soldered.  One of the breakout boards also has a place for mounting an ADXL335 accelerometer, which may be more difficult to solder.  I don’t think I want to spend the money for a hot-air rework station, and I’m a bit dubious about my ability to solder using a toaster oven.

The pressure sensors are tiny!  My original suggestion to the robotics club was to drill a hole in the dry box and superglue the pressure sensor to the inside of the box (after the pressure sensor had been attached to the breakout board, of course).  Now I’m not so sure that there will be enough glue area to hold firmly enough.  Perhaps a dab of some sealant on the outside of the box might help, if we can keep from plugging the hole in the sensor.

The breakout board that I think that the robotics club will end up using puts a pressure sensor on one side and headers for a piggyback ADXL335 breakout board on the back.  that way there only need to be one set of wires for connecting the analog inputs and power to the sensors.

One limitation of the Arduino for use with this combination of sensors is that the accelerometer is a 3v part and the pressure sensor is a 5v part. We’ll have to set up the analog-to-digital converter on the Arduino to have a 5v range, which reduces the precision of the acceleration readings.

I’ve also bought some other sensors (not for the underwater vehicle, but for physics class and dry robotics): a couple of ultrasonic rangefinders.  More on those in a separate post, after I’ve had a chance to play with them.


Tagged: accelerometer, Arduino, H-bridge, motor controller, pressure sensor, Printed circuit board

Data Acquisition

One of the science-teacher blogs that I read has recently discussed using an Arduino for data acquisition: The DAQ-ness Monster « Science Learnification.

I’ve not played with the Arduino much that way, but I do have a 3-axis accelerometer, the ADXL335 from Analog Devices, on a breakout board from Adafruit Industries.  This accelerometer has analog readout, so I connected the three X, Y, and Z pins to analog pins 0,1, and 2 of the Arduino, and powered the breakout board from the Arduino 3.3 volt supply.  I also sent the 3.3 volt input to the AREF pin of the Arduino so that the I could use “ratiometric” measurements.  The ADXL335 is designed so that 0g acceleration is mid-scale, so using the same voltage for powering the chip and for the Arduino AREF input means that 512 is 0g and the scaling is approximately 1g for each difference of 100.  It turns out that the calibration is not perfect (no surprise there), so you can improve the measurements by tweaking the offset and scaling for each axis separately.  I did this manually for my code, and the results are only good to about 1%.

I should be able to do better if I write a calibration program on my laptop that gathers results from the Arduino and tries to optimize the magnitudes of the reported acceleration vectors to be one.  If the accelerometer is held steady in several different orientations, this should auto-calibrate.

I wrote a little program that measured the X, Y, and Z values 1000 times, averaged them, and sent the average over the USB line to my laptop.  I’ve put the code on-line at https://gist.github.com/1054649  Each of the measurements takes about 3.3 msec (about 1msec per DAC reading)

Limitations of the Arduino as a data-acquisition device:

  • Only 6 analog inputs
  • Only 10-bit resolution
  • All 6 channels on same scale, and input must be between 0 and a single reference voltage (3.3v for the setup I used).
  • No faster than about 1msec/sample (so don’t try to collect audio or video data)

UPDATE 8 October 2011.  I’ve just found out how to put code into the blog itself, so here it is:

// Accelerometer (ADXL335) test
// Kevin Karplus
// 29 June 2011

void setup()
{
  analogReference(EXTERNAL);   // essential if you are going to connect to AREF
  Serial.begin(115200);
  Serial.println("setup");
}

// I used wires to connect the breakout board to 
// three analong inputs, 3.3v, and ground.
// I also connected the AREF input of the Arduino to 3.3v

const int Xpin=2;
const int Ypin=1;
const int Zpin=0;

const int num_to_sum=1000;
const float xscale = 0.0098/num_to_sum;
const float yscale = 0.0097/num_to_sum;
const float zscale = 0.0099/num_to_sum;

const int zero_x = 500;
const int zero_y = 506;
const int zero_z = 511;

long xsum,ysum,zsum;

void loop()
{
  unsigned long startTime=millis();
  xsum = ysum = zsum = 0;
  for (int i=num_to_sum; i>0; i--)
  {    
     xsum += analogRead(Xpin) -zero_x;
     ysum += analogRead(Ypin) -zero_y;
     zsum += analogRead(Zpin) -zero_z;
  }
  Serial.print(millis()-startTime);
  float x=xscale*xsum;
  float y=yscale*ysum;
  float z=zscale*zsum;
  Serial.print(" X=");
  Serial.print(x);
  Serial.print(" Y=");
  Serial.print(y);
  Serial.print(" Z=");
  Serial.print(z);
  
  Serial.print(" total=");
  Serial.println(sqrt(x*x+y*y+z*z));
}


Filed under: Accelerometer, Data acquisition, Robotics, Software Tagged: accelerometer, Arduino, data acquisition, robotics

n/a

n/a