Show Posts
Pages: 1 2 3 [4]
46  Forum 2005-2010 (read only) / News / Re: pachube beta testers?sharing networked sensor on: March 18, 2008, 02:17:20 am
I'd be interested in this project. I've got a couple of project ideas that can share data to a server. Would be pretty cool. Let me know
47  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 18, 2008, 05:04:36 am
Thanks, I'll give it a shot tonight and see how it works. Thanks for everybodies help and especially Mem  smiley
48  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 18, 2008, 01:17:50 am
Thanks for all the help so far guys, but at the moment I'm a bit confused:

This is the original circuit :



So now I wanted to measure the current so I added the resistor and read the voltage value with the arduino analog input like so :



OK, that works nicely, But, now I also want to measure the voltage over the led : But obviously I can't just add another ground before the led and a an arduino pin after the led. So do I just set GND to starting ground and then read voltages at the different points with multiple analog inputs ? :



does that make sense ? Will my 'current measure resistor' still do its job that way?

Thanks again for all the help
49  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 17, 2008, 03:11:30 pm
hmm, I ran into a problem. I've got a circuit with a current regulator and a led. I'm measuring the current by adding the 4.7ohm resistor in series and measuring the voltage over it with my arduino. That part seems to be working fine, but now I also want to measure the voltage over the led using the same arduino. If I take a wire from ground to the one side of the led and and the other side of the led to another analog input to measure it, it seems to short out the led. I hope this made sense ...

Can I measure the voltage over the led with the same setup ?
50  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 17, 2008, 02:36:41 pm
Quote
You want the smallest possible resistor for measuring the current, but as the resistor gets smaller the accuracy drops. If you use a 1 ohm resistor  then each unit of analogRead of the pin connected to the current sensing resistor is around 5ma.  A 5.1 ohms resistor gives  around 1ma for each unit of analogRead.

OK, so i've got something setup on my breadboard. From the calculations I should be reading 25.5 mA. I used a 4.7 ohms resistor for measuring the voltage from. At the moment the arduino board analog reading is jumping between 23 and 24, which is pretty damn close. How did you calculate that 5.1 ohms will give you around 1ma for each unit read. ie. how can I convert that value to get an even more accurate value. I'm guessing that using precision resistors will give me an even more accurate value ?

thanks for all the help so far everybody, I really appreciate it.
51  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 17, 2008, 08:03:08 am
OK, so this is what I've got so far:

For my current input, I can basically use a resistor (as mentioned above) in the following setup:



From my calculations (V=IR) I get that at 27.7mA my output would be 5v. So theoretically I can just measure my output with the arduino analog input and then do some calculations to get the mA.

The voltage divider is easy enough :



Which means that I should get 5V out with a 9V input. To calculate Vin I use the following formula:

Vin = Vout/(R2/(R1+R2))

Am I correct with these assumptions or do you guys disagree with something. btw - I know the theory (supposedly smiley-wink), but I'm still learning to apply this practically.
52  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Measuring Current/Voltage with arduino ? on: March 17, 2008, 06:29:22 am
Well, it doesn't have to be too precise but I would like to get values that make sense. I'll have a look for a current to voltage conversion. Anybody else have any ideas ?
53  Forum 2005-2010 (read only) / Frequently-Asked Questions / Measuring Current/Voltage with arduino ? on: March 17, 2008, 04:18:48 am
Hi Guys,

Would it be possible to be measure voltage and current with my arduino using the analog input pins? I'd like to measure a voltage between 0-9V, and a current between 0 and 30mA. The numbers aren't too extreme so would this be possible without using any other special ic's ?
54  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino Midi Problem on: June 25, 2008, 12:00:45 pm
I checked the output in the serial port monitor and there is an output visible. So I take it the driver is not working ?
55  Forum 2005-2010 (read only) / Frequently-Asked Questions / Arduino Midi Problem on: June 25, 2008, 08:37:50 am
Hi All,

I'm currently trying to setup a mini midicontroller. I've got a atmega8 in a stk500 development board with the arduino bootloader installed. I've loaded the following program via the ide :

// The switch is on Arduino pin 10:
#define switchPin 10
// Middle C (MIDI note value 60) is the lowest note we'll play:
#define middleC 60
//  Indicator LED:
#define LEDpin 13

// Variables:
char note = 0;            // The MIDI note value to be played
int AnalogValue = 0;           // value from the analog input
int lastNotePlayed = 0;   // note turned on when you press the switch
int lastSwitchState = 0;  // state of the switch during previous time through the main loop
int currentSwitchState = 0;

void setup() {
  //  set the states of the I/O pins:
  pinMode(switchPin, INPUT);
  pinMode(LEDpin, OUTPUT);
  //  Set MIDI baud rate:
  Serial.begin(31250);
  blink(3);
}

void loop() {
  //  My potentiometer gave a range from 0 to 1023:
  AnalogValue = analogRead(0);
  //  convert to a range from 0 to 127:
  note = AnalogValue/8;
  currentSwitchState = digitalRead(switchPin);
  // Check to see that the switch is pressed:
  if (currentSwitchState == 1) {
    //  check to see that the switch wasn't pressed last time
    //  through the main loop:
    if (lastSwitchState == 0) {
      // set the note value based on the analog value, plus a couple octaves:
     // note = note + 60;
      // start a note playing:
      noteOn(0x90, note, 0x40);
      // save the note we played, so we can turn it off:
      lastNotePlayed = note;
      digitalWrite(LEDpin, HIGH);
    }
  }
    else {   // if the switch is not pressed:
    //  but the switch was pressed last time through the main loop:
    if (lastSwitchState == 1) {
      //  stop the last note played:
      noteOn(0x90, lastNotePlayed, 0x00);
      digitalWrite(LEDpin, LOW);
    }
}

  //  save the state of the switch for next time
  //  through the main loop:
  lastSwitchState = currentSwitchState;
}

//  plays a MIDI note.  Doesn't check to see that
//  cmd is greater than 127, or that data values are  less than 127:
void noteOn(char cmd, char data1, char data2) {
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
  Serial.print(data2, BYTE);
}

// Blinks an LED 3 times
void blink(int howManyTimes) {
  int i;
  for (i=0; i< howManyTimes; i++) {
    digitalWrite(LEDpin, HIGH);
    delay(100);
    digitalWrite(LEDpin, LOW);
    delay(100);
  }
}


The led's goes on whenever I press the play note button. I've got it all connected to my pc using the serial port. I've tested the serial port with another program and it works fine. I installed the Roland midi/serial driver and got the settings to the correct comport.

Now what ? I've tried various programs that can see midi input such as fruity loops and even a midi monitor but I don't get anything. Any ideas on what I'm doing wrong ?

Thanks,
Tom
56  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Controlling sounds volume on: March 17, 2008, 08:16:18 am
I don't really have a solution to your popping sound. But what I would try is to isolate the output of the relay so that you don't switch your speaker cables directly with the relay. Like I said, no idea what I'm doing but this is what I would try. (ignore if this sounds totally stupid) smiley-wink
Pages: 1 2 3 [4]