Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / Project Guidance / Re: Arduino Sleep with XBee on: October 12, 2012, 12:44:37 am
17  Using Arduino / Project Guidance / Re: What is the best way for controlling array of 8-16 relays? on: October 12, 2012, 12:43:03 am
I2C port expander to a pair of ULN2803As to your relays should be enough. The relays don't require regulated power and their current needs are in their datasheet. Get a supply that has at least 50% more current then you need.

What are you switching and which relays are you planning on using?

What he said. Use a PCF8574N 8-bit IO expander. Its the easiest to work with.
18  Using Arduino / Project Guidance / Re: Arduino Sleep with XBee on: October 11, 2012, 06:21:46 pm
It does use less power when it's not transmitting.  To lower it further you can use the sleep pin.

Would you happen to know what the power consumption is when idle?
19  Using Arduino / Project Guidance / Arduino Sleep with XBee on: October 10, 2012, 11:48:49 pm
I just wanted to know when I put my Arduino in a low power state mode, will the XBee use less power as well, or would I have to put the XBee in its own low power state?
20  Using Arduino / Project Guidance / Re: ID-12 to Arduino Uno on: September 11, 2012, 01:33:01 am
the only thing that limits the current is the computer (via Vusb)

Thats probably it. While on USB power, I can use the 5v rail to power all sorts of things except the ID-12. When on external power, I can power the ID-12.

Sorry if I seem a bit thick, Im just trying to wrap my head around this problem (and Im doing it mostly late at night).
21  Using Arduino / Project Guidance / Re: ID-12 to Arduino Uno on: September 10, 2012, 01:16:52 am
You say the Arduino isn't 'handling the current', but what symptoms make you think it isn't?
Simple: the ID-12 board doesnt power on.

Quote from: PeterH
What is the voltage on between the Arduino's 5V pin and ground when the 5V is not connected?
I measured it at 5v.

Since I have Rev2 of the Arduino Uno, I figured out that it must be the Atmega8U2 chip acting as a USB-to-serial converter that is limiting the current, because when I used an 12V external power supply it worked fine. Its only when I power the Arduino via USB that the ID-12 doesnt power on.

At least now I know why I shouldnt use the USB to power it during operation. Thanks for the help.
22  Using Arduino / Project Guidance / Re: ID-12 to Arduino Uno on: September 09, 2012, 04:35:07 pm
In that case, the on board regulator has nothing to do with this.  The 5V pin is connected to VUSB through a 500mA poly fuse.  So you are limited to 500mA by both the USB spec and the on board fuse.

Im drawing somewhere between 19mA and 44mA. It just occurred to me, since Im using USB, would the FTDI chip (or even my computer) be limiting the current?

Quote from: James C4S
What is the external supply you are using?  The 5V pin is effectively an external supply.

Im using a Sparkfun 5v/3.3v Breadboard power supply. That seems to do the job just fine.
23  Using Arduino / Project Guidance / Re: ID-12 to Arduino Uno on: September 09, 2012, 03:05:30 pm
Well Yes, the spec for the regulator says 1A.  However, it depends on the input voltage.  The regulator is limited because it is not well heat sinked.  The higher the input voltage, the lower the output current.

That would make sense if I was powering with external power. I am however powering it through USB, thus I am getting 5V directly.

Quote from: James C4S
What do you mean "handle"?  What is happening?

When I wire the ID-12 board up to the 5V pin (and ground) nothing happens. It just doesnt work. When I wire it to an external 5V, it powers up just fine.

Quote from: James C4S
This doesn't make sense.  The I/O pins are current limited because of the design of the ATmega328 chip.  It has nothing to do with the 5V rail.

Your theory makes sense, but in practice thats not what I see is happening. Something is limiting the current, which in turn wont let the ID-12 power up.

Whoah, thanks a lot. This is actually exactly the application I was looking to use it for.  smiley

Do you think running the ID-12 on its own might bring that current draw down?

I'm confused about what the problem is, here.

