Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Programming Questions / Re: How to: get ID-20LA RFID and SIM900 to communicate with UNO (software serials) on: April 30, 2014, 11:26:54 am
Thanks for your reply Paul
I actually have a mySerial connected to the pins yes. My RFID is connected there. As the only thing the RFID needs is the RX pin, I've just selected a unused pin (A2) as the TX pin as I can't just leave it blank.

I need them to talk to the pc, and therefore I can't use pin 0 and 1. Actually I would be glad is I could just listen to the RFID as default, and then only listen to the SIM900 while sending a message, and then go back and listen to the RFID until a new SMS has to be sent. But as I said I am unable to figure out how to change between the software serials as the SIM900 library doesn't support the command "gsm.listen();" as I would have used then I had to listen at the SIM900 instead of the RFID.

best regards
2  Using Arduino / Programming Questions / Re: How to: get ID-20LA RFID and SIM900 to communicate with UNO (software serials) on: April 30, 2014, 10:53:01 am
Quote
Top-of-head response!
Sorry.. But I didn't know what you've expected other than a link to my shield :-)

I am unable to use pin 0 and 1. My only option is to use two software serials, one  for SIM900 and one for RFID.

best regards
3  Using Arduino / Programming Questions / Re: How to: get ID-20LA RFID and SIM900 to communicate with UNO (software serials) on: April 30, 2014, 09:37:26 am
This is my shield
http://imall.iteadstudio.com/im120417009.html :-)
4  Using Arduino / Programming Questions / How to: get ID-20LA RFID and SIM900 to communicate with UNO (software serials) on: April 30, 2014, 09:26:28 am
Hello Forum
I am currently working on a project where I have to send out a SMS when a specific RFID tag is scanned. I have my ID-20LA and my SIM900 shield hooked up to my Arduino Uno, and both of them working fine on their own. Both the RFID reader and the GSM shield communicates with my Uno via the software-serial library.

This is my shield
http://imall.iteadstudio.com/im120417009.html

This is my current sketch. It should have functioned this way. "When two known tags gets scanned, send a sms" - what I actually get is that I can't scan any RFID's at all, and no sms gets send.

Code:
#include <SoftwareSerial.h>
#include "SIM900.h"
#include "sms.h"
SMSGSM sms;

SoftwareSerial mySerial(4,A2); // RX, TX
int RFIDResetPin = 5;

//Tags tilføjes her, de kan findes i seriel monitor, når et tag scannes.
char tag1[13] = "01002DC7D03B";
char tag2[13] = "01002DC6678D";

void setup(){
  mySerial.begin(9600);
  Serial.begin(9600);
  gsm.begin(2400);

  pinMode(RFIDResetPin, OUTPUT);
  digitalWrite(RFIDResetPin, HIGH);
  
  mySerial.listen();
}

void loop(){

  char tagString[13];
  int index = 0;
  boolean reading = false;

  while(mySerial.available()){  

    int readByte = mySerial.read(); //read next available byte

    if(readByte == 2) reading = true; //begining of tag
    if(readByte == 3) reading = false; //end of tag

    if(reading && readByte != 2 && readByte != 10 && readByte != 13){
      //store the tag
      tagString[index] = readByte;
      index ++;
    }
  }

  checkTag(tagString); //Check if it is a match
  clearTag(tagString); //Clear the char of all value
  resetReader(); //eset the RFID reader
}

void checkTag(char tag[]){
  ///////////////////////////////////
  //Check the read tag against known tags
  ///////////////////////////////////

  if(strlen(tag) == 0) return; //empty, no need to contunue

  if(compareTag(tag, tag1)){ // if matched tag1, do this
    sms.SendSMS("12345678", "TAG1"); //12345678 = phonenumber
  }
  else if(compareTag(tag, tag2)){ //if matched tag2, do this
    sms.SendSMS("12345678", "TAG2");
  }
  else{
    Serial.println(tag); //Læs ukendte tags, og print serielt.
  }

}
void resetReader(){
  //reset læseren
  digitalWrite(RFIDResetPin, LOW);
  digitalWrite(RFIDResetPin, HIGH);
  delay(150);
}

