Show Posts
Pages: [1] 2 3 ... 152
1  Using Arduino / Networking, Protocols, and Devices / Re: Best bluetooth module for HID use with Android on: August 24, 2014, 08:17:55 pm
I was watching this video. I tried using his easymote app but it kept crashing on me. Was looking for a module that when connected will show up as an input option on my phone.

Well, I don't know what a SNES is and I'm not going to watch the video but the bluetooth looks like an HC-06 to me, so, if you want to do what he did, I think you have the right gear. Any bluetooth module will show up as an input option, it's then a matter of what Android does with it next.  Essentially an Android is more commonly used as a controller rather than a controlled device, hence my previous, but, if the app to control Android already exists, I stand corrected, and that is your main problem solved!

The Easymote app I know of is for using the Android as a controller which is a typical application but, as I understand it, not what you want.
2  Using Arduino / Networking, Protocols, and Devices / Re: Best bluetooth module for HID use with Android on: August 24, 2014, 09:47:04 am
The HC-05 or HC-06 will probably do. Your real problem is developing the Android app, not Arduino.
3  Using Arduino / Displays / Re: LCD connections with Arduino Ethernet shield on: August 24, 2014, 01:55:19 am
The shield and display are nothing out of the ordinary. What you might not understand is that the shield only uses a few pins, most just pass through for use by other shields etc., and that should be evident on examination. That Ethernet shield uses the SPI bus, pins 10,11,12,13 and pin 4 for SD select, just like they all do. You only need to wire the display avoiding these pins and change the line in the constructor to something like

LiquidCrystal lcd(8, 9, 5, 6, 3, 2);

as mentioned before. Also as mentioned before, the tutorial is dumb - but easily fixed. There are conventions in this game... One of them is that you never use pin 4 for anything but selecting the SD because that is where it usually goes, and using it for anything else is something you will probably regret later. Why Mellis & Igoe haven't worked that out is beyond me, and you are suffering for it.  Similarly, putting a non-SPI device on the SPI bus, pins 11,12, can't be a good idea and just leads to confusion, but don't ask why they did it. 

Using the shield and LCD together is comman practice, and you should not have a problem.
4  Using Arduino / Networking, Protocols, and Devices / Re: Bluetooth HC-05 & ArduDroid - Hello World on: August 23, 2014, 08:18:26 am
Thanks for your comments. I now realise that I should have been clearer in my notes and will edit them soon.


 However I tried a few android bluetooth apps suggested and couldnt get the serial window to print what i typed in the bluetooth terminal on my phone.

You are right about this, and having the serial monitor connected while blue tooth is operating is not as useful as I have implied. The real value of using the monitor is in proving up the code before bluetooth is installed.


Quote
1) One thing I noticed in the PDF is it said that when paired the HC-05 LED will continuously be on.

Pairing is a once-only process. Android sniffs for Arduiono and and stoes its address and password. Every time you use an app, you make a connection - by hitting the connect button.

When Bluetooth has power but is waiting for connection, LED flashes about 2Hz. When a connection is made by Android, the LED goes solid. Android also confirms the connection. In normal operation, that is all you should see - 2Hz waiting, solid connected.

Quote
However when I pair to it the LED blinks twice fast and then is off for 2 seconds, then repeats

I don't know what this is about. Somebody else had the same thing only yesterday or the day before.

Quote
When I unpair my phone from the bluetooth, the LED blinks very fast continuously.

This is normal, as it has reverted to "wait mode"


Quote
2) When I open a bluetooth terminal on my android, i can see the "GET" data being loaded from the serial window so I know I am able to receive data. It seems my problem is the "SEND" portion where I type a letter or number and it does nothing. I am puzzled because the connection between the HC-05 Tx and Arduino Rx is so simple, its just a wire connecting them... so its not like I messed anything up, right?

See above. I now believe that, once the code is proven, the serial monitor should be out of the game. Note also that the code has no value other than to prove the communication works.  Just send a couple of letters, see the echo, and move on to something useful.

