Loading...
  Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 48
586  Using Arduino / Sensors / Re: stuck on what type of sensor to use here. on: June 23, 2012, 06:36:09 pm
Shaft encoders don't need to be directly on the shaft that is being measured. You can drive them through gears or a belt (toothed preferably to minimise slippage) from the main shaft onto a secondary shaft in a more conviennt location.

If you have less than 360 dgeree rotation then maybe a pot will be sufficient - measure the resistance/voltage on the pot to infer the angle - but accuracy may be an issue if you are trying to accuratley position the robot arm.
587  Using Arduino / Sensors / Re: stuck on what type of sensor to use here. on: June 23, 2012, 05:22:37 pm
For something like this you would generally have a sensor at key positions of the travel (say the beginning and the end of the cam rotation). The start of the movement should pass the first detection point to confirm a movement, a timer is then started and if the second detection point is not reached within a predetermined time then something has gone wrong.

This scheme may not work in your case as I am not sure why you are trying to detect the movement. If you want to know the exact (actual) position of the movement, then you need a shaft encoder of some sort.
588  Using Arduino / Sensors / Re: stuck on what type of sensor to use here. on: June 23, 2012, 05:13:58 am
Proximity sensor picking up the bolt head or other metal part?
589  Using Arduino / LEDs and Multiplexing / Re: Ping pong wih LED matrix on: June 21, 2012, 08:44:07 pm
Chapter 9 in that tutorial series also has how to use pots...
590  Using Arduino / LEDs and Multiplexing / Re: Ping pong wih LED matrix on: June 21, 2012, 07:58:16 pm
Quote
And I don't know if it's normal, but the code is running automatically, without Arduino software.

Can you explain this better? The compiler code dowloaded into the AVR processor will execute as soon as you apply power to the board. The IDE (is this the "Arduino software"?) running on your computer is not required for this to happen.

Are you able to write a small program to test the pots work properly as connected? Just read the analog value and print it to the Serial port so you can see if rotating the knob changes the value.
591  Using Arduino / LEDs and Multiplexing / Re: Ping pong wih LED matrix on: June 21, 2012, 06:33:36 pm
It was hard to tell from the previous photo...
592  Using Arduino / LEDs and Multiplexing / Re: Ping pong wih LED matrix on: June 21, 2012, 05:44:03 pm
It looks like your pots are connected on the outside pins of the pot. You need to connect the middle pin and one of the outside pins.

A pot is a variable resistor with the middle of the 'wiper' connected at the center. When you rotate one way or the other the wiper moves in the resistor so that you get a different value on the two outer pins that add up to total rating for the pot (ie, it is a variable voltage divider).
593  Using Arduino / General Electronics / Re: Convert LDR's resistance to lux, or another unit of light? on: June 21, 2012, 05:39:21 pm
Do you know anyone who is a photographer? Their light meters are 'lux meters' ...
594  Using Arduino / General Electronics / Re: Convert LDR's resistance to lux, or another unit of light? on: June 21, 2012, 05:27:02 pm
To calibrate the sensor you will need to build a relationship between the reading you get and a lux value you measure externally with some sort of instrument/meter. This will allow you to build a table of redings/lux.

What you can then do with this is:
1. Use the table in your code and extrapolate between values (eg, table value for reading 10 and 20, you get 15 and interpret the lux value as being between the values for 10 and 20).
2. Put the numbers into something like Excel, see if the relationship can be defined as a function (Excel will allow you to work out the parameters) and then use the function 'formula' to get the lux from reading.

The second methnid can work if the relationship is well expressed by the function. The first is easiest to implement immediately. Either way you need to build the relationship table.
595  Using Arduino / Programming Questions / Re: Looking for best way to create HashTable for lookup data on: June 21, 2012, 04:45:37 pm
Quote
A perfect lead in to Minimal Perfect Hashing...

Looks really interesting. Thanks.
596  Using Arduino / Programming Questions / Re: Next item in array (rollover) on: June 21, 2012, 06:41:01 am
A simple way is to make the array one element bigger than you need and put a zero in it. That way there is no 'special' case to consider.
597  Using Arduino / General Electronics / Re: From breadboard to perfboard on: June 21, 2012, 06:39:38 am
Think about running the horizontal and vertical parts of the paths on two different sides of the board.
598  Using Arduino / Programming Questions / Re: Making the LED brighter on: June 20, 2012, 10:50:53 pm
You should probably use a different pin and resistor. Something line 200 ohm should be safe for most LEDs.

Also, I just noticed that you are not setting the Led pin to OUTPUT in setup?
599  Using Arduino / Programming Questions / Re: Pin State Changes on: June 20, 2012, 10:49:25 pm
You need to save the state of the pins the last time you checked:

if pin is high and last time pin was low
  do stuff
600  Using Arduino / Programming Questions / Re: Need help with programming on: June 20, 2012, 10:48:08 pm
Your first if is ok but your second if statement should be in the else part of the first because the logic you want can be restated as:

if ls1 input is on for 200ms then
  if ls2 is off
    turn on led 1
  else
    wait 2800ms
    if ls1 is still on
       turn on led1
Pages: 1 ... 38 39 [40] 41 42 ... 48