void clearTag(char one[]){
  //clear the char array by filling with null - ASCII 0
  //Will think same tag has been read otherwise
  for(int i = 0; i < strlen(one); i++){
    one[i] = 0;
  }
}

boolean compareTag(char one[], char two[]){
  //compare two value to see if same,
  if(strlen(one) == 0) return false; //empty

  for(int i = 0; i < 12; i++){
    if(one[i] != two[i]) return false;
  }

  return true; //no mismatches
}

I've read that the Arduino can't handle two software serials running at once, and therefore you have to use the function ".listen" before communicating with either the RFID or the SIM900. At the bottom of my void setup i end with "mySerial.listen();" to be able to scan my tags. Then when a known tag is scanned, I would like to send a sms, which is this part of the sketch:
Code:
if(compareTag(tag, tag1)){ // if matched tag1, do this
gsm.listen();
sms.SendSMS("12345678", "TAG1"); //12345678 = phonenumber

I am then trying to use the "gsm.listen();" before sending the message. The problem is that theres is no ".listen" function build into the SIM900 library and therefore I can't use it. Even if I delete the line "gsm.listen();" I don't receive the sms.

Does anyone know how I can change the serial from the RFID to the SIM900 so I can send my sms?

thank you very much
best regards

Johannes
5  Using Arduino / LEDs and Multiplexing / Re: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 10, 2014, 04:55:32 pm
Does this mean that it's safe for me to use my 74HC595N shift registers to drive my Numitrons? or should I use the TPIC6B595N's I've ordered? - everything seems to run just fine using the 74HC595N's
6  Using Arduino / LEDs and Multiplexing / Re: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 06, 2014, 12:46:03 pm
Actually I got everything up and running using the 74HC595N shift registers I got. Guess I can just use these then?
- I tried using the pineapple library (link https://github.com/Qtechknow/Arduino-Libraries/tree/master/Pineapple) to display numbers on my numitron, but I can't get it going. I either have all the segments lit up nor none of them, I can't turn any segments on individually or anything, even though I know it will work with the shift register as I've tested my shift register using another sketch which is not relying on the pineapple library. Does anyone know how to get the pineapple library to work?
7  Using Arduino / LEDs and Multiplexing / Re: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 03, 2014, 06:44:25 am
Fine, I'll go with the TPIC's then :-)
by using one for each I will be able to drive the numitrons without using any other components, right?
- I guess the only thing I would need is a external power supply.

If I have to control high loads (let's say 12v 1A devices) in future, which component would be the best? - do you actually use shift registers like the TPIC's for this, or is there some kind of component primarily for controlling high loads with a small number of pins?

Thank you 
8  Using Arduino / LEDs and Multiplexing / Re: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 03, 2014, 02:14:43 am
Okay, I have some 74H595N shift registers, but I guess those won't work as they have no internal transistor/mosfet to switch the load. If I should use these, I would have to use eksternal transistors/mosfets... (?)

I've never worked with switching higher loads (dc and current more than leds consume), as I am green in working with shift registers. What else would you normally use if you had to switch let's say high power leds or relays with as little pins as possible? As far as I've read so far, most shift registers can't do it... What alternatives do you have then.

Thank you for your helpful answers Paul

9  Using Arduino / LEDs and Multiplexing / Re: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 02, 2014, 05:03:11 pm
Damn.. If was sure it would be possible, but little did I know :-)

What about using this one? - then I would have one for each numitron, six in total: TPIC6B595N
http://www.ti.com/lit/ds/slis032a/slis032a.pdf

best regards
10  Using Arduino / LEDs and Multiplexing / Is it possible: control Numitron IV-9 with MAX7219CNG LED driver on: March 02, 2014, 01:50:26 pm
Hello forum
Is it possible to drive six Numitron IV-9 by using one MAX7219CNG LED driver?
- I've already tried the driver with normal 7-segment LED displays with success. Then I tried switching the LED segment with one Numitron, the Numitron gloved dim (getting only 0.5v where it should have had 3.5) regardless of whether the outputs on the LED driver was high or low.

Then I tried adding a NPN transistor (BC337-25) to the output channels of the led driver, to try to drive the Numitrons with the transistor, but also here the numitron gloved dim. (getting only 0.5v where it should have had 3.5)

I calculated the IRES-resistor between pin 18-19 for the led driver by using the lookup table in the datasheet
https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf

Each segment of the numitron requires 4v and consumes 20mA

I know this is a LED driver, and not designed for bulbs, but shouldn't it be possible to use it anyway? - if no, which driver would you recommend?  - my goal is to use as little pins on the arduino as possible, and therefore i chosen the MAX7219CNG.

If you need any information, please don't hesitate to write  :-)

best regards
Johannes TN
11  Using Arduino / Programming Questions / Re: Compare multiple strings in if statement, what is wrong? on: January 24, 2014, 08:05:13 am
Update:
I got it working by using JimboZA'z method, thank you very much to all of you for your fast help, it's nice to see so many helpful people here :-)

