Show Posts
Pages: [1]
1  Using Arduino / Sensors / LSM303 DLH Heading not working properly? Digital Compass Spark Fun LSM303 DLH on: January 23, 2013, 06:58:22 am
Hi there,

 We are using the book 'Making Things Talk' as a guidance to get heading from the Spark Fun LSM303DLH digital compass.
 The Accelerometer seems to be ok, but the Magnetometer data we get is strange:

 North: around 275
 East: around 305
 South: around 275
 West: around 245

 So it's not useful at all. At least the values in between smoothly change.
 1) Has anyone made their Spark Fun LSM303DLH work properly?
 2) Does anyone know what might have gone wrong? How to solve this?

 We are pretty sure our cables are right.

 Our Code:
// include the necessary libraries:
#include <Wire.h>
#include <LSM303DLH.h>
#include <Button.h>

const int modeButton = 2; // pushbutton for calibration mode
const int buttonLed = 3; // LED for the button

// initialize the compass library
LSM303DLH compass;
// initialize a button on pin 2 :
Button button = Button(modeButton,BUTTON_PULLDOWN);
boolean calibrating = false; // keep track of calibration state

void setup() {
// initialize serial:
// set up the button LED:
// start the Wire library and enable the compass:

void loop() {
// if the button changes state, change the calibration state
// and the state of the LED:
if(button.isPressed() && button.stateChanged()){
calibrating = !calibrating;
digitalWrite(buttonLed, calibrating);

// if you're in calibration mode, calibrate:
if (calibrating) {
else { // if in normal mode, read the heading:;
int heading = compass.heading();
Serial.println("Heading: " + String(heading) + " degrees");
2  Using Arduino / Sensors / Re: What sensors for a MATERIAL TOUCH/FEEL device? on: January 15, 2013, 05:14:05 am
Wow, thanks a lot guys! These seem to be some very good starting points.

Do you happen to know anything fairly similar for inspirations? I'll try to hack a mouse and a record needle.

Any more suggestions? <- this seems to be using some sort of an optical input. Probably just to see the lines of the tree. Doesn't seem to be that good for my project.
3  Using Arduino / Sensors / What sensors for a MATERIAL TOUCH/FEEL device? on: January 14, 2013, 09:58:59 am
Dear Arduino Masterminds,

 We are doing a little Arduino project and we would like to make a device that could 'feel' (touch/experience) materials around us and create a sound response depending on the material. Kind of like recreating our human experience of different materials.
 Ideally, it would feel all the subtle differences (like different types of smootheness, roughness, density?).

 Do you think it is possible? What sensors could help?

 We thought that maybe some sort of needle could be run over materials and move with the roughness. This could be then recorded and expressed by generating variable sounds.

 Maybe an optical sensor would be better? Or maybe something to do with conduction?

 We would be VERY VERY greatful, as it seems we could make a cool device with it.
 (it's a school project, so we probably could not afford any extremely expensive parts but ANY help/comment/inspiration would be appreciated)
Pages: [1]