Show Posts
|
|
Pages: [1] 2 3
|
|
9
|
Using Arduino / Networking, Protocols, and Devices / Re: Out of PINS with SIM900 GPRS shield
|
on: May 20, 2013, 03:18:32 pm
|
|
on my mega those are pins 9-13 PWM Digital (do not now what arduino you have),no way to have only TX/RX, there is also control pin for auto on/off if i remember correctly,
and one very important thing, you have to have another power source for this shield,
outmost swich is reset, middle switch is power for the board (press it for about 2 seconds to power it on), last switch is shield reset.
|
|
|
|
|
10
|
Using Arduino / Networking, Protocols, and Devices / Re: Out of PINS with SIM900 GPRS shield
|
on: May 20, 2013, 12:05:26 pm
|
have the same one, though i have Mega so plenty of pins there, are you using nokia lcd? that socket can be used, though 3 pins you have to count out, there is gnd, aref and 3,3v on it.so you can use those, depending of what type of sensors, and how many you have them, you may want to use shift registers. (Btw, I was hoping that you can verify my issue I'm having in this thread: http://forum.arduino.cc/index.php?topic=167284.0 but ou can use just example SMS_RECEIVE from GSM library)
|
|
|
|
|
12
|
Using Arduino / Networking, Protocols, and Devices / GSM library is eating my w's SIM900/Mega2560/DHT11/Nokia5110_lcd
|
on: May 19, 2013, 07:10:20 pm
|
yup, GSM library is eating my "w" whenever I'll receive an SMS it is not displayed neither on my LCD nor through the serial console. Though "W" are displayed... :/ (capitol ones) and I'm completely out of ideas... not even know where to look... im using Adafruit's Nokia 5110 LCD library (not my fav, but it has contrast option) dht11 for temp, and sim900 sheild from elecfreaks only modification was in the GSM3SoftSerial.cpp I've set value of "#define __RXPIN__ " under "mega" section to 52 for RX pin. code is modified example, and there it is: /* SMS receiver */ #include <dht11.h>
dht11 DHT111; dht11 DHT112; dht11 DHT113;
#define DHT11PIN1 16 #define DHT11PIN2 17 #define DHT11PIN3 18
// include the GSM library #include <GSM.h>
#include <Adafruit_GFX.h> #include <Adafruit_PCD8544.h>
// pin 9 - Serial clock out (SCLK) // pin 10 - Serial data out (DIN) // pin 11 - Data/Command select (D/C) // pin 12 - LCD chip select (CS) // pin 13 - LCD reset (RST) Adafruit_PCD8544 display = Adafruit_PCD8544(9, 10, 11, 12, 13);
// PIN Number for the SIM #define PINNUMBER ""
// initialize the library instances GSM gsmAccess; GSM_SMS sms;
// Array to hold the number a SMS is retreived from char senderNumber[20];
void setup() { Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } display.begin(); display.setContrast(40); //display.display(); // show splashscreen delay(100); display.clearDisplay(); display.setTextSize(1); display.setTextColor(BLACK); display.setCursor(0,0); display.println("SMS Receiver"); display.display(); delay(500); display.clearDisplay(); readout(); // initialize serial communications and wait for port to open:
Serial.println("SMS Receiver"); display.setCursor(0,0); display.println("SMS Receiver"); // connection state boolean notConnected = true; // Start GSM connection while(notConnected) { if(gsmAccess.begin(PINNUMBER)==GSM_READY) notConnected = false; else { Serial.println("Not connected"); display.clearDisplay(); display.setCursor(0,0); display.println("Not connected"); delay(1000); } } display.clearDisplay(); display.setCursor(0,0); display.println("Start GSM"); display.println("Waiting for SMS"); display.display(); Serial.println("GSM initialized"); Serial.println("Waiting for messages"); }
void loop() { char c; // If there are any SMSs available() if (sms.available()) { Serial.println("Message received from:");
display.clearDisplay(); display.setCursor(0,0); display.println("SMS from:");
// Get remote number sms.remoteNumber(senderNumber, 20); Serial.println(senderNumber); display.println(senderNumber); display.display();
// An example of message disposal // Any messages starting with # should be discarded if(sms.peek()=='#') { Serial.println("Discarded SMS"); sms.flush(); } // Read message bytes and print them while(c=sms.read()) { display.print(c); Serial.print(c); } //display.clearDisplay(); //display.println(".\n"); display.display(); Serial.println("\nEND OF MESSAGE"); // Delete message from modem memory sms.flush(); Serial.println("MESSAGE DELETED"); }
delay(1000);
}
void readout() { display.setTextSize(1); display.setTextColor(BLACK); display.setCursor(0,0); int chk1 = DHT111.read(DHT11PIN1); switch (chk1) { case DHTLIB_OK: Serial.println("Sensor#1: OK"); Serial.print("Tmp#1:"); Serial.print((float)DHT111.temperature, 2); Serial.print("\tH#1(%):"); Serial.println((float)DHT111.humidity, 2); display.print("Temp #1:"); display.println((float)DHT111.temperature, 0); display.print("Hum #1:"); display.println((float)DHT111.humidity, 0); break; default: Serial.println("Error"); break; } int chk2 = DHT112.read(DHT11PIN2); switch (chk2) { case DHTLIB_OK: Serial.println("Sensor#2: OK"); Serial.print("Tmp#2:"); Serial.print((float)DHT112.temperature, 2); Serial.print("\tH#2(%):"); Serial.println((float)DHT112.humidity, 2); display.print("Temp #2:"); display.println((float)DHT112.temperature, 0); display.print("Hum #2:"); display.println((float)(DHT112.humidity+2), 0); break; default: Serial.println("Error"); break; }
int chk3 = DHT113.read(DHT11PIN3); switch (chk3) { case DHTLIB_OK: Serial.println("Sensor#3: OK"); Serial.print("Tmp#3:"); Serial.print((float)DHT113.temperature, 2); Serial.print("\tH#3(%):"); Serial.println((float)DHT113.humidity, 2); display.print("Temp #3:"); display.println((float)DHT113.temperature, 0); display.print("Hum #3:"); display.println((float)DHT111.humidity, 0); break; default: Serial.println("Error"); break; } display.display(); delay(500); display.clearDisplay(); }
|
|
|
|
|
15
|
Using Arduino / General Electronics / Re: Mega Power source
|
on: January 06, 2013, 05:22:50 pm
|
Thanks guys! Plenty of good ideas  Actually I have a few Esc's with built-in bec's spares from my planes and helis, so atm it could be the easiest solution. However, since i have few of Those batteries, (just found also one 6v like that) then external power connector will be my power delivery method atm.and with this, another question, im assuming that I'm safe to supply my mega with external power through the jack (either from my battery of wall-wart power adapter) and having usb from pc connected to it? (Im an user of ardupilot based on mega, and there were some issues with that if i remember correctly - also ardupilo was a reason for me diving deeper into arduino,did not wanted to be a user only.)
|
|
|
|
|