Show Posts
Pages: 1 ... 14 15 [16] 17 18
226  Using Arduino / General Electronics / Re: How do I hardwire my Arduino circuit? on: February 17, 2011, 05:38:20 pm
Thanks, that's exactly what I needed. I did use the search box, but did not use the word "standalone" and was stymied.

UPDATE: The Really Bare Bones Board kit mentioned in the Playground post looks ideal for me. I'll probably use that.
227  Using Arduino / General Electronics / How do I hardwire my Arduino circuit? on: February 17, 2011, 04:44:57 pm
My device now works on the breadboard, with wires running to the Arduino. Now I want to wire the circuit up and install it. It's not a complicated circuit, so I plan to use perforated circuit board and soldering wires rather than making a printed circuit board.

What do I need to replace the Arduino in the circuit besides just the ATMega chip? I'm using the SPI pins and some of the digital and analog pins. But nothing like the USB port or the like.

Thank you.
228  Using Arduino / General Electronics / Re: Buy an arduino kit or buy seperate componenets? on: February 17, 2011, 04:19:10 pm
I bought the Earthshine kit, and have been very happy with it. The tutorial is excellent, and I did all the projects.

The only problem was that I am in the US, and Earthshine only has the 9V adapters with British and European plugs. So I had to buy a new one of those.
229  Using Arduino / General Electronics / Re: What I learned today: Flux is awesome! on: February 13, 2011, 01:42:15 pm
Quote
Desoldering braid is definitely a must-have. When you need it, you NEED it.

That's probably true. If you do a lot of soldering, you should have some braid.

And I do have some braid. But I've never used it. Never needed it. I do, on the other hand, use my "solder sucker" bulb pretty much every time I solder. It's a very handy device. I would never solder without it.

I might mention, too, that I never have attempted to solder a surface mount device. Probably never will. As noted, I suspect braid would be much better for that.
230  Using Arduino / General Electronics / Re: Embedded PC Won't Boot With Arduino? on: February 13, 2011, 01:23:22 pm
I'm using an Arduino plugged into (via a USB cable) and thus powered by a BeagleBoard running Ubuntu Linux. It boots up fine.

I suspect it's a problem with your BIOS. When a computer boots up, sometimes it tries first to boot from a USB port, thinking that there is a pendrive or hard disk there to boot from. When it finds something on the USB port,even though that something is not a boot device, it hangs.

I've had that happen to me in Windows with a USB wireless mouse dongle. I've not had it happen in Linux. But I suspect that may be your problem.
231  Using Arduino / Programming Questions / Re: Analog to PWM question on: February 11, 2011, 04:40:10 pm
Interesting problem. I don't see any reason in your code for this. Have you used the serial monitor to check values right at the flicker point? It's a little hard to debug that way. But you can set up your input to change from, say, 0V to 0.1V, and then in your code check for that transition. Then print out values to see if you catch anything odd.

My gut feeling, though, is that it sounds like an input problem rather than an output problem. Can you tell if the slight flicker is going to high or going to low? Does the only flicker happen right at the transition stepping up 0.1V?

Finally, are you sure your source of from 0V to 10V is rock steady at the transition point? If it is a wire-wound potentiometer, sometimes they give a transient as the wiper makes the step from one wire to the next. You might be able to catch that by filtering your input using software, as cmroanirgo suggests. I've got a software low-pass filter written up if you need the code.

EDIT: I assume your RC low-pass filter is on your PWM output, not your input. Is that correct?
232  Using Arduino / General Electronics / Re: Powering an Arduino from a car battery on: February 07, 2011, 10:43:45 pm
Thanks for the advice, both of you. That's helpful.

My plan is not to have the Arduino run much. Just take some digital input from the USB port and send some analog signals based on the input. The analog signals will be perhaps a few milliamps. So that should not be a problem.

But I will have some DC motors (three windshield wiper type motors) and some headlights and turn signals that will also draw power from thr battery. So maybe I will run the 12V power through a switching voltage regulator and put some filtering capacitors-resistors on the power input line. If your experience with raw vehicle batteries has been dicey, that's a reason to be careful.
233  Using Arduino / General Electronics / Powering an Arduino from a car battery on: February 06, 2011, 03:31:25 am
My project will use an Arduino Duemilanove on an electric car. I will power the Arduino and some other electronics (mainly headlights and signal lights) with a deep-discharge 12 Volt lead-acid battery. Can I just tap into the battery wiring to power the Arduino? Or should I regulate the voltage or drop it down to a lower voltage?
234  Using Arduino / General Electronics / Re: Can't get a digital potentiometer to work on: January 31, 2011, 07:17:28 pm
I do seem to be getting repeatable responses. The potentiometer does not seem to have been ruined.

