Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 145
106  Topics / Home Automation and Networked Objects / Re: Flowmeter sensor on: July 05, 2014, 08:18:17 am
You wouldn't know what the rpm is, and don't need to know either.  All you need to know is the pulses per litre, in this case 60, and any calc can be taken from there.
107  Topics / Home Automation and Networked Objects / Re: Flowmeter sensor on: July 05, 2014, 03:03:26 am
I can't comment much on this. I have never sent flow information to Xively.

The code I use is from Jaycar and Freetronics. Daily quantity readings show it accurate to 0.5%  tested over several weeks. I understand the code is a bit ratty in theory, there is discussion on this forum, but it works in practice. The rough rate readings may be down to mechanical things like the length of straight pipe each side of the turbine.  My Swissflow axial flow turbine is similarly accurate and similarly erratic with the rate.   

I'm not impressed with the way the variables are handled, and I don't understand why the do what they do. Like so many Arduino projects, it appears to be designed in isolation, and with no consideration of how it would fit into a larger project. I don't want to mess about with ints, "."s, and Frac DECs, I want to send floats to Xively along with all my other floats.

Code:
/**
 * Water Flow Gauge
 *
 * Uses a hall-effect flow sensor to measure the rate of water flow and
 * output it via the serial connection once per second.
 * Copyright 2009 Jonathan Oxer <jon@oxer.com.au>
 * Copyright 2009 Hugh Blemings <hugh@blemings.org>
 */

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, A2, 5, 6, 7);

byte sensorInterrupt = 0;  // 0 = pin 2; 1 = pin 3
byte sensorPin       = 2; //

float calibrationFactor = 6.82;

volatile byte pulseCount; 

float flowRate;
unsigned int flowMilliLitres;
unsigned long totalMilliLitres;
unsigned long oldTime;
    unsigned int frac;

void setup()
{
  lcd.begin(16, 2);
    lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print(calibrationFactor);
      delay(2000);
  lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Flow: ");
      lcd.setCursor(11, 0);   
      lcd.print("L/min");
      lcd.setCursor(0, 1);
      lcd.print("Total: ");
      lcd.setCursor(15, 1);   
      lcd.print("L");
  // Initialize a serial connection for reporting values to the host


  // Set up the pair of counter reset buttons and activate internal pull-up resistors

  pinMode(sensorPin, INPUT);
  digitalWrite(sensorPin, HIGH);

  pulseCount          = 0;
  flowRate            = 0.0;
  flowMilliLitres          = 0;
  totalMilliLitres         = 0;
  oldTime             = 0;

 attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}

void loop()
{
  if((millis() - oldTime) > 1000)    // Only process counters once per second
  {
    // Disable the interrupt while calculating flow rate and sending the value to
    // the host
    detachInterrupt(sensorInterrupt);

    flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / calibrationFactor;

    oldTime = millis();

 flowMilliLitres = (flowRate / 60) * 1000;

    // Add the litres passed in this second to the cumulative total
    totalMilliLitres += flowMilliLitres;

    unsigned int frac;
     frac = (flowRate - int(flowRate)) * 10;

    lcd.setCursor(6, 0);

    if(int(flowRate) < 10)
    {
      lcd.print(" ");
    }
    lcd.print((int)flowRate);   // Print the integer part of the variable
    lcd.print('.');             // Print the decimal point
    lcd.print(frac, DEC) ;      // Print the fractional part of the variable


    lcd.setCursor(7, 1);

lcd.print(int(totalMilliLitres / 1000));

    // Reset the pulse counter so we can start incrementing again
    pulseCount = 0;

    // Enable the interrupt again now that we've finished sending output
    attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
  }
}

void pulseCounter()
{
  pulseCount++;
}
108  Using Arduino / Project Guidance / Re: Need help with a simple transmitter on: July 04, 2014, 10:51:24 pm
Ah, there you go then, you should push his green button. One of the great things you learn about Arduino is that, no matter where you want to go, somebody has been at least part of the way before you....
109  Using Arduino / Networking, Protocols, and Devices / Re: Anyone managed to get a JYMCU/HC06 Bluetooth module working with Arduino + Mac? on: July 04, 2014, 09:43:30 pm
I used '1234' as my password and I was in.
.

Good.

I think it is pretty clear now that, if you use OSX, you should be OK with HC-0x. You are not OK with iOS. There have been instances of problems with HC-06, irrespective of what is at the other end. I have no idea what that could be about........
110  Using Arduino / Project Guidance / Re: Need help with a simple transmitter on: July 04, 2014, 09:33:46 pm
I do not want to use gps because locations can change and I do not want to reprogram anything when the location changes.
The distances between the markers will vary from 100 yards to 300 yards and I'm looking at building like 50 of the receive modules.   

OK. But, with distances like that, there are likely to be times when more than one receiver receives, but maybe that doesn't matter.

You may find Arduino IS a solution simply because it is cheap and practical, thereby making gross overkill irrelevant. Not necessarily Arduino per se, but a bare-bones custom-made device developed from Arduino. I imagine a production run of 50 makes this entirely practical, as well as the most economical.     
111  Using Arduino / Project Guidance / Re: Sun position calculator - i'm looking for good code to calculate values on: July 04, 2014, 09:15:31 pm
I do hope this query has nothing to do with aiming a solar panel at the sun.