I'm sure IO had RealTerm on a laptop showing all the bluetooth traffic but I'm not able to check that at this time.
5  Using Arduino / Displays / Re: LCD connections with Arduino Ethernet shield on: August 23, 2014, 07:06:42 am
If you are using a bare LCD display, you can use any pins you like so long as you nominate them properly.
For instance, in the standard Hello World programme, with

 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D5 pin to digital pin 4
and the line

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

You could put RS on 8, Enable on 9 and D5  onto 6, and change the line to

LiquidCrystal lcd(8, 9, 5, 6, 3, 2);

If you are using an LCD shield, similar moves are required. I had to clip pin 4, put a jumper therefrom across to A2, and use

LiquidCrystal lcd(8,9,A2,5,6,7);

instead but I was lucky in only having to make one jumper.

This is the advantage of having the pin call in the programme, rather than having to find and edit it in the library.

I think that Hello World example is moronic. It works as is, but just serves to spook newbies later.

6  Using Arduino / Networking, Protocols, and Devices / Re: communication problem (Ethernet shield and EFCom GPRS/GSM Shield) on: August 21, 2014, 06:24:03 pm
When i used RX1 TX1 -> RX TX on gsm shield. GSM shield still does not work.

Did you change the jumpers on the shield?
7  Using Arduino / Networking, Protocols, and Devices / Re: HC-05 Bluetooth module Arduino Uno problem on: August 21, 2014, 06:20:06 pm
So.....
You have two programmes there, both using software serial.  Are you saying the first runs OK and the second does not?

It seems that the only difference is the LED control and it might be time to suspect the LED. You can test this with a blink programme. I don't know anything about LEDs or software serial,  but your original programme works OK. If the first programme with software serial works OK, at least you have proved the bluetooth module is OK.
8  Using Arduino / Project Guidance / Re: Saving Arduino sensor data to a text file on: August 21, 2014, 09:39:30 am
What you are using is the standard example. "Rewriting" is a bit of a stretch. There is no need to change the setup, although some omission won't go astray.  All you need to do is adapt it to the data you are sending. The data you send to SD should be essentially the same, and sent in the same style, as you would to monitor or display.

Below is code for serial, display and SD. As you can see the SD section in setup is just a stripped down version of what you have.

Code:
/*
//  This Arduino sketch reads DS18B20 "1-Wire" digital
//  temperature sensors.
//  http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

 */
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>                 

#include <PCD8544.h>             // Nokia 5110
#include <SD.h>                  // SD card
#include <string.h>              // from Date As Filename
#include "RTClib.h"              // from Date As Filename
#include "Wire.h"                // MUST HAVE lib for LCD disp, SD card, and serial

#define DS1307_ADDRESS 0x68

RTC_DS1307 RTC;
static PCD8544 lcd;

File myFile;
char filename[] = "00000000.CSV";

// Custom symbols
static const byte DEGREES_CHAR = 1;
static const byte degrees_glyph[] = { 0x00, 0x07, 0x05, 0x07, 0x00 };
static const byte SLASH_CHAR = 2;
static const byte slash_glyph[] = {0x00,0x20,0x10,0x08};

// Yellow group Lismore
byte InThermo[8] =  {
  0x28, 0x39, 0xFD, 0x50, 0x04, 0x00, 0x00, 0X69};
byte OutThermo[8] = {
  0x28, 0x09, 0xA9, 0xC0, 0x03, 0x00, 0x00, 0x95};
byte DrainThermo[8] = {
  0x28, 0x62, 0xA5, 0x2D, 0x04, 0x00, 0x00, 0x21};

#define ONE_WIRE_BUS 3
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

int  second, minute, hour, weekDay, monthDay, month, year;
int k=0;

const int chipSelect = 4;

float tempC, InTemp, OutTemp, DrainTemp, diff;   

// Define the strings for our datastream IDs
char sensorId0[] = "InThermo";
char sensorId1[] = "OutThermo";
char sensorId2[] = "DrainThermo";
char calcId1[] = "diff";

