Show Posts
Pages: [1] 2 3
1  Using Arduino / Project Guidance / Need help choosing IMU or compatable hardware. on: September 25, 2013, 04:58:58 pm
I need some help and guidance. I am designing a camera mount for my motorcycle that will tilt the camera in the opposite direction of my lean to keep the camera even with the horizon. I have been able to accomplish this on my bench using a 5DOF IMU but I'm hoping to be able to use cheaper IMU from sparkfun. Any ideas?

Also... since I haven't been able to test it in a real world application yet, do you think the g-forces induced on the IMU during a corner will affect the calculated angle of lean?

Any other advice about this project would be greatly appreciated also.

Thanks in advance, Bill
2  Using Arduino / Project Guidance / Need Advice: TLC5940 with transistor or mosfet as high side switch on: April 21, 2013, 02:12:46 pm
Hi, I am designing a 16 x 40 RGB LED matrix using 10 of these: http://www.seeedstudio.com/wiki/60mm_square_8*8_LED_matrix_-_super_bright_RGB. These matrixes are common anode and I would like to use a TLC5940 and a transistor or mosfet(per row) to act as a high side switch. I would also like the transistor/mosfet to be able to handle at least 4 amps in case I accidentally turn on a complete row by accident. I plan on using 5volts to power the matrix.

Can anyone recommend a transistor or mosfet that will work for this?

Thanks for reading, Bill

3  Using Arduino / Programming Questions / Re: Need help understanding a line in someone elses sketch on: February 08, 2013, 02:53:42 pm
Great to know. Thanks for the clarification.
 
4  Using Arduino / Programming Questions / Re: Need help understanding a line in someone elses sketch on: February 08, 2013, 02:43:36 pm
Hrmm, I wonder which library that is. I didn't import any libraries into this sketch. Is it one of the IDE's basic libraries?
5  Using Arduino / Programming Questions / Re: Need help understanding a line in someone elses sketch on: February 08, 2013, 02:22:56 pm

Quote
Also, why is it highlighted?
It's not, on the forum. You need to explain what this means.

When loaded int the Arduino IDE, "int position" is highlighted orange like a Serial.print would be highlighted.
6  Using Arduino / Programming Questions / Re: Need help understanding a line in someone elses sketch on: February 08, 2013, 02:01:26 pm
Ok, thats what I thought but I wasn't sure. The only other place objectPresent is used is in the analogWrite statement.

One more quick question,

Right after the first if statement, "int position" is declared. Why is it declared in that part of the code and not with the rest of the declarations? Also, why is it highlighted?

Thanks again
7  Using Arduino / Programming Questions / Need help understanding a line in someone elses sketch on: February 08, 2013, 01:43:11 pm
Can someone explain what this line will return. It is located in the first if statement located in the first loop.

objectPresent = (powerCount < powerCountThreshold);

Code:
// Project 13 - Anti-gravity
// 15 Dangerous Projects for the Evil Genius

#define coilPin 11
#define irPin 13
#define sensorPin 0

int A = 2;
// Adjust B to improve stability
int B = 60;
int C = 20;
int D = 1000;

int maxPower = 255;
long powerCountThreshold = 300000;
int objectPresent = 0;
int monitoring = false;

void setup()
{
  pinMode(coilPin, OUTPUT);
  pinMode(irPin, OUTPUT);
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
  Serial.println("Ready");
  Serial.println("m - toggle monitoring");
  Serial.println("B - increase B");
  Serial.println("b - decrease B");
}

void loop()
{
  static int count = 0;
  static int oldPosition = 0;
  static int ambient = 0;
  static long powerCount = 0;
  count ++;
 
  if (count == 1000)
  {
    ambient = readAmbient();
    count = 0;
    objectPresent = (powerCount < powerCountThreshold);
    powerCount = 0;
  }
  int raw = 1024 - analogRead(sensorPin);
  // position from top (0) of sensor region to the bottom (650)
  int position = raw - ambient;
  // positive value means going downwards, negative going upwards
  int velocity = position - oldPosition;
  int power = position / A + velocity * B + C;

  powerCount += power;
  oldPosition = position;
 
  // clip
  if (power > maxPower) power = maxPower;
  if (power < 0) power = 0;

  checkSerial();
 
  if (monitoring)
  {
    Serial.print(position);  Serial.print(",");
    Serial.println(velocity);
  }
 
  analogWrite(coilPin, power * objectPresent);
  delayMicroseconds(D);
}