Im using the RFID-USB board from Sparkfun. The ID-12 plugs into it. Im curious to know if the board uses up more current than the ID-12 or would the current it consumes be miniscule?
24  Using Arduino / Project Guidance / ID-12 to Arduino Uno on: September 08, 2012, 05:43:54 pm
Im trying to power my Sparkfun RFID-USB Reader board (it has an RFID ID-12 reader) using my Arduino Uno. I know the ID-12 only requires 5v. After some simple measuring of the current during normal operation and a read, I found that the Arduino Uno should be able to handle the current, but Im stumped as to why it wont (its 19.7mA Low, and 44mA High). The Regulator on the Uno can do up to 1A, and Im wiring straight to the 5V pin, so there shouldnt be any issues. The only thing that Im thinking is that because the 5v pin is hooked into the microcontroller, its limiting the current down to the 40mA per pin as the tech specs say per I/O pin. Is this so, or has anyone managed to get that board working on an Uno? Do you think running the ID-12 on its own might bring that current draw down?
25  Using Arduino / Networking, Protocols, and Devices / Re: Multiple Arduino Unos communicating via Xbee on: September 05, 2012, 10:43:17 pm
Hey there bakenzilo

Sorry to dredge this post back up, but Ive got a question. I myself am experimenting with API mode using your code, and Ive got a weird situation going on. When I turn on the Coordinator Fio and the Router Fio (Yes Im using Arduino Fio's instead of Uno's, but theyre quite similar), the Coordinator Power is on, and the RSSI led lights for a moment, but then the Router FIO power led just starts flashing. When I turn off the Coordinator, the Router Power led stops flashing and holds steady for a few seconds, then turns off entirely.

My Settings are: (Transmitter: XB24-ZB, Function set: ZIGBEE Coordinator API, PAN ID 2001, Channel?; Receiver: XB24-ZB, Function: ZIGBEE ROUTER API, PAN ID 2001)

I know based on what Im seeing with the leds, the Router is reacting to the Coordinator, but I have no idea whats going on. Would you happen to know?
26  Using Arduino / Programming Questions / Re: RFID Tag Compare on: September 05, 2012, 04:04:21 pm
By the way, that's far from the worst code I've seen but in order to convince myself the logic was sound I reformatted it to put each { and } on a separate line with matching pairs indented by the same amount; I suggest you adopt that code style. I also suggest that you get into the habit of putting { and } after any if/else statement. Sure, it might work without it now when you only have one statement, but you've no idea how many times I've seen people tack an extra statement on the end - or inadvertently use a macro that expanded to more than one statement - and introduce a subtle bug. Use { and } to make the control structure as clear and robust as possible.

Well this is practically the example given on the Arduino website for use with the ID-12. I just manipulated it for my purpose.

