⚠️ This forum has been restored as a read-only archive so the knowledge shared by the community over many years remains available. New registrations and posting are disabled.

All times are UTC + 8 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Oct 7th, '12, 10:37 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
So I thought i had better start documenting my project. I picked up an etherten (Arduino clone) from Jaycar awhile ago;
to which I've made up lm335a 2 temp sensors;
Image
I'm also adding a ultrasonic sensor to measure tank levels;
Image
I bought a flow sensor but unfortunately I think the impeller will get clagged up with solids, I might add that in later when I get time.

I'm thinking of posting hourly to twitter and using prowl for low level notifications.

Hopefully I'll have it up and running today :crash:


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Oct 7th, '12, 12:36 
A posting God
A posting God
User avatar

Joined: Oct 16th, '11, 06:12
Posts: 2019
Gender: Male
Are you human?: 0110010110
Location: Brisbane, qld
Great! Looking forward to see it up and running. Feel free to post schematics etc if applicable ;)


Top
 Profile  
Reply with quote  
PostPosted: Oct 7th, '12, 12:46 
A posting God
A posting God
User avatar

Joined: Dec 10th, '11, 15:03
Posts: 2089
Gender: Male
Are you human?: What is human?
Location: Perth Hills
Cool man. You ping sensor is a bit better than mine. I just used some electrical tape to the side of the tank :P


Top
 Profile  
Reply with quote  
PostPosted: Oct 7th, '12, 14:06 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
Looks like the Etherten can't access the SD card and the Ethernet at the same time.... Stuck on how to alternate between the two. :angryfire:


Top
 Profile  
Reply with quote  
PostPosted: Oct 7th, '12, 14:16 
A posting God
A posting God
User avatar

Joined: Dec 10th, '11, 15:03
Posts: 2089
Gender: Male
Are you human?: What is human?
Location: Perth Hills
I have not used an arduino before, but it looks like you just need to toggle the select pin in your code, based on the info on this site...

http://www.freetronics.com/pages/etherten-quickstart-guide


Top
 Profile  
Reply with quote  
PostPosted: Oct 7th, '12, 14:19 
A posting God
A posting God
User avatar

Joined: Dec 10th, '11, 15:03
Posts: 2089
Gender: Male
Are you human?: What is human?
Location: Perth Hills
Off the top of my head arduino uses 'sketches' which are the code you can download? You might have to remove the chip select code from the provided code and control that as you require, or modify the existing code so that it un-selects after it has sent/read the data to free up the 3 communication pins.


Top
 Profile  
Reply with quote  
PostPosted: Oct 7th, '12, 18:54 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
I've posted the code on a Arduino forum :upset:


Top
 Profile  
Reply with quote  
PostPosted: Oct 18th, '12, 12:34 
Newbie
Newbie

Joined: Feb 25th, '12, 19:29
Posts: 31
Images: 7
Gender: Male
Are you human?: it's a possibility
Location: Lake Maquarie N.S.W Australia
Any joy with you Arduino setup?


Top
 Profile Personal album  
Reply with quote  
PostPosted: Oct 22nd, '12, 19:36 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
Done a bit of work on this one today; but moving from USB power to POE has caused some issues with the LM335A calibration, I might have to buy an LCD module to fix it. I will post images when I get a chance and its not so dark.

Link to twitter feed


Top
 Profile  
Reply with quote  
PostPosted: Oct 22nd, '12, 19:51 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
Here's the code;

Code:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <Twitter.h>
#include <HTTPClient.h>
#include <Avviso.h>

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
unsigned int localPort = 8888;
const int pingPin = 7;
IPAddress timeServer(192, 43, 244, 18);
const int NTP_PACKET_SIZE= 48;
byte packetBuffer[ NTP_PACKET_SIZE];
EthernetUDP Udp;


long Lastprowl = 0;
long Lasttwitter = 0;
Twitter twitter("Secret code"); // twitter
String dataString;

void setup()

  Serial.begin(9600);
  Serial.println("Connecting Nets");

  if (Ethernet.begin(mac) == 0)
  {
    Serial.println("Failed to configure Ethernet using DHCP");
    return;
  }
  Udp.begin(localPort);
  Avviso.begin();
  Avviso.setApplicationName("Belleye Aquaponics");
}

