Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Stay off till some point. Answered....thanks guys on: January 29, 2013, 08:32:53 pm
What I'm wanting to do is have the tank completely filled then a solenoid shut off the water till the level drops below say %50 and then open the solenoid to fill it again.

Surely a float valve with some hysteresis is all you need here? I don't see any need for it to be controlled electrically never mind electronically, from what you've described so far.

There is two reasons why it's electric/electronic. One reason is I have a solenoid in the water circuit so if i loose power for some reason or the UV bulb burns out it will cut the water off filling the tank. I have a photo cell in the UV filter housing if the bulb goes out the water gets cut if not I'm dumping unsanitized water into my tank. The other reason it's electronic is the tank is in a water shed 80 yards up over the house on the hill. In the summer time when it's dry and the spring not producing good or not at all. I have to walk up and check it every day but with the 7 seg display I can just look up and see what the tank level is. If it gets low I have to start haling it in.
2  Using Arduino / Programming Questions / Re: Set a output to come on then stay off till some point. on: January 29, 2013, 12:52:15 pm
I see the differences in the two now.

Yea the wife and kids would not be happy if the discovered one morning they were out of water.
Thanks guys
3  Using Arduino / Programming Questions / Re: Set a output to come on then stay off till some point. on: January 29, 2013, 12:32:09 pm
(return digital Value)
if (WaterNow==SetHighPoint)then shut valve;
if (WaterNow==SetLowPoint)then open valve;
 
That might work I'll have to try it thanks
4  Using Arduino / Programming Questions / Re: Set a output to come on then stay off till some point. on: January 29, 2013, 12:21:30 pm
lol I never thought of that. Keep this in mind I'm only using one 6" display for the level indicator.

Code:
#include <NewPing.h>

#define TRIGGER_PIN  5  // digital output #3 Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     4  // digital Output #2 Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

int gPin = 12;                
int bPin = 11;                
int dPin = 10;                
int ePin = 9;               // 7 seg display  
int cPin = 8;                
int aPin = 7;                
int fPin = 6;                


void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  
  pinMode(aPin, OUTPUT);        // sets the digital pin as output on 7 seg display
  pinMode(bPin, OUTPUT);        
  pinMode(cPin, OUTPUT);        
  pinMode(dPin, OUTPUT);        
  pinMode(ePin, OUTPUT);        
  pinMode(fPin, OUTPUT);
  pinMode(gPin, OUTPUT);
}

void loop() {
  delay(200);                      // Wait 200ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  
  unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).

  Serial.print(uS / US_ROUNDTRIP_IN); // Convert ping time to distance in inch "IN" or "CM" and print result
  Serial.println();                   // prints to monitor
  
  int val = (uS / US_ROUNDTRIP_IN); //
  
  if(val > 01 && val < 10)         // decimal 0 on display
  {
  digitalWrite(aPin, LOW);        
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, HIGH);
  }
  else if (val > 11 && val < 20)   // decimal 1 on display
  {
  digitalWrite(aPin, HIGH);        
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, HIGH);
  }
  else if (val > 21 && val < 30)   // decimal 2 on display
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, HIGH);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, LOW);
  }
  else if (val > 31 && val < 40)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, LOW);
  }
  else if (val > 41 && val < 50)
  {
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val > 51 && val < 60)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, HIGH);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val > 61 && val < 70)
  {
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, HIGH);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val > 71 && val < 80)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, HIGH);
  }
  else if (val > 81 && val < 90)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val > 91)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
}
5  Using Arduino / Programming Questions / Stay off till some point. Answered....thanks guys on: January 29, 2013, 12:08:14 pm
I wanting to upgrade my spring water treatment system for my house. The way the system works now is spring water is constantly being filtered and sterilized then dumped into a 1,600 gallon tank. As the tank fills up the water overflows out a drain. What I'm wanting to do is have the tank completely filled then a solenoid shut off the water till the level drops below say %50 and then open the solenoid to fill it again.

I have a 7-seg water level indicator driven by a nano and ultrasonic Rx/Tx that's on the tank now and works great. I just have no idea how to set a output to come on till some point and then stay off till some other point.