I'm thinking that my SPI codes may be incorrect. I'm supposed to send 10-bit commands. Perhaps by sending them as two 8-bit words I am screwing up the order of the bits.

I'm not able to experiment further right now, but will later. Maybe better luck then.
235  Using Arduino / General Electronics / Re: Can't get a digital potentiometer to work on: January 31, 2011, 04:39:34 pm
1) You did not mention where you have the "low" side of the potentiometer connected. Should be GND. Else you will read noise. (which you are doing)
2) You did not mention where you have the "high" side of the potentiometer connected. Should be +5V.  Else you will read noise. (which you are doing)
3) You mentioned that you have the wiper connected to an Arduino analog input, plus a 2.5K ohm resistor to GND.   
a) You have no reason for this resistor, and I see none, at least from what you have revealed. Remove it.
b) That resistor will dramatically overload the output impedance of the pot and you will NEVER read the kind of voltages you are expecting.

Thanks for the reply.
1) I had the low side of the potentiometer floating. I have now connected it to GND.
2) I had the high side of the potentiometer already connected to +5 Volts.
3) I removed the 2.5k Ohm resistor.

The data still looks rather like noise.

Code:
Pot Level:  0 Pot Value:  4
Pot Level:  10 Pot Value:  1023
Pot Level:  20 Pot Value:  1023
Pot Level:  30 Pot Value:  455
Pot Level:  40 Pot Value:  4
Pot Level:  50 Pot Value:  5
Pot Level:  60 Pot Value:  1023
Pot Level:  70 Pot Value:  1023
Pot Level:  80 Pot Value:  1023
Pot Level:  90 Pot Value:  1023
Pot Level:  100 Pot Value:  1023
Pot Level:  110 Pot Value:  1023
Pot Level:  120 Pot Value:  1023
Pot Level:  130 Pot Value:  1023
Pot Level:  140 Pot Value:  1023
Pot Level:  150 Pot Value:  1023
Pot Level:  160 Pot Value:  1023
Pot Level:  170 Pot Value:  1023
Pot Level:  180 Pot Value:  1023
Pot Level:  190 Pot Value:  1023
Pot Level:  200 Pot Value:  337
Pot Level:  210 Pot Value:  4
Pot Level:  220 Pot Value:  217
Pot Level:  230 Pot Value:  1023
Pot Level:  240 Pot Value:  1023
Pot Level:  250 Pot Value:  1023

Pot Level:  255 Pot Value:  1023
Pot Level:  245 Pot Value:  1023
Pot Level:  235 Pot Value:  1023
Pot Level:  225 Pot Value:  1023
Pot Level:  215 Pot Value:  1023
Pot Level:  205 Pot Value:  1023
Pot Level:  195 Pot Value:  1023
Pot Level:  185 Pot Value:  1023
Pot Level:  175 Pot Value:  1023
Pot Level:  165 Pot Value:  1023
Pot Level:  155 Pot Value:  1023
Pot Level:  145 Pot Value:  1023
Pot Level:  135 Pot Value:  1022
Pot Level:  125 Pot Value:  1023
Pot Level:  115 Pot Value:  378
Pot Level:  105 Pot Value:  4
Pot Level:  95 Pot Value:  5
Pot Level:  85 Pot Value:  1023
Pot Level:  75 Pot Value:  1023
Pot Level:  65 Pot Value:  1023
Pot Level:  55 Pot Value:  312
Pot Level:  45 Pot Value:  4
Pot Level:  35 Pot Value:  4
Pot Level:  25 Pot Value:  1023
Pot Level:  15 Pot Value:  1023
Pot Level:  5 Pot Value:  299
Pot Level:  0 Pot Value:  4
Pot Level:  10 Pot Value:  1023
Pot Level:  20 Pot Value:  1023
Pot Level:  30 Pot Value:  1023
Pot Level:  40 Pot Value:  1022
Pot Level:  50 Pot Value:  314
Pot Level:  60 Pot Value:  4
Pot Level:  70 Pot Value:  4
Pot Level:  80 Pot Value:  1023
Pot Level:  90 Pot Value:  1023
Pot Level:  100 Pot Value:  1023
Pot Level:  110 Pot Value:  1023
Pot Level:  120 Pot Value:  1023
Pot Level:  130 Pot Value:  1023
Pot Level:  140 Pot Value:  1023
Pot Level:  150 Pot Value:  1023
Pot Level:  160 Pot Value:  1022
Pot Level:  170 Pot Value:  373
Pot Level:  180 Pot Value:  4
Pot Level:  190 Pot Value:  3
Pot Level:  200 Pot Value:  1023
Pot Level:  210 Pot Value:  1023
Pot Level:  220 Pot Value:  1023
Pot Level:  230 Pot Value:  1023
Pot Level:  240 Pot Value:  1022
Pot Level:  250 Pot Value:  1023

