Show Posts
Pages: 1 2 [3] 4 5 ... 154
31  Using Arduino / Networking, Protocols, and Devices / Re: Android device controlling Arduino via Wi-Fi on: August 31, 2014, 07:31:14 pm

So is there a Wi-Fi module that can communicate with Android device without connecting to network?

Probably not, since the sole purpose of WiFi is to enable you to participate in a network. Your first problem is to find an Android app that enables you to bypass the network.

While bluetooth is typically only good for 10m, you can get more powerful types good for 100m which may be suitable.
32  Using Arduino / Networking, Protocols, and Devices / Re: progs needed for I2C Tiny RTC DS1307 Real Time Clock Module AT24C32 Board for ar on: August 31, 2014, 07:21:06 pm
I found this the best

and it is the most efficient as far as code space is concerned.  I have four of the eBay cheapies, and they are fine. They aren't chronometers, but who expects a chronometer for $1.99?  They gain about a minute in a month, which is fine for most people.

Their most common use is for timestamping locally stored data, you will find plenty of use4ful examples round here.
33  Using Arduino / Sensors / Re: A lot of flowsensors on: August 29, 2014, 11:23:54 pm

That's the sort I use. Mine are 3/4 BSP. They work the same way.
You might find this useful.
I find reading the rate is pretty useless but the flow quantity is very accurate.

so output is a pulsing signal and connected at digital pin 2. So i tought a Mega has 54 dig. pins. but since i will be using 4 megas i only need 90/4 = 23 digital input pins. Correct me if i'm wrong.

I believe only six pins can be used for interrupt on a Mega, hence my previous.

34  Using Arduino / Sensors / Re: A lot of flowsensors on: August 29, 2014, 08:30:27 pm
If I understand things correctly, there are grounds for doubt about all of the above, but you need to properly clarify your intentions.

 I think the real problem is all to do with what the sensor is actually sensing, what sort of information is passed, and how the Arduino handles that.

IF all you are sensing is the presence of flowing water, i.e. the tap is on, your hall effect sensor is just a switch and you merely need to poll 90 of them in a loop to see which are on. That can't be too hard - just a lot of wiring.

BUT IF you are measuring the actual flow of the water, rather than its mere presence, AND Arduino is doing the counting, your hall effect devices will be be sending constant pulses to Arduino, and the standard way of doing this is by using interrupts.  I believe the Mega has six interrupts and therefore can handle six hall effect turbines, I don't think the port expanders Grumpy is on about will fix the problem, and you will need fifteen Megas.

There may be some economic middle ground, determined by interrupts/dollar, wiring costs, and your geography.

35  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.
36  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.
37  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.
38  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.

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.

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.

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

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

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.
39  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.

40  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?
41  Using Arduino / Networking, Protocols, and Devices / Re: HC-05 Bluetooth module Arduino Uno problem on: August 21, 2014, 06:20:06 pm
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.
42  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.

//  This Arduino sketch reads DS18B20 "1-Wire" digital
//  temperature sensors.

#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

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);

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

  pinMode(53, OUTPUT);

 if (!SD.begin(chipSelect))
    delay (2000);
  lcd.println("init. OK!");

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

void loop() {

  if (hour == 0 && minute == 0 && second <2)

  //get the values from the DS8B20's

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

  diff = OutTemp - InTemp;
  Serial.print(" ,  ");
  Serial.print(" ,  ");
  Serial.print(" ,  ");
  lcd.print (OutTemp);


  if (k>9 )
  myFile =, FILE_WRITE);//<<<<<<<<<<<<< OPEN

}  // 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
  byte zero = 0x00;
  Wire.requestFrom(DS1307_ADDRESS, 7);

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

void getFileName(){

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

void running(){
  lcd.print("\001C ");
  lcd.print("\001C ");
  lcd.print("\001C ");
  lcd.print("\001C ");
43  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.
44  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

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

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
45  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.
Pages: 1 2 [3] 4 5 ... 154