If some one can point me in a direction I would appreciate it
Thanks 
6  Using Arduino / Installation & Troubleshooting / Bootloader install on Pro mini? on: January 26, 2013, 01:55:37 am
Some time ago I was reading how to install a Bootloader on Pro mini using an Uno. For some reason I can find it again. I have a Uno and a nano for the programmer but I am needing a tutorial. Can someone point me to a video or site with the info.
Thanks
7  Using Arduino / Programming Questions / Re: UNO EEPROM read question on: January 25, 2013, 10:19:36 am
Cool thanks
I have a project that I need to store the data to EEPROM for power loss reasons. That's what I was thinking the limitation was for rewriting an address but I just wanted to check. Thanks for the info
8  Using Arduino / Programming Questions / UNO EEPROM read question Answered Thanks on: January 25, 2013, 08:37:18 am
I have read that UNO chip EEPROM can be written/read around 10,000 times. Is that the same as saying I can only read the EEPROM stored memory only 10,000 times?
And is that referring to each address of the EEPROM as a whole?
9  Using Arduino / Programming Questions / Re: Calibrated outputs and power? on: January 25, 2013, 12:19:58 am
Cool I found some info on it.
Thanks
10  Using Arduino / Programming Questions / Calibrated outputs and power Answered thanks guys on: January 24, 2013, 11:53:53 pm
I have a Uno and a question.
If a program is written with outputs that can be calibrated like "Example/Analog/Calibration sketch". Will the Calibrated input hold the value after the power is removed?

11  Using Arduino / Programming Questions / Re: Are all arduino nano's 5v reference? on: December 07, 2012, 07:37:47 pm
Ok that's what was confusing me
thanks
12  Using Arduino / Programming Questions / Are all arduino nano's 5v reference? on: December 07, 2012, 07:28:07 pm
Are all arduino nano's 5v ttl logic reference?
13  Using Arduino / Programming Questions / Re: HC SR04 and 7 segment display on: December 04, 2012, 01:38:54 am
I can kinda get it to work if I change the section below but I don't understand why?
  int val = (uS); 
                   to
  int val = 8*uS / US_ROUNDTRIP_CM;


14  Using Arduino / Programming Questions / HC SR04 and 7 segment display on: December 04, 2012, 01:14:18 am
I'm having some trouble on getting the two programs to connect. The serial monitor is telling me that the sr04 is working but I dont know how to send that distance to the rest of the program so the display can use it.

If you guys have the time to point me in a direction I could use the help.

Code:
// ---------------------------------------------------------------------------
// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------

#include <NewPing.h>

#define TRIGGER_PIN  3  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     2  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

int aPin = 13;                // Red LED connected to digital pin 13
int bPin = 12;               
int cPin = 11;               
int dPin = 10;                 
int ePin = 9;               
int fPin = 8;
int gPin = 7;   

void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  pinMode(aPin, OUTPUT);        // sets the digital pin as output
  pinMode(bPin, OUTPUT);   
  pinMode(cPin, OUTPUT);
  pinMode(dPin, OUTPUT);
  pinMode(ePin, OUTPUT);
  pinMode(fPin, OUTPUT);
  pinMode(gPin, OUTPUT);
}

void loop() {
  delay(200);                      // Wait 200ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).

  Serial.print(uS / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)

  int val = (uS);  //us inserted instd of val 12/4/12
   
  if(val >= 1 && val <= 100) // else if was inserted in sketch
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, HIGH);
  }
  else if (val >= 101 && val <= 200)
  {
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, HIGH);
  }
  else if (val >= 201 && val <= 300)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, HIGH);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 301 && val <= 400)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 401 && val <= 500)
  {
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 501 && val <= 600)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, HIGH);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 601 && val <= 700)
  {
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, HIGH);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 701 && val <= 800)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, HIGH);
  }
  else if (val >= 801 && val <= 900)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
  else if (val >= 901 && val <= 1023)
  {
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, LOW);
  digitalWrite(gPin, LOW);
  }
}
15  Using Arduino / Programming Questions / Re: Help with RPM code on: November 29, 2012, 06:49:09 pm
Did you check to see what the voltage at that point is in each state?
Pages: [1] 2