Show Posts
Pages: 1 ... 13 14 [15]
211  Using Arduino / Sensors / Re: Photo Interrupter, high readings, low variation on: June 23, 2012, 03:56:36 pm
ehm i'm a beginner to arduino, but a handy programmer
you like the output to be down, and up once in a while ?

Hm besides that i think you would find this command interesting in Arduino
 duration = pulseIn(pin, HIGH);  // minimal measurement time is about 30  ~ 50 micros = ..?. HZ = ..?. RPM

if would measure the microseconds of how long you have a high signal or the time of a rotation,
wich you might calculate as RPM and return to your computer over serial

another way to solve it might be

trigerval = 960;
val = digitalRead(inPin); //usualy a high value
if (val < trigerval){  dostuff() ;} else{ donothing() ;}


Notice however the speed of your arduino (16 mhz?) and the speed of your code, if your motor goes to fast, you might get strange reading
because the dostuff() takes longer then a cycle of your motor
i once made a program that used a timer delay value based on a LDR and then report it to my computer; in my case the arduino had no problem, however the serial connection of 9600 baud wasnt fast enough to keep up with my program loop and so the com3 connection got lost.
what i mean to say the things you measure should be in within working bounderies or you get strange readings
212  Using Arduino / Sensors / book "getting started with arduino" wrong schematic inside ? on: June 23, 2012, 03:28:47 pm
The book getting started with arduino contains on page 65 a drawing on how to connect an arduino for serial input
I am not deeply into electronics but to me this drawing seams wrong, the reason i conclude that is, the Arduino has 4 anolog inputs
the way it is connected here would not allow to add more analog inputs see :


So what i am thinking is was the wiring sketch to the LDR crossed perhaps ?.
If i want to use 2 LDR's should i then use :

   5v --LDR (2)-----------analog 1
   |                                   
--5v --LDR (1)-----------analog 0
   |
   5v - resistor 1Kohm---- ground

i'm not entirely sure i or why there should be a 1K ohm between 5v and ground, maybe its for protection, i dont know why the book uses one
well maybe someone can enlight me on this on how to connect multiple analog sensors in a schematic
Pages: 1 ... 13 14 [15]