Show Posts
Pages: 1 ... 3 4 [5]
61  Forum 2005-2010 (read only) / Troubleshooting / Re: Damaged Duemilanove on: January 18, 2010, 01:30:54 pm
Yes, port is correct. I definitely have hardware damage, other boards work perfectly.
62  Forum 2005-2010 (read only) / Troubleshooting / Re: Damaged Duemilanove on: January 18, 2010, 03:38:29 am
Thanks, the PC registers an "FTDI USB Serial Device converter" but there's no reply to chars from the IDE's serial monitor. Oh well, time for a new board.
63  Forum 2005-2010 (read only) / Troubleshooting / Damaged Duemilanove on: January 17, 2010, 06:27:12 pm
Hello, in a spectacularly boneheaded move, I have damaged my Duemilanove board. I absentmindedly connected 17 volts to the breadboard +- lines while forgetting the Arduino GND and +5V were also connected at the other end. I realised something was wrong as soon as the power LED lit up on the Arduino and I immediately disconnected but it was exposed to the voltage for a second or two.

Now, when I connect to the computer the power LED lights up and when I upload sketches the RX blips but nothing further happens and eventually I get a "programmer is not responding". Is there a chance I might have burnt something minor and replaceable on the board? Are there any simple steps I can follow to find that out? Or should I simply not bother and get a new one?
64  Forum 2005-2010 (read only) / Interfacing / Re: Decoding Radio Control signal pulses on: December 30, 2009, 07:40:18 pm
Very nice tool thanks a lot. One quick question, in the first post you 're talking about "an RC receiver that provides access to the pulse stream". What manner of beast is this? I 've played a bit with RC at various stages and I don't think I 'ever seen a receiver that offered anything except a normal servo plug for each channel. Is it a feature that I perhaps have missed? Do most manufacturers make them? How do I go about getting one? What do I ask for?
65  Forum 2005-2010 (read only) / Interfacing / XBee transmission via Processing on: May 24, 2010, 04:40:24 am
Hello forum, I am running into some strange behaviour trying to set up comms via XBee. My setup is as follows:

- laptop connected to XBee Explorer (USB).
- XBee Explorer mounted with XBee series 2, running as Coordinator (AT), with ATRO (packetization timeout) set to 0, with its destination address (DL and DH) set to the address (SL and SH) of the Arduino based XBee.