best regards
JohannesTN
12  Using Arduino / Programming Questions / Re: Compare multiple strings in if statement, what is wrong? on: January 23, 2014, 01:59:37 pm
Sorry for not making it clear what "ps2x.Analog(PSS_LY) > xxx" represents. These holds the analog values (0-255) for L3/R3 (for those familiar with Playstation controllers) - the values represented in my if statement, is the value in each direction (L3 x and y axis, and R3 x and y axis) which is measured when the sticks are in center (untouched).

I am currently testing JimboZA's solution, As far as I have come until now, it seems to work :-) - I'll write you back to let you know if it worked or not.

Thank you.
best regards
JohannesTN
13  Using Arduino / Programming Questions / Compare multiple strings in if statement, what is wrong? on: January 23, 2014, 05:56:20 am
Hello Forum
I am currently playing around with the PS2X library written by Bill Porter. I've set the following if-statement:
Code:
else if (kort == true && ps2x.Analog(PSS_LY) > 100 || ps2x.Analog(PSS_LY) < 140 || ps2x.Analog(PSS_RY) > 90 || ps2x.Analog(PSS_RY) < 130)
I would like it to function the following way: If kort is true, then check whether one of the "ps2x.Analog(PSS_LY) > xxx" is true too, not all of the "ps2x.Analog(PSS_LY) > xxx" have to match, only one of them has to be true for the if statement to execute.
Right now the only thing it does when I run it is always to run the code in the if-statement, it doesn't matter if the "kort" is true or false, the if statement always executes. If kort is false, but one of the  "ps2x.Analog(PSS_LY) > xxx" is true, I don't want the if-statement to run.. How can I solve this, I guess I'm not using the " || " the right way, or something.

Thank you very much.
Best regards
JohannesTN
14  Using Arduino / Networking, Protocols, and Devices / Re: How to do two way communication by using NRF24l01+ modules? on: January 17, 2014, 03:57:41 pm
Thank you very much, I'll look into that and try to get it working soon
15  Using Arduino / Networking, Protocols, and Devices / Re: How to do two way communication by using NRF24l01+ modules? on: January 17, 2014, 03:43:28 pm
Actually I jut found this, which I think looks very promising https://github.com/stanleyseow/RF24/tree/master/examples/nRF24_Serial_Chat But what is the easiest way to find out which pins to hook the modules up to, in order to get this to work? - I can only see the line "RF24 radio(8,9);" - how do I know how to hook it up?

best regards
Pages: [1] 2 3 ... 7