void setup() {
   lcd.begin(84, 48);
     // Register the custom symbols...
  lcd.createChar(DEGREES_CHAR, degrees_glyph);
  lcd.createChar(SLASH_CHAR, slash_glyph);
 
  Wire.begin();
  Serial.begin(9600);

  delay(300);//Wait for newly restarted system to stabilize
 
  lcd.setCursor (0,0);
  lcd.print("Initializing");
  delay(2000);
  lcd.setCursor (0,1);

  pinMode(53, OUTPUT);

 if (!SD.begin(chipSelect))
  {
    lcd.print("failed!");
    delay (2000);
    return;
  }
  lcd.println("init. OK!");
  delay(2000);
      getFileName();
      lcd.println(filename);
        delay(2000);
  lcd.clear();

  sensors.setResolution(InThermo, 12);
  sensors.setResolution(OutThermo, 12);
  sensors.setResolution(DrainThermo, 12);
 
    running();
}

void loop() {

  GetClock();
  if (hour == 0 && minute == 0 && second <2)
  {
    getFileName();
  }

  //get the values from the DS8B20's
  sensors.requestTemperatures();

  InTemp = (sensorValue(InThermo));
  OutTemp = (sensorValue(OutThermo)); 
  DrainTemp = (sensorValue(DrainThermo));

  diff = OutTemp - InTemp;
 
  Serial.print(InTemp);
  Serial.print(" ,  ");
  Serial.print(OutTemp);
  Serial.print(" ,  ");
  Serial.print(diff);
  Serial.print(" ,  ");
  Serial.println(DrainTemp);
 
  lcd.setCursor(49,0);
  lcd.print(InTemp);
  lcd.setCursor(49,1);
  lcd.print (OutTemp);
  lcd.setCursor(49,2);
  lcd.print(DrainTemp);
  lcd.setCursor(49,3);
  lcd.print(diff); 
 

  k=k+1; 

  if (k>9 )
  { 
  myFile = SD.open(filename, FILE_WRITE);//<<<<<<<<<<<<< OPEN
  myFile.print(hour);
  myFile.print(":");
  myFile.print(minute);
  myFile.print(":");
  myFile.print(second);
  myFile.print(",");

  myFile.print(InTemp);
  myFile.print(",");
  myFile.print(OutTemp);
  myFile.print(",");
  myFile.print(DrainTemp);
  myFile.print(",");
  myFile.println();
       myFile.close();//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>CLOSE
       
      k=0;
  }
  delay(850);
}  // loop ends here

//sensorValue function
float sensorValue (byte deviceAddress[])
{
  tempC = sensors.getTempC (deviceAddress);
  return tempC;
}

byte bcdToDec(byte val)  {
  // Convert binary coded decimal to normal decimal numbers
  return ( (val/16*10) + (val%16) );
}

void GetClock(){
  // Reset the register pointer
  Wire.beginTransmission(DS1307_ADDRESS);
  byte zero = 0x00;
  Wire.write(zero);
  Wire.endTransmission();
  Wire.requestFrom(DS1307_ADDRESS, 7);

  second = bcdToDec(Wire.read());
  minute = bcdToDec(Wire.read());
  hour = bcdToDec(Wire.read() & 0b111111); //24 hour time
  weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday
  monthDay = bcdToDec(Wire.read());
  month = bcdToDec(Wire.read());
  year = bcdToDec(Wire.read());
}

void getFileName(){

  DateTime now = RTC.now();
   sprintf(filename, "%02d%02d%02d.txt", now.year(), now.month(), now.day());
}

