Show Posts
Pages: 1 ... 35 36 [37] 38 39 40
541  Forum 2005-2010 (read only) / Interfacing / Re: couple of questions on: April 21, 2010, 06:17:25 am
arduino can do a 10kHz sample rate...

according to that shannon nyqist theorem that is good for frequencies up to 5kHz... so u would need a low-pass that has a sharp border frequency of about 5kHz...

i dont know if fast fourier transformation can be done in 1600 clock cycles... possibly not... :-)

but u could find out if the volume is higher than usual or such things...
i like to use this memory saving forumula for such things:
Code:
uint32_t avg = 0; // initial average value
avg = (avg*1023/1024+1) + sample;

-arne
542  Forum 2005-2010 (read only) / Interfacing / Re: I2C Interface help on: April 21, 2010, 03:52:57 am
hi!

here u can react on interrupts:
http://arduino.cc/en/Reference/AttachInterrupt

have u found this?
http://www.arduino.cc/playground/Learning/I2C

bye
arne
543  Forum 2005-2010 (read only) / Interfacing / Re: arduino on: April 21, 2010, 12:13:12 am
what did u use in the function setup()?
there should be something like Serial.begin(9600) or so...

u could just toggle the LED whenever a character is read... no matter what character it was...

-arne
544  Forum 2005-2010 (read only) / Interfacing / Re: arduino on: April 18, 2010, 04:05:58 am
1.
There is a SoftSerial class:
http://www.arduino.cc/en/Tutorial/SoftwareSerial
(maybe u have to vary the baud rate a little... +/- 10%)  :smiley

2.
U could do it urself... with fast direct port manipulation:
http://arduino.cc/en/Reference/PortManipulation

-arne
545  Forum 2005-2010 (read only) / Interfacing / Re: Making Sense of a Pressure Reading on: April 18, 2010, 03:48:53 am
oh - u wanted to know how to use the results of a voltage measurement?

just solve the equation to P:
P = (Vout/Vs + 0.04) / 0.004

the results of analogRead() (=X) r converted as follows:
Vx = (X+0.5) * Vref / 1024

example with Vref=5V and Vref=4.96V:
100.69kPa = ((368.5*5V/1024) / 4.96V + 0.04) / 0.004
99.97kPa = ((368.5*4.96V/1024) / 4.96V + 0.04) / 0.004

-arne
546  Forum 2005-2010 (read only) / Interfacing / Re: Making Sense of a Pressure Reading on: April 16, 2010, 04:54:20 am
Hey yo!

Just connect the output pin via a 10k resistor to an analog-in pin (ADC) and use analogRead() to read it?
http://arduino.cc/en/Reference/AnalogRead

Cheers, Arne
547  Forum 2005-2010 (read only) / Interfacing / Re: Detect optical pulse from water/gas/elec meters on: November 14, 2009, 03:40:45 pm
hi

1. transistor polarity:
i would just try both possibilities with a big resistor...

2. signal shaping:
maybe a voltage divider would help to reduce the output voltage?
or a bigger resistor between +5V and the transistor?
or an opamp?
here u find a motion sensor signal processor:
http://www.discovercircuits.com/I/infrared3.htm
http://www.glolab.com/pirparts/pirmanual.PDF

bye
548  Forum 2005-2010 (read only) / Interfacing / Re: Simple way to turn a DC motor on full and off? on: November 17, 2009, 02:53:50 pm
why not using MOSFETs?

they waste much less power and have a lower voltage drop...

-arne
549  Forum 2005-2010 (read only) / Interfacing / Re: code for IR sensor on: November 16, 2009, 08:24:28 am
possibly...
depends on the complexity of the language...
if it uses multiple IR colors, u can't learn it that way...

how will u connect ur IR sensor to pin #0?
maybe u will need a pullup resistor?
u can get one (20kR to 50kR) with "digitalWrite(14,HIGH);" in the setup() function...

-arne
550  Forum 2005-2010 (read only) / Interfacing / Re: code for IR sensor on: November 16, 2009, 08:09:17 am
this would do a 1000 sample/sec "scan" of analog pin #0: *wag tail*
Code:
uint16_t last;

void setup() {
  analogReference(DEFAULT);
  Serial.begin(500000);
  last = micros();
}

void loop() {
  const uint16_t now = micros();
  if (now - last < 1000)
    return;
  last += 1000;
  const int v = analogRead(0);
  Serial.println(v);
}

the output would be in a human readable format...
u need to read from the serial device at 500kBaud...

-arne
551  Forum 2005-2010 (read only) / Interfacing / Re: code for IR sensor on: November 16, 2009, 07:46:17 am
i c
so u need to "learn" the IR remote control language first...

i would do that like this:
1. tell arduino to listen to the IR sensor as fast as possible and send the readings via USB... that would be about 5kHz...
2. point the projector's IR remote control at the IR sensor and press the "play" button...
3. look at arduino's readings and find the pattern...
4. then u could try to produce the same pattern with ur IR light...

possibly ur IR light doesn't use the right IR "color"...  smiley

most likely u dont want to open the projector's IR remote control and "press" the "play" button with a BJT via arduino?

-arne
552  Forum 2005-2010 (read only) / Interfacing / Re: code for IR sensor on: November 16, 2009, 03:29:08 am
ok

how do u know what "language" the projector understands?

-arne
553  Forum 2005-2010 (read only) / Interfacing / Re: code for IR sensor on: November 15, 2009, 03:38:47 pm
hm

r u trying to mimic an IR remote control?

maybe u can find a cool circuit here:
http://www.discovercircuits.com/ ?

-arne
554  Forum 2005-2010 (read only) / Interfacing / Re: Capacitive sensing on: November 15, 2009, 07:02:21 pm
"conductive foam":
ICs stick in it sometimes...
so that voltages r removed from the pins in order to avoid ESD...

ur supplier gives it away for free possibly...  smiley-wink

-arne
555  Forum 2005-2010 (read only) / Interfacing / Re: Capacitive sensing on: November 15, 2009, 06:44:18 pm
this is the circuit, that i use at the MUX output:

and here r some ideas about my little project.

nota bene:
the electrode must be covered with an insulator,
so that in case of an accident nothing happens to ur finger.

the "pulse" contact is 0V for discharging the sensor plate ("finger")
(u can use a diode to accelerate that process).
the "pulse" contact is 5V for charging the sensor plate.

here is the code, that i use:
Code:
const uint8_t kbd_pln = 2; // pulse pin
const uint8_t kbd_sln = 7; // sense pin
const uint8_t kbd_mln = 3; // 3..6
  const uint16_t now = time();
  if (now - kbd_last < 1000)
    return;
  kbd_last = now;
  while (PIND & (1<<kbd_sln)); // be sure that we r half-ways ready
  noInterrupts(); // intr disabled
  PORTD |= 1<<kbd_pln; // pulse line HIGH
  uint16_t i = 0;
  while (!(PIND & (1<<kbd_sln))) // count
    if (!(++i))
      break;
  interrupts(); // intr enabled
// 12:329 11:331 10:335 9:328 8:331 7:331 6:313
// 5:320 4:324 3:329 2:324 1:329 0:319
  kbd_mux_line = (kbd_mux_line>0) ? kbd_mux_line-1 : (kbd_c-1); // select next kbd mux line
  PORTD = (PORTD&~((((1<<4)-1)<<kbd_mln)|(1<<kbd_pln))) | (kbd_mux_line<<kbd_mln); // pulse line LOW (discharge cap)

-arne
Pages: 1 ... 35 36 [37] 38 39 40