Putting each { on a new line, and using Tools + Auto Format would help.

So would including the value of n in the output:
              Serial.print("Card ");
              Serial.println(" is NOT a Match!");

I am using Auto-format. I'll implement the Card (n) into the code and see what happens.
27  Using Arduino / Programming Questions / Re: RFID Tag Compare on: September 05, 2012, 12:36:12 pm
If the value returned be memcmp() is not 0, how can it be anything but not zero? The second if test is redundant.

Most likely what is happening is that you are learning that one of the tags is not tag 0 and is not tag 1, when you read tag 2. If you were to include n in the output message, I think you'd see that the messages are NOT identical. But, without seeing the whole code, who knows for sure.

I was trying to do an IF/ELSE statement, and I wasnt getting anywhere, so I figured to try the opposite of my IF statement to see if that worked. It did exactly the same as the ELSE statement. So yes, its redundant. However, since you guys are most insistent about seeing the whole code to analyze the problem, here you go:

#include <NewSoftSerial.h>
NewSoftSerial mySerial(2, 3); //rx, tx

#define TAG_LEN 5
#define ARR_LEN 2

byte target_tag[ARR_LEN][TAG_LEN] = //This array of TAG ID's will later be in a database on the BB
{{0x4F, 0x00, 0x88, 0xB3, 0x4F}, //Card 1 Tag ID
{TAG_ID_2}}; //Card 2 Tag ID

boolean match = false; // initialize card match to false

void setup() {
Serial.begin(9600);// connect to the serial port
Serial.println("Bring an RFID tag near the reader...");

void loop () {
  byte i = 0;
  byte val = 0;
  byte master[6];
  byte checksum = 0;
  byte bytesread = 0;
  byte tempbyte = 0;

  if(mySerial.available() > 0) {
    if((val = == 2) {                  // check for header
      bytesread = 0;
      while (bytesread < 12) {                        // read 10 digit master + 2 digit checksum
        if( mySerial.available() > 0) {
          val =;
          if((val == 0x0D)||(val == 0x0A)||(val == 0x03)||(val == 0x02)) { // if header or stop bytes before the 10 digit reading
            break;                                    // stop reading

          // Do Ascii/Hex conversion:
          if ((val >= '0') && (val <= '9')) {
            val = val - '0';
          } else if ((val >= 'A') && (val <= 'F')) {
            val = 10 + val - 'A';

          // Every two hex-digits, add byte to master:
          if (bytesread & 1 == 1) {
            // make some space for this hex-digit by
            // shifting the previous hex-digit with 4 bits to the left:
            master[bytesread >> 1] = (val | (tempbyte << 4));

            if (bytesread >> 1 != 5) {                // If we're at the checksum byte,
              checksum ^= master[bytesread >> 1];       // Calculate the checksum... (XOR)
          } else {
            tempbyte = val;                           // Store the first hex digit first...

          bytesread++;                                // ready to read next digit
      //do something else perhaps wait for other data.
      if (bytesread == 12) {                          // if 12 digit read is complete
        Serial.print("5-byte master: ");
        for (i=0; i<5; i++) {
          if (master[i] < 16)
          byte master1 = master[i];
          Serial.print(master[i], HEX);              //Prints the Tag of the Card read
          Serial.print(" ");
        for (int n=0; n<ARR_LEN; n++){               //Checks each ID Tag in the Array
if(memcmp(master, target_tag[n], TAG_LEN) == 0 )  //Compares two bytes of TAG_LEN, if they are a match, the argument will be 0, thus 0 == 0
            Serial.println("This Card is a Match!");
              Serial.println("This Card is NOT a Match!");
      bytesread = 0;


Hope this helps in deciphering the two-time repetition of the "This Card is NOT a Match!" statement.
28  Using Arduino / Programming Questions / Re: RFID Tag Compare on: September 03, 2012, 10:15:23 pm
I have another question, similarly relating to this.

I want the program to print out when the card validates, and also when the card doesnt validate. Ive tried this:

if(memcmp(master, target_tag[n], TAG_LEN) == 0 )  //Compares two bytes of TAG_LEN, if they are a match, the argument will be 0, thus 0 == 0
            Serial.println("This Card is a Match!");
        else if(memcmp(master, target_tag[n], TAG_LEN) != 0)
              Serial.println("This Card is NOT a Match!");

If it validates, it outputs once. If it doesnt validate, it outputs twice- for each tag it reads in.

What I want it to do is compare vs both tags, and then if it validates, great, output once - like its already doing. If not, output ONCE as well. Any suggestions of how to get that to work?
29  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Fio to RFID ID-12 on: September 01, 2012, 10:06:29 pm
Your ID-12 requires 5V, as does the level shifter, so you will need the DC/DC converter if you want to use them with a 3.3V power source.

Thats what I thought. Thanks.
30  Using Arduino / Networking, Protocols, and Devices / Arduino Fio to RFID ID-12 on: August 31, 2012, 08:52:23 pm

Can someone verify my diagram of connecting the Arduino Fio with an ID-12 RFID Reader? I figured that using a Logic Level Converter is the proper way to do it, but Im not sure if I should have a DC-DC step up board between the two to provide power to the ID-12 or if the LLC can step up the voltage as well.

Pages: 1 [2] 3 4