void loop()
{
  sendNTPpacket(timeServer); // send an NTP packet to a time server
  delay(1000); 
  if ( Udp.parsePacket() ) { 
    Udp.read(packetBuffer,NTP_PACKET_SIZE);  // read the packet into the buffer
    unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); 
    unsigned long secsSince1900 = highWord << 16 | lowWord; 
    secsSince1900 = secsSince1900 + (8*60*60);
    dataString = "";
    dataString += secsSince1900;
    dataString += (", air = ");
    long celsius = (analogRead(0) * 0.004882812 * 100) - 2.5 - 273.15; 
    dataString += celsius;
    dataString += (", water = ");
    celsius = (analogRead(1) * 0.004882812 * 100) - 2.5 - 273.15; 
    dataString += celsius;
    // ping
    float tempL;
    long duration, cm, litres;
    pinMode(pingPin, OUTPUT);
    digitalWrite(pingPin, LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin, LOW);
    pinMode(pingPin, INPUT);
    duration = pulseIn(pingPin, HIGH);
    cm = microsecondsToCentimeters(duration);
    tempL = 100 - cm;
    tempL = tempL * 10;
    litres = tempL;
    dataString += (", ");
    dataString += litres;
    dataString += (" litres in IBC");
    // prowl
    if (cm > 90 and (secsSince1900 - Lastprowl) > 1800)
    {
      Avviso.setApiKey("Another secret code"); //this key found by logging into prowlapp via web browser
      Avviso.push("Warning", "Water level low", 0);
      Lastprowl = secsSince1900;
    }
    if ((secsSince1900 - Lasttwitter) > 3600)
    {
      Serial.println(dataString);
      char msg[125];
      String termTweet = dataString + "\0" ;// Terminate the tweet with a null
      int twtlen = (termTweet.length()+3);
      termTweet.toCharArray(msg,twtlen); // Convert it to an array called msg
      if (twitter.post(msg))
      {
        int status = twitter.wait(&Serial);
        if (status == 200)
        {
          Serial.println("OK.");
        }
        else
        {
          Serial.print("failed : code ");
          Serial.println(status);
        }
      }
      Lasttwitter = secsSince1900;
    }
  }
  for (int x = 1; x < 11; x++)
    {
      dataString = ("air = ");
      long celsius = (analogRead(0) * 0.004882812 * 100) - 2.5 - 273.15; 
      dataString += celsius;
      dataString += (", water = ");
      celsius = (analogRead(1) * 0.004882812 * 100) - 2.5 - 273.15; 
      dataString += celsius;
      Serial.println(dataString);
      delay(1000);
    }   
}
unsigned long sendNTPpacket(IPAddress& address)
{
  // set all bytes in the buffer to 0
  memset(packetBuffer, 0, NTP_PACKET_SIZE);
  // Initialize values needed to form NTP request
  // (see URL above for details on the packets)
  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
  packetBuffer[1] = 0;     // Stratum, or type of clock
  packetBuffer[2] = 6;     // Polling Interval
  packetBuffer[3] = 0xEC;  // Peer Clock Precision
  // 8 bytes of zero for Root Delay & Root Dispersion
  packetBuffer[12]  = 49;
  packetBuffer[13]  = 0x4E;
  packetBuffer[14]  = 49;
  packetBuffer[15]  = 52;

  // all NTP fields have been given values, now
  // you can send a packet requesting a timestamp:          
  Udp.beginPacket(address, 123); //NTP requests are to port 123
  Udp.write(packetBuffer,NTP_PACKET_SIZE);
  Udp.endPacket();
}
long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}


The LM335A(s) are plugged into pins 0 and 1, the ping sensor is plugged into digital 7.


Top
 Profile  
Reply with quote  
PostPosted: Oct 22nd, '12, 19:53 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
I sort of used this method to waterproof the sensors;



Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '12, 16:27 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
Overview:
Image
overview by belleye, on Flickr
Installed:
Image
installed by belleye, on Flickr

Haven't managed to get the SD card to write and the prowl notification seems a little buggy but at least it is posting stuff now.


Top
 Profile  
Reply with quote  
PostPosted: Nov 13th, '12, 15:59 
Legend Member
Legend Member

Joined: Aug 29th, '07, 15:18
Posts: 751
Location: the moon
Gender: None specified
Are you human?: no
Location: space
belleye looks interesting. i would not have considered using the sonic pinger for distance measurement. is it accurate measuring the water?

for a flow meter you might find a rotary encoder on a water wheel could be decorative and more functional.

if you want arduino parts, dx.com is by far the best.


Top
 Profile  
Reply with quote  
PostPosted: Nov 13th, '12, 19:32 
Valued Contributor
Valued Contributor
User avatar

Joined: Nov 23rd, '11, 20:13
Posts: 76
Location: Perth WA
Gender: Male
Blog: View Blog (3)
Are you human?: YES
Location: Australia, WA, Forrestfield
The ping))) has been working flawlessly, the system is currently down after i ran out of time upgrading the code. Hopefully I'll have it back up next week with an LCD module for tuning the temp probes. Thanks for the link I'll check it out.


Top
 Profile  
Reply with quote  
PostPosted: Nov 16th, '12, 14:42 
Legend Member
Legend Member

Joined: Aug 29th, '07, 15:18
Posts: 751
Location: the moon
Gender: None specified
Are you human?: no
Location: space
I noticed people were looking at detecting airpump/pump failures, this might be a neat way

http://dx.com/p/ac-ta12-100-current-sen ... red-161183

monitor the current on the AC power and send an alert via sms or email using one of the many wireless arduino modules. it's save to say if the unit fails the current draw will change.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC + 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.052s | 15 Queries | GZIP : Off ]