Show Posts
Pages: [1] 2 3
1  Using Arduino / General Electronics / Re: making a potentiometer with paper? on: April 13, 2013, 07:06:37 am
This means that you are unlikely to get a linear relationship between distance and resistance.

Thanks for the reply! My paper is actually pretty uneven smiley-lol .I guess the relationship won't be linear then. I might have to find another way to determine the distance then smiley-sweat . IR LEDs anyone? smiley-lol
2  Using Arduino / General Electronics / Re: making a potentiometer with paper? on: April 09, 2013, 05:02:05 pm
I tried plotting with yet another piece of paper. The total resistance was 29k this time. It had a grid printed on the back, so it was easier to divide into sections. There were 15 equidistant marks, with the ground at 0 and 5V at 14. I measured each mark 4 times, and plotted the average.The image shows the graph of the averages. The reading on mark 0 shows almost no variance, while it increases to ~45 on mark 4, then decreases to ~21 on mark 7, suddenly becomes 38 at mark 8, and again decreases, to ~13 on mark 13 and again,almost 0 on mark 14. Varience here is the difference between lowest and highest reading(more like the range of deviation). Sources of error could be, first, the Arduino itself; since it was reading about 200 even when there was nothing on. Also, I used alligator clips to hold the contacts in place, and they have pointy teeth which were digging into the paper. I am not sure if that could have actually affected the resistance much(there's smaller contact area),but still.... Also,the paper was not held perfectly straight. It kinda formed an arch while taking a few readings(about 4 marks?), so that could have affected the readings. But the readings were not very different in this case, so I guess it did not really make much difference. This is my first time doing anything like this, so I might suck at it. Please excuse my stupidity and thanks for the replies!  smiley
3  Using Arduino / Microcontrollers / Re: a PIC for arduino? on: April 08, 2013, 10:25:38 pm
thanks for the replies!
thanks for the suggestions too!again chipkits and PICKITs are not available here,and are expensive,so i'll look for another alternative smiley-lol .i thought that since a big part of the board/pic/whatever i was going to make was going to be dependent on the arduino platform,it'd be right to ask it here.i'd be more careful next time.  smiley
4  Using Arduino / General Electronics / Re: making a potentiometer with paper? on: April 08, 2013, 10:17:12 pm
Thanks for the replies!
I measured it, and for the piece of paper paper I was using(the blackened one), it came out to be near 15k. The intended impedance for inputs of arduino ADC is 10k or less. So that might be the source of error.
Would it help if I could reverse the polarity and and take a reading then? For example, if the relation was (reading)=(position/total width)*(1024)*(1-e), where e is a constant, I could just add the readings of original polarity and the reversed polarity,and divide it by 1024 to get (1-e). Dividing the original reading with (1-e), I would get the correct reading(but this example is linear too smiley-cry ). For values near the extremities, it might help me get the values. Also, what kind of relationship is it going to be?
5  Using Arduino / Microcontrollers / a PIC for arduino? on: April 08, 2013, 07:20:10 am
hello!
i am searching for a way to make a PIC based board that can be programmed like arduino(like with arduino IDE).i know that there are some basic differences between the avr and the pic,but i am kinda desperate here(local shopkeepers keep only pic's and ordering an arduino would be way too costly).i googled it and read about some of the boards available,but only got more confused.is it possible to make a board based on pic,but can be progammed with arduino IDE?if yes,how can i do that?are there any good tutorials there?and if not,is there any alternative to that?also,can an existing arduino board(arduino uno in my case)be used as the programmer?(or even better;direct connection with usb?)
please reply.any help appreciated.
6  Using Arduino / General Electronics / Re: making a potentiometer with paper? on: April 08, 2013, 06:58:15 am
I really cannot say what it is about,but I googled it and found a few papers on it. It seems that the experiment was used to study flow of electric charges through different conductors and the conductive paint was used as a sample(and assumed that it was a cross-section of the desired 3D object. So for a cylinder,it would be a circle). Did you mean that?
I do not know much about impedance either, but wikipedia says that it is a bit like resistance, and I am using a plain wire for the probe, so it should be zero for my probe.
How would Kirchoff's law help here? Please reply.
7  Using Arduino / General Electronics / Re: making a potentiometer with paper? on: April 07, 2013, 10:57:26 am
Thanks for the replies! I am making a pen tablet from scratch, and since I am a bit short on electronic components(I am pretty much the only electronics hobbyist in about a 50 mile radius), I need to keep it as simple as possible. Is there any other alternative method I could use?

For resolution, I am thinking of dividing the whole area into parts and measuring each of them individually. But that would require an lot of sensing and digital writes. Would the Arduino be able to track the whole process fast enough for it to be a smooth experience(each sample would take about 12 digitalWrites and 3 analogReads)?

Would the paper not hinder such quick switching of electric potential across it?

Please reply.Any help appreciated.
8  Using Arduino / General Electronics / making a potentiometer with paper? on: April 07, 2013, 07:50:08 am
Hi! I have been trying to make a potentiometer with a paper, but it doesn't work. I took a strip of paper, attached two alligator clips to the two ends, connected them to 5V and ground respectively, and used a wire connected to analog input as the probe. But all it did was detect contact with the paper, and the read value did not change with position. I suspected that the resistance might be too high, so I blackened it with a pencil, and it worked. But even then, it was not really perfect. It worked fine for the values near the ground, but not for those near the 5v. For example, even the the wire was really close to the 5v clip, it only went up to about 900(when the read value should be near 1024). Is high resistance the cause of this too? And is it even possible to use non-blackened paper as a potentiometer? Also, if it is, how can I do it? If it is not possible, are there any alternatives? any precautions I should be taking?
9  Using Arduino / Motors, Mechanics, and Power / using a hard drive motor with arduino? on: April 01, 2012, 10:46:50 pm
recently i opened up a hard drive,and recovered a motor from it.the motor has 4 terminals.i am planning to use the motor for a project.how should i do it?do i need some additional circuitry,or just the arduino will be fine enough?i guess i might at least need motor drivers.
10  Using Arduino / Interfacing w/ Software on the Computer / Re: processing not reading serial data correctly?? on: March 29, 2012, 06:13:14 am
yeah,dxw00d is right.serial.available should be used.also,in my arduino code,i should have used serial.write. i did this and problem solved!!thanks!!!!
11  Using Arduino / Interfacing w/ Software on the Computer / Re: processing not reading serial data correctly?? on: March 28, 2012, 01:16:28 pm
so,what should i do?
12  Using Arduino / Interfacing w/ Software on the Computer / Re: processing not reading serial data correctly?? on: March 28, 2012, 10:17:39 am
arduino code:
Code:
// 0.1 by pmalmsten http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1176098434
// 0.2 by farkinga
// 0.3 by farkinga - adds cool behaviors

#define IR_BIT_LENGTH 12    // number of bits sent by IR remote
#define BIT_1 1000          // Binary 1 threshold (Microseconds)
#define BIT_0 400           // Binary 0 threshold (Microseconds)
#define BIT_START 2000      // Start bit threshold (Microseconds)

#define IR_PIN 7            // Sensor pin 1 wired through a 220 ohm resistor
#define LED_PIN 9           // first LED output
#define POWER_PIN 11        // second LED output, corresponds to power button

#define DEBUG 0             // Serial connection must be started to debug

int runtime_debug = 0;      // flag to output raw IR pulse data
int output_key = 0;         // flag to print decoded key integers
int power_button = 0;       // flag to indicate if power LED is on
int power_level = 128;      // value (0-255) for power LED intensity

void setup() {
  pinMode(LED_PIN, OUTPUT); //This shows when we're ready to recieve
  pinMode(POWER_PIN, OUTPUT); //This is the "power on" indicator
  pinMode(IR_PIN, INPUT);
  digitalWrite(LED_PIN, LOW);
  Serial.begin(9600);
  Serial.println("ready to decode!!");
}

void loop() {
  int key = get_ir_key();
  Serial.println(key);
  delay(200);
 pinMode(8,OUTPUT);
  digitalWrite(8,LOW);
  pinMode(9,OUTPUT);
  digitalWrite(9,HIGH);  // short delay to cancel duplicate keypresses
}

/*
  wait for a keypress from the IR remote, and return the
  integer mapping of that key (e.g. power button on remote returns
  the integer 1429)
*/

int get_ir_key()
{
  int pulse[IR_BIT_LENGTH];
  int bits[IR_BIT_LENGTH]; 

  do {} //Wait for a start bit
  while(pulseIn(IR_PIN, LOW) < BIT_START);

  read_pulse(pulse, IR_BIT_LENGTH);
  pulse_to_bits(pulse, bits, IR_BIT_LENGTH);
  return bits_to_int(bits, IR_BIT_LENGTH);
}

/*
  respond to specific remote-control keys with different behaviors
*/


/*
  use pulseIn to receive IR pulses from the remote.
  Record the length of these pulses (in ms) in an array
*/

void read_pulse(int pulse[], int num_bits)
{
  for (int i = 0; i < num_bits; i++)
  {
    pulse[i] = pulseIn(IR_PIN, LOW);
  }
}

/*
  IR pulses encode binary "0" as a short pulse, and binary "1"
  as a long pulse.  Given an array containing pulse lengths,
  convert this to an array containing binary values
*/

void pulse_to_bits(int pulse[], int bits[], int num_bits)
{
  if (DEBUG || runtime_debug) { Serial.println("-----"); }
 
  for(int i = 0; i < num_bits ; i++)
  {
    if (DEBUG || runtime_debug) { Serial.println(pulse[i]); }
   
    if(pulse[i] > BIT_1) //is it a 1?
    {
      bits[i] = 1;
    } 
    else if(pulse[i] > BIT_0) //is it a 0?
    {
      bits[i] = 0;
    }
    else //data is invalid...
    {
      Serial.println("Error");
    }
  }
}

/*
  convert an array of binary values to a single base-10 integer
*/

int bits_to_int(int bits[], int num_bits)
{
  int result = 0;
  int seed = 1;
 
  //Convert bits to integer
  for(int i = 0 ; i < num_bits ; i++)
  {  
    if(bits[i] == 1)
    {
result += seed;
    }
   
    seed *= 2;
  }
 
  return result;
}


processing code:
Code:
import processing.serial.*;
Serial serial;
void setup(){
  serial = new Serial(this, "COM8", 9600);
}
void draw(){
 if ( serial.read() > 0) {
    println(serial.read());       
  }
}



actually,what i dont know is what conversion to perform.
13  Using Arduino / Interfacing w/ Software on the Computer / Re: processing not reading serial data correctly?? on: March 28, 2012, 09:44:48 am
the problem is in data type conversion.it converts 244 into 52,13,-1
14  Using Arduino / Interfacing w/ Software on the Computer / processing not reading serial data correctly?? on: March 28, 2012, 06:57:16 am
my arduino sends data over serial(usb) port.but there is a problem.for example,when i read it in arduino serial monitor,it is 244,however,when i read it in processing, it is 52
13
-1
i can't understand what is the problem,and how to solve it.

15  Using Arduino / Microcontrollers / Re: what is all this programmer and bootloader stuff??? on: March 25, 2012, 05:19:12 am
no no no....you've gotten me all wrong.actually,this is what i am going to do.
users will stick two sensors on their monitor's bottom left and bottom right corners.the sensors will sense the position and give the info to the main circuit.this circuit will be an HID and will change the position of mouse cursor and clicks accordingly.now the cost for production will be cost of atmega+50rs or +60rs max.cost of packaging,i dont know but still, must not be more than 40 rs.even if atmega is 200rs,then total cost price is 300rs.selling price is 500rs so,rs200 pure profit. smiley-twist i am the developer kind of person,not a businessman type.any guides? smiley-grin
Pages: [1] 2 3