void running(){
  lcd.setCursor(0,0);
  lcd.print("In");
  lcd.setCursor(31,0);
  lcd.print("\001C ");
  lcd.setCursor(0,1);
  lcd.print("Out");
  lcd.setCursor(31,1);
  lcd.print("\001C ");
  lcd.setCursor(0,2);
  lcd.print("Drain");
  lcd.setCursor(31,2);
  lcd.print("\001C ");
  lcd.setCursor(0,3);
  lcd.print("diff");
  lcd.setCursor(31,3);
  lcd.print("\001C ");
}
9  Using Arduino / Project Guidance / Re: Arduino Mega with Ethernet & SD Card on: August 21, 2014, 09:28:28 am
I want to acquire 12 analog channels , store the data in SD Card and transmit over LAN.
I intend to use Arduino Mega with ethernet shield
Please inform
1.  When ethernet shield is used,  how many analog channels(out of 16) can be used
2. Can ethernet and SD work together
3. Does use of ethernet shield affects analog values.

1. Ethernet and SD use the SPI bus and a couple of digitals, so I'm sure you have all the analogue pins available
2. Most Ethernet shields have an SD card built-in, they would be an obvious choice, and the answer is yes.
3. No way involved.
10  Using Arduino / Networking, Protocols, and Devices / Re: HC-05 Bluetooth module Arduino Uno problem on: August 21, 2014, 07:23:56 am

I download Bluetooth Terminal on my Android device, I can't send 1 or 0.
When I send 1 at Serial Monitor led is on and at Bluetooth Terminal I get "LED: on"
I think my RX pin at Arduino is damaged ;/

You could be right

Quote
Led on hc-05 is blink but when I connect with my Android device is blink twice and off for 2 seconds.

I'm afraid I don't understand this

Quote
Can I make RX and TX at another pin ?

Yes you could try using software serial. This allows you to pins other than D0,D1 and this is the only time when it makes sense to do so. There are several examples around. You will need the software serial library
11  Using Arduino / Project Guidance / Re: selection of ic board on: August 20, 2014, 11:41:55 pm
Since this is an Arduino forum, start with this, get 23 connectors, and then progress as you get to be a little more forthcoming about what you want to do, what the sensors are and, perhaps, what you want to sense.

You never know what might be helpful, but few people are going to bother trying to crack your secrets.
12  Using Arduino / Programming Questions / Re: Mega2560 timedout. on: August 20, 2014, 06:55:10 pm
This seems to be a chronic problem. I find the reliable solution is to reboot the PC whenever I change boards. Mega seems to be the main culprit but, once it is sorted, it should consistently load OK.

I keep a list of all the COM ports used on various computers by the several boards
13  Using Arduino / Networking, Protocols, and Devices / Re: HC-05 Bluetooth module Arduino Uno problem on: August 20, 2014, 06:34:31 pm
Hi
I have bluetooth module HC-05 and I C=connect with my Uno

I connect with my xperia l by ArduDroid app, I can connect and get data from arduino but I can't send any data, when I open serial monitor at Arduino Ide and send 1 or 0 led is on or off but by android app i can't


I guess you already know that there is nothing wrong with the code, and the wiring sounds fine. I don't know what an xperia is, or anything about ArduDroid, but it sounds like you are using an Android devicee, and are going through the right procedure. If the LED on the Bluetooth is solid, you are connected, and Android should tell you that anyway.

Your code works fine when using Bluetooth Terminal on my Android phone.   I suggest you try that.
14  Using Arduino / Displays / Re: Looking for readable LCD display without backlight on: August 19, 2014, 08:43:21 pm
I find the 5110 just fine. Perhaps your solution is to have a press-button so that the backlight is only used momentarily. 
15  Using Arduino / Networking, Protocols, and Devices / Re: 2 bluetooth shield having hard time to connect (red light) on: August 19, 2014, 01:45:49 am
i thought the bluetooth was just dependent on its configuration, but it seems not (dependent also in the code installed in the arduino?), the codes inside the microcontroller also affects its time of connectivity?


In normal use, bluetooth is just another serial device and runs as configured.  I think it might be possible to have the code affect the connectivity if the bluetooth is in AT mode.

You might find some help here

http://phillipecantin.blogspot.com.au/2012/01/arduino-bluetooth-link.html
Pages: [1] 2 3 ... 152