He apparently doesn't want to confirm or deny. He may be an astronomer. Standard works on these matters are by Peter Duffet-Smith and Jan Meeus and they should be as easily translatable to Arduino as they are to Commodore 64.  I bet somebody has already done it and they are well-known through the astro mafia. Google is likely to find libraries based on them. 
112  Using Arduino / Project Guidance / Re: Need help with a simple transmitter on: July 04, 2014, 08:45:01 pm
This doesn't sound like a good idea at all. You seem to be relying entirely on an unknown variable - the signal strength, or the lack of it, of a moving transmitter. So what is the real objective? How far apart are the receivers? And who is looking at the LEDs? And why? By the way you describe it, you probably don't need Arduinos.

If you are serious about it, an Arduino with GPS in the vehicle might work well. It just needs to constantly check its position relative to the receiving stations, and send a coded broadcast accordingly.  Who knows? you might even be able to dispense with the LEDs.
113  Using Arduino / Project Guidance / Re: Weather Station Data Acquisition on: July 04, 2014, 08:18:57 pm
http://www.ebay.com/itm/281015256067?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

$50 at the Arduino end should cover it. I guess, if you work really hard at it, you will find a way to spend the other $2950.
114  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Wireless Bluetooth Transceiver Module phone connecting problem on: July 04, 2014, 08:02:43 pm
I'm a bit surprised that the terminal app would be the problem. It sounds more like user error. IF you have ensured you have two way traffic, you might find that the app is OK now.

I don't know anything about switching LEDs. I don't even know what sort of signal comes out of the phone, but it might be a very short one. The code looks kosher but it's possible that you can't see what's happening.  Try increasing the delay to 1000.
115  Topics / Home Automation and Networked Objects / Re: Flowmeter sensor on: July 04, 2014, 07:35:04 pm
Accumulate ten readings taken at one second intervals against a 1-10 counter, divide the result by ten, post it, and reset the counter. 
116  Using Arduino / Project Guidance / Re: Online data logger - Arduino requirements and quick start! on: July 04, 2014, 01:24:48 am

2. ACS712 20A current sensor


I have only just started to look into this but I can't see what more you could ask for than a ACS712 good for 30A? They are convenient, properly packaged, made for the job, and yours for $2.32, post free.
117  Using Arduino / Project Guidance / Re: Power between shields - VIN and 5v on: July 03, 2014, 11:22:32 pm
The Mega regulator is only good for 800mA. And probably not even that from a 9V source.

Yes. Hence the Etehrnet shield having its own regulator, and hence the recommendation that the GSM is supplied with a separate 5v supply.

Quote
The reverse polarity diode from the barrel jack to Vin is only good for 1A.

OK. Now that will be the diode Grumpy alluded to nearby, but I didn't know where it was. I guess that accounts for the 8.6v at the VIN. But the objective is to not use that barrel jack.

Quote
If there is a higher capacity regulator elsewhere in the "system" I would let that supply 5V power to the rest.

The recommended supply for the GSM is 5v 2A, which I have ordered. I did not originally intend to use the Ethernet shield and 2A might not be enuff if I do.  The bigger problem is how do I get the power to the Ethernet shield?
118  Using Arduino / Storage / Re: Resetting Time recording on: July 03, 2014, 11:01:43 pm
Possibly the former. The SD takes time to do its job. You might be screwing it up by not allowing it breathing space.  you need to consider how frequently you really need to read thee sensors. For starters, try inserting

delay(200);

in the loop.
119  Using Arduino / Project Guidance / Power between shields - VIN and 5v on: July 03, 2014, 08:59:08 pm
I'm trying to get my head around how to power a collection of shields off a single supply.

The problems in the stack are:

        SIM900     on top of
        Ethernet    on top of
        Mega

I guess the order doesn't matter, but it might......

I recognise that the recommended supply for the SIM900 is a separate 5v 2A supply, using the jack provided. This is the supply that I am trying to use to feed everything.

I understand that the Ethernet shield is normally fed by Arduino from the VIN pin, via its on-board regulators.  I therefore assume that the 5v pin thereon is just pass through.  The problem is that, while I think it's a bad idea, it is possible that Arduino + Ethernet can be powered off the USB cable at 5v, implying Ethernet is powered from the 5v pin. This would imply that the Ethernet shield is pretty smart and, when the combo is powered by 9v, it takes its power from where it can get it i.e. both from the regulator and the 5v pin.

So I don't know what's going on. The diagram shows the thinking so far.

The objectives are:

1.   disconnect the 9v supply
2. feed Ethernet from the 5v supply




120  Using Arduino / Project Guidance / Re: Questions about shields on: July 03, 2014, 09:28:46 am
I suppose that someone has built a project that has both modules & shields. It must be a rats' nest of wires.

The pic above shows a module on a shield and another connected by ribbon cable. Yes, there is a bit of a rat's nest, but yoiu can't see it.

In this case, the modules get power off the shield, which gets it off the Mega.

Quote
How are the shields powered? Do they draw power from the main board or are they powered by USB or a power jack? Likewise, how are the modules powered?

Shields are typically powered off the main board. Ethernet shields are power-hungry and are supplied off the Vin pin via their own regulators. My GSM shield is worse and has to fed with 5v via its own jack. It appears that that will power the whole stack, but I'm about to ask how.

Quote
Can modules be mounted on empty shields & be organized that way?

See pic above. The shield was originally empty.
Quote
The Arduinos are mainly for experimenting or prototyping. Suppose that someone wants to actually build something from the prototype & wants to merge all of the modules & shields into one PCB. How does one do that?


By designing a PCB that has all the relevant components and none of the irrelevant components. Components can include modules.
Pages: 1 ... 6 7 [8] 9 10 ... 145