Perhaps I have ruined the potentiometer with my tinkering.
236  Using Arduino / General Electronics / Can't get a digital potentiometer to work on: January 31, 2011, 04:05:44 pm
I'm trying out a different digital potentiometer. A month ago some people on this forum helped me out with another digital potentiometer that worked fine, but had some linearity issues. Now this one does not work at all.

The potentiometer is an Analog Devices AD 8402A10, which is 0 to 10k Ohms in 255 steps. The data sheet is: www.analog.com/static/imported-files/data_sheets/AD8400_8402_8403.pdf

I use the following code to step the potentiometer through steps of 10 up to 250, then down from 255. The output measured by running a wire from the wiper to an Arduino analog input pin. That same wiper pin has a 2.5 k Ohms resistor connected to ground.

Code:
// include the SPI library:
#include <SPI.h>
#define potInputPin 0

// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;
int potValue;

void setup() {
    // start serial port at 9600 bits per second
  Serial.begin(9600);

  // clear the serial port buffer
  Serial.flush();
// set the slaveSelectPin as an output:
  pinMode (slaveSelectPin, OUTPUT);
  // initialize SPI:
  SPI.begin();
}

void loop() {
    // change the resistance from min to max:
    for (int level = 0; level < 255; level = level + 10) {
      digitalPotWrite(0, level);
      Serial.print("Pot Level:  ");
      Serial.print(level);
      Serial.print("\t");     
      delay(1000);
      potValue = analogRead(potInputPin);
      Serial.print("Pot Value:  ");
      Serial.print(potValue);
      Serial.print("\n");     
    }
    // wait a second at the top:
    Serial.print("\n");     
    delay(1000);
    // change the resistance from max to min:
    for (int level = 0; level < 255; level = level + 10) {
      digitalPotWrite(0, 255 - level);
      Serial.print("Pot Level:  ");
      Serial.print(255 - level);
      Serial.print("\t");     
      delay(1000);
      potValue = analogRead(potInputPin);
      Serial.print("Pot Value:  ");
      Serial.print(potValue);
      Serial.print("\n");     
    }
     delay(1000);
 }

int digitalPotWrite(int command, int value) {
  // take the SS pin low to select the chip:
  digitalWrite(slaveSelectPin,LOW);
  //  send in the value via SPI:
  SPI.transfer(command);
  SPI.transfer(value);
  // take the SS pin high to de-select the chip:
  digitalWrite(slaveSelectPin,HIGH);
}


The Arduino analog input pin shows no sign of a step change. It bounces around between a few values, but there seems no rhyme or reason to them.

Any thoughts?

237  Using Arduino / Programming Questions / Re: adding decimal points and zero padding for display. on: January 31, 2011, 02:11:43 pm
Sounds like you may be bumping into the upper limit for an unsigned integer, which is 65,535.

Quote
Unsigned ints (unsigned integers) are the same as ints in that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).
238  Using Arduino / Programming Questions / Re: adding decimal points and zero padding for display. on: January 31, 2011, 01:49:04 pm
Here is an example of the output. Notice the first value is unique, then it oscillates around at some other odd numbers..

Where is that output from? The problem seems to be with your Serial.println(withDot); statement. I ran the other code and it generates exactly what you want it to. That is, you get a character array withDot that has the following in it:
Code:
- withDot 0x001ff7d0 "01.238" char [7]
[0] 48 '0' char
[1] 49 '1' char
[2] 46 '.' char
[3] 50 '2' char
[4] 51 '3' char
[5] 56 '8' char
[6] 0 char
239  Using Arduino / Programming Questions / Re: weird calculation issue on: January 28, 2011, 04:39:39 pm
Quote
is there an easy way to convert a float value to a char array?

This may work: http://www.arduino.cc/playground/Main/FloatToString
240  Using Arduino / Programming Questions / Re: weird calculation issue on: January 28, 2011, 03:03:05 pm
You are right, your types are not consistent.

Quote
  stepAmount = (radius/360)*(wholeTurn/wheelCircumference)*1600*gearRatio;

This will do integer arithmetic, I think. Should be 360.0 and 1600.0 instead.

Quote
float gearRatio = 11/3;

Also, this should be 11.0/3.0

Quote
void doTurn(double radius){ //turn around certain radius

This radius should be float instead of double.
Pages: 1 ... 14 15 [16] 17 18