- Arduino (Mega) with XBee shield.
- XBee on shield set up as Router/end device AT, ATRO set to 1 (was getting errors with 0 but can't remember what they were at the moment), and its DL and DH set to the the respective SL and SH values of the coordinator.

I have set up a simple protocol in the Arduino, a linefeed in the input buffer signals a full command sentence. A command sentence consists of a command byte followed by a string coding for a numeric value. So, for example, to send a steering command for numeric value -10 (command byte 'b') we send "b-10" followed by a newline.

Now, all this works absolutely fine when done manually from a terminal (I use GtkTerm). Processing, on the other hand, runs into a hell of a lot of trouble. Look at the following code snippet:

  String s;

  s = new String("b" + steering + "\n");
  print("Sending:" + s);


  s = new String("c" + throttle + "\n");
  print("Sending:" + s);

where "steering" and "throttle" are int variables to be transmitted.

This code works only by sticking the delay in there. Trying to squeeze the two command sentences closer (either by ommiting the delay or by dumping them into the same string) results in garbage read by the Arduino (which helpfully echoes what it receives).

To make matters more weird, this works when in the Processing code's "mousePressed()" method (initially tried it so that the coordinates of mouse presses in the window would correspond to throttle and steering values). However, when I renamed the method so that it gets called at set intervals (large ones, half a second to five seconds) to update the remote values, all hell breaks loose. The arduino reads garbage, sentences are omitted or truncated or parsed improperly. Sometimes, the Arduino resets  :o, which I can tell because I have included a "Hello world" in its setup() which it spits out occasionally.

I really can't figure out what the problem might be but it must have something to do with the Processing/XBee interface. Any ideas?
66  Forum 2005-2010 (read only) / Interfacing / Re: Cutting ADC input voltage down to size on: January 15, 2010, 10:27:31 am
One more question regarding protecting the Arduino ADC. Its max voltage is 5 Volts. To be on the supersafe side, I take the line that goes to the ADC pin and branch it off to a zener that ends at GND. Then, by adding a fuse before the branching we can ensure that it will blow once a big current starts flowing (when the zener floodgates open).

Now, two questions. How much voltage can an ADC pin take before something terrible happens? My zeners have a breakdown voltage of slightly above 5V. I take it a little bit of overvoltage for a little while won't be a problem, right?

Second question, what should the fuse rating be? Exactly the size needed to protect the zener given its max power dissipation? Less?
67  Forum 2005-2010 (read only) / Interfacing / Re: Cutting ADC input voltage down to size on: January 15, 2010, 08:36:12 am
Aha, thanks a lot for the link, I got it now. For the switching, I 've found a SIL05-1A72-71L that's cheap and does the job. Now I 'll have to do some reading on the null and difference measurement.
68  Forum 2005-2010 (read only) / Interfacing / Re: Cutting ADC input voltage down to size on: January 13, 2010, 03:56:33 am
Ooops, sorry, I should have said AC-DC adapter (with multiple output voltages) but it got lost in translation in my head.
69  Forum 2005-2010 (read only) / Interfacing / Re: Cutting ADC input voltage down to size on: January 12, 2010, 03:08:35 pm
Hey there, hard to get op-amps so had a go with some transistors with mixed results.

For a start, I tried measuring a DC voltage from a transformer but with a transistor in the way. I got good some results with a PNP transistor (BC640):

Connecting the Emitter to the voltage to be measured (ranging from 3.9V to 17.8V), the Collector to the voltmeter positive terminal and the Base to GND via a 12k resistor, I got a perfect match between measured voltage and voltage at the transformer terminals. A bit suspiciously perfect in fact, not much evidence of a voltage drop. Connecting the Base to the positive transformer terminal completely cut off the voltage.

Now, I tried substituting the transistor Base input with a digital pin from the Arduino and got some weirdness. At the lowest voltages the transformer provides, 3.9V, the pin succesfully switches the transistor on and off (on when it's LOW and vice versa). At the next higher voltage, 5.7V, the voltmetre correctly reads 5.7 when the pin is LOW but when the pin is HIGH, instead of turning it off, the voltmetre reads 5.92V  :o

This behaviour is repeated for all higher voltages, with the measured voltage jumping roughly 0.2V when the pin goes HIGH. I have tried R1 values from 12K down to 1K with no apparent change.

I 'm obviously doing something very wrong but I can't figure out what. Help?

P.S. How do I upload an image? I made an award winning diagram but I can't for the life of me figure out how to upload it.
70  Forum 2005-2010 (read only) / Interfacing / Re: Cutting ADC input voltage down to size on: January 12, 2010, 03:44:34 am
Wow, thanks guys. According to this website:

I 'll be looking at voltage differences of the order of some tenths of a Volt (section "State-of-charge reading based on terminal voltage").

bill2009, I 'll play around with 22k-8.2k to see what results I get. BTW, do you think the transistor switching is not a good idea?

jluciani, great, thanks for the tip, I now know what to look for in Google. I 'm off to the shops so I 'll see what kind of cheap op-amps I can get hands on.
71  Forum 2005-2010 (read only) / Interfacing / Cutting ADC input voltage down to size on: January 11, 2010, 04:58:40 pm
Hello forum, I want to measure the voltage of lead-acid batteries (as a quick and dirty state-of-charge calculation) and came across these threads:

Now, battery voltage can't go much higher than a few volts above 24V so I think a simple voltage divider will do the trick just fine although if you believe I should go the opamp route please let me know.

Now, I have two questions:

1) I don't want to drain the battery with the tiny but non zero current drain of the divider. One obvious solution is to use some pretty enormous resistors but of course it is inelegant. So, I was thinking, can I do something clever with a transistor? Can't I dump a transistor in series with my resistors and switch it on with one of the Arduino's pins whenever I need to take a measurement (it won't be that often, we are talking time of the order of minutes or hours between measurements)?

If that is possible, what sort of transistor should I use?

2) Any simple way I can I "zoom" into the interesting bit of the voltage? This means the upper 4-5 Volts of the measurement. One very dirty solution I can think of is to make a voltage some 18, say, volts higher than the batteries' GND and connect the Arduino's ground there. However, this is unbelievably hideous as it will introduce a current drain for this new divider as well as making life a living hell if I want to connect other sensors which require a common ground between Arduino and batteries.

Any and all ideas welcome.
72  Forum 2005-2010 (read only) / Interfacing / Re: Single XBee shield blues on: January 09, 2010, 06:30:54 pm
You have to have the jumper in the USB position to upload sketches, and in the Xbee position to have the Arduino talk to the XBee.

Duh, how stupid am I?  smiley-razz

And of course you 're right, I should be trying with two Arduinos but for the time being one is all I have (you 'll get some real gems when I get the second one, just you wait).

Still, the question remains, why don't I get an "OK<CR>" to my "+++"? I should be getting replies from the XBee right? The way I understand it, with the jumpers in the XBee position, Serial.print() statements go to both the XBee and the computer via USB with the only drawback being that the comp can only receive but not talk. So, my sketch should at least print some reply from the XBee (BTW, my 10 seconds delay is enough for the XBee to drop out of configuration mode. This value is just for extravagance, I have also tested with around 1.5 seconds. Also, the replies, if any, should be waiting around in the Arduino's buffer till fetches them).

Also, any idea why the garbled chars when printing to the IDE's serial monitor?
73  Forum 2005-2010 (read only) / Interfacing / Single XBee shield blues on: January 08, 2010, 05:49:42 pm
Hello forum, got some really embarrassing questions. It seems everyone has trouble getting two xbees talking to each other, I have managed to mess up a monologue. Here goes.

I got an xbee shield & xbee similar to this one (not actually from that shop but it looks identical, got mine from a phyisical shop).

I downloaded X-CTU and after immense amounts of trouble managed to upload into it and set it up as ZIGBEE ROUTER/END DEVICE AT. In X-CTU's terminal, it responds to +++ and replies to AT commands.

So far so good.

Now, I thought I 'd take tiny little baby steps and try chatting between the Arduino and the shield (as opposed to between XBee-ed Arduinos) since I only have one Arduino (Duemilanove) right now.

So, the last section on Arduino's XBee shield reference page ("Configuring the Xbee Module") seems to imply that it's fairly easy for the Arduino to get the XBee into configuration mode and then have a talk via AT commands. Well...

First sign of trouble, shield on top, jumpers to "XBee", when trying to upload any sketch, the IDE reports that:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding

Damn! I haven't seen anyone else reporting you have to have the shield off when uploading but maybe I haven't been looking. So, first question, do you?

Anyway, I can upload the damn thing and then stick the shield on so that kinda works, till I hit the next obstacle, with the shield on, weird chars appear in the IDE's monitor (baud rate is checked). Sometimes most of these go away with a few delay() statements thrown around the code but sometimes everything is gibberish. So, question number two, WTF?

Still, I have an LCD and I 'm not afraid to use it. The shield allows access to pins 8-13 so I requisitioned 12 and 13 for NewSoftSerial and fed the following sketch to my board:

#include <NewSoftSerial.h>

NewSoftSerial LCD(12, 13);

const int bufferSize = 10;
char ca[bufferSize];

void setup() {
  LCD.print(12, BYTE);
  delay(10000);                      // normally one second should be enough for XBee to answer but let it breathe
  int i = 0;
  while(Serial.available() > 0) {
    ca[i++] =;
    LCD.print(".");                 // show if there's activity
  ca = '\0';
  LCD.print("end");                // if this prints alone, nothing got received

void loop()

Just a couple of comments,  LCD.print(12, BYTE); clears the LCD.  Serial.begin(19200); is just a value I got at some Arduino/XBee tutorial (can't find it now) since I didn't have a clue what kind of baud rate the Arduino/XBee chatter should be at. Is that an OK value?

Now, no prizes for guessing that the code prints a single "end" and that's it. So, I 'm out of ideas. Any help would be greatly appreciated.
74  Forum 2005-2010 (read only) / Interfacing / Re: Digital pin output problems on: November 16, 2009, 04:12:06 am
Right, bummer but I get it now. Thanks.

P.S. solved by moving motorPin to pin 11 (leaving servo on pin 5) on Duemilanove board.
75  Forum 2005-2010 (read only) / Interfacing / Digital pin output problems on: November 15, 2009, 06:25:29 am
Hello, I have a very weird problem which, after a lot of cutting bits of code out of a larger program, I have simplified down to the following code:

#include <Servo.h>

byte servoPin = 6;

Servo s;

void setup() {

void loop() {
  analogWrite(motorPin, 255);

Now, the "motorPin" (named so because originally going to control a solid state relay for controlling a DC motor) is attached to an LED to check if it comes on or not.

Now, guess what, with the code as shown above, the LED turns on, no surprises there. With the:


line uncommented however, the LED stays off :o

What is going on here? I have tried changing the pin numbers (moved motorPin from 9 to 10) but doesn't solve the problem. The offending line is the servo attachment to its pin.
Pages: 1 ... 3 4 [5]