int readAmbient()   //todo try speding up delay in micros
{
  digitalWrite(irPin, LOW);
   // allow time for LED and phototransistor to settle
  delayMicroseconds(100);
  int ambient = 1024 - analogRead(sensorPin);
  digitalWrite(irPin, HIGH);
  return ambient;
}

void checkSerial()
{
  if (Serial.available())
  {
    char ch = Serial.read();
    if (ch == 'm')
    {
      monitoring = ! monitoring;
    }
    if (ch == 'B')
    {
      B += 5;
      Serial.println(B);
    }
    if (ch == 'b')
    {
      B -= 5;
      Serial.println(B);
    }
  }
}

Thanks

8  Using Arduino / General Electronics / Re: Can I run two power supplies in series? on: January 20, 2013, 07:30:19 pm
My ATX PSU's must be a common one because I let the magic smoke out of one of them. It also took out two jumper wires on its way out. The other one seems fine so far....
9  Using Arduino / General Electronics / Re: Can I run two power supplies in series? on: January 20, 2013, 08:53:49 am
Never mind. I found the answer here http://power-topics.blogspot.com/2009/07/operating-power-supplies-in-series.html

You guys have so much knowledge I think about asking you instead of looking it up on google sometimes.
10  Using Arduino / General Electronics / Can I run two power supplies in series? on: January 20, 2013, 08:46:15 am
I have some electromagnets that are rated for 24 volt. Can I run two atx PSU's in series to make 24 volts?
11  Using Arduino / General Electronics / Re: Need help understanding pressure sensor datasheet on: January 19, 2013, 02:28:28 pm
Would connecting this to 5 volts through a 50k resistor be considered a constant current source?

I was planning on using just the +Vout and running that through a non-inverting op amp to get a usable voltage out of this.
12  Using Arduino / General Electronics / Need help understanding pressure sensor datasheet on: January 19, 2013, 08:29:36 am
Here's the datasheet: http://www.components.omron.com/components/web/PDFLIB.nsf/0/DEFC0948FE2A5C91862577A7005A8099/$file/2SMPP_1112.pdf I have the 2SMPP-03 model.

I picked up a few of these sensors for a breathalyzer project I'm putting together. I'm using these to detect if the user is blowing into the breathalyzer.

I think this sensor acts like a wheatstone bridge but I'm not quite sure. If someone could verify my assumption, I would appreciate it.

Also, I have no idea how much voltage I can supply this with, I plan on using 5 volts. Will I be ok with this voltage?

The last thing I'm not sure about is the drive current. Do I have to limit the amount of current going to this sensor?

Thanks in advance!
Bill
13  Using Arduino / Motors, Mechanics, and Power / Re: Question: voltage vs current in a stepper motor on: January 10, 2013, 09:44:28 pm
I am fairly new to electronics. What do you mean by I/P to O/P control functions?
14  Using Arduino / Motors, Mechanics, and Power / Re: Question: voltage vs current in a stepper motor on: January 10, 2013, 09:16:37 pm
Thanks for the responses. They helped explain a lot. I found what seems like a good schematic to throw together for a controller board that will drive my stepper motor.

http://www.arjan-swets.com/cnc/e99ch09.pdf

Whats your opinion on this?
15  Using Arduino / Motors, Mechanics, and Power / Question: voltage vs current in a stepper motor on: January 10, 2013, 12:37:33 pm
I have a few stepper motors that l'd like to run at a higher voltage. They are 1.75volts at 3.5 amp. I plan on making a current controller for them. My question is, if I run them at 12 volts, do I still supply them with 3.5 amps?
Pages: [1] 2 3