Show Posts
|
|
Pages: [1] 2 3 ... 8
|
|
4
|
Using Arduino / Project Guidance / Re: Suggestion how to monitor the level of propane/butane gas cylinder
|
on: March 18, 2013, 09:55:18 pm
|
I think I'd go low tech with a limit switch. On my old gas grill the tank was set a little offset on an edge under the end of the grill with a little wire arm that stuck out the front (in an empty/full slot). A spring was attached to the top of the tank pulling it opposite to the natural full tank tilt to the offset side. As the tank empied the spring would gradually pull the tank back from the heavier offset side, moving the fuel indicater wire back toward the empty side of the slot it was in. The tall tank could be set on a piece of wood with a slightly offset ~ 1/8" dowel under it. The full heavy tank would slightly tilt to the offset side. Instead of a spring on the top of the tank pulling it in the opposite direction, an arm with a weight attached to the top of the tank could probably do the same. When the tank got empty the weighted arm would cause the tank to tilt to the weighted arm side, actuating a limit switch. teeter-totter tank.
but what if you are not home? go high tech dude.
|
|
|
|
|
9
|
Topics / Robotics / Re: Automatically adjust my solar panels
|
on: March 12, 2013, 01:59:16 pm
|
just move it yourself every few weeks.
lmao, if thats the way you think then you probably dont belong in this forum. like who would wanna go on their roof to move six of those? automation is the future dude!
|
|
|
|
|
11
|
Topics / Robotics / Re: Automatically adjust my solar panels
|
on: March 10, 2013, 12:45:59 pm
|
The linear actuator idea is great but if you are fairly crafty you could custom make a linear actuator. I have made one with threaded rod, rod coupler for the moving train, two bearings, and a gear head motor. This doesn't have any position feedback but a rotary encoder could easily be implemented.
Do you have a plan on how to orient the panels? I have had good small scale luck with a 30 degree pyramid with 4 photo-resistors in the middle of each face. Biggest downfall to photo-resistors is that they aren't that great for reading direct light levels as they have a logrithmic curve. They have more resolution reading "darkness" than vise versa. This is where the pyramid comes in, it will cast a shadow on one side giving a better difference in values to read with and Arduino.
i will buy cheap low rpm 12v motor. then instead of using the photo-resistors i will program them from the aduino to goto the correct angle determined by the tilt table at http://www.macslab.com/optsolar.htmlIf your latitude is between 25° and 50°, then the best tilt angles are: For summer, take the latitude, multiply by 0.92, and subtract 24.3 degrees. For spring and autumn, take the latitude, multiply by 0.98, and subtract 2.3 degrees. For winter, take the latitude, multiply by 0.89, and add 24 degrees. so something like this int Angle = 42; int Day = ? pinMode(Day, INPUT); pinMode(Angle, OUTPUT); (Spring= March, April, May); if(Day=March) {digitalWrite(Angle=41.7x0.98-2.3);} yadda yudda yadda
|
|
|
|
|
15
|
Using Arduino / Programming Questions / Re: Sketch help? Several sensor inputs and outputs, use analog or digital pins?
|
on: March 07, 2013, 04:18:58 pm
|
i finally got the DS18B20 to light up led #include <OneWire.h> //This is my first ever sketch i am writing for my 2650. i might need help. //This sketch will eventually control my camper with my droid or voice. //I will worry less about things going wrong with my off grid trailer.
//Start of my pins int Water = A0; //Voltage sensor for SeeLevel II water tank sensor strip int Electret1 = A1;//amplifier output connected to analog pin 1 int Temp1 = A2; //DS18B20 temperature sensor under camper int Temp2 = A3; //DS18B20 temperature inside camper int Smoke = A4; //Smoke sensor int Gas = A5; //Flammable gas sensor int CMD = A6; //Carbon Monoxide Detector int Cat = A7; //Arduino Motion Sensor Detector int Tank1 = A8; //load sensor pin for propane tank 1 blue wire int Tank2 = A9; //load sensor pin for propane tank 2 blue wire int Humid1 = A12; //pin for humidity sensor inside int Humid2 = A13; //pin for humidity sensor inside int Volts = A14; //battery bank voltage int Amps = A15; //amps being used int ElectretLED1 = 22; // led will light up when i talk int RB1 = 24; //red and blue warning led for Temp1 int RB2 = 26; //red and blue warning led for Tank1 int RB3 = 28; //red and blue warning led for Tank2 int RB4 = 30; //red and blue warning led for low Water int Relay1 = 32; //turns on relay switch when Temp1 goes below 32degrees. int RB5 = 34; //red and blue warning led for motion sensor int Buzz1 = 36; //piezo alarm for smoke Detector int Buzz2 = 38; //piezo alarm for Flammable gas sensor int Buzz3 = 36; //piezo alarm for Carbon Monoxide Detector int Light1 = 23; //Will control 1156 bulbs inside camper. int Light2 = 25; //Will control 1156 bulbs inside camper. int Light3 = 27; //Will control 1156 bulbs inside bathroom. int Light4 = 29; //Will control 1156 bulb outside camper. int val = 0; //not sure what this does but its needed. //end of my pins
//Start Electret1 mini condenser microphone. these variables will change int sensorReading = 0;// variable to store the value read from the sensor pin int sensorMax = 0; int sensorMin = 1023; int threshold = 100; //End electret microphone //Start DS18B20 int SensorPin = A2; OneWire ds(SensorPin); //End DS18B20 int HighByte, LowByte, TReading, SignBit, Tc_100, Whole, Fract; void setup() { Serial.begin(9600); pinMode(SensorPin, INPUT); pinMode(Temp1, INPUT); pinMode(Temp2, INPUT); pinMode(Tank1, INPUT); pinMode(Tank2, INPUT); pinMode(Humid1, INPUT); pinMode(Humid2, INPUT); pinMode(Electret1, INPUT); pinMode(Water, INPUT); pinMode(Volts, INPUT); pinMode(Amps, INPUT); pinMode(RB1, OUTPUT); pinMode(RB2, OUTPUT); pinMode(RB3, OUTPUT); pinMode(RB4, OUTPUT); pinMode(Relay1, OUTPUT); pinMode(Light1, OUTPUT); pinMode(Light2, OUTPUT); pinMode(Light3, OUTPUT); pinMode(Light4, OUTPUT); pinMode(ElectretLED1, OUTPUT); //end my pinmode code
//Start Electret1 microphone digitalWrite(ElectretLED1, HIGH); while (millis() < 3000) {threshold = analogRead(Electret1); // record the maximum sensor value if (threshold > sensorMax) {sensorMax = threshold;} } // signal the end of the calibration period digitalWrite(ElectretLED1, LOW); threshold = sensorMax; //End Electret1 microphone }//end setup
void loop() {
//two 4wire load sensors outside to measure how much propane i have in each 20lb tank if (analogRead(Tank1) <= 17) {digitalWrite(RB2, HIGH);}//led alerts me when 20lb propane tank 1 is low if (analogRead(Tank1) >= 18) {digitalWrite(RB2, LOW);}//led is off for propane tank 1 if (analogRead(Tank2) <= 17) {digitalWrite(RB3, HIGH);}//led alerts me when 20lb propane tank 2 is low if (analogRead(Tank2) >= 18) {digitalWrite(RB3, LOW);}//led is off for propane tank 2 //end two load sensors outside
//start DS18B20 digital temperature sensor under camper. byte i; byte present = 0; byte data[12]; byte addr[8]; if ( !ds.search(addr)) {Serial.print("No more addresses.\n"); ds.reset_search(); return;} Serial.print("R="); for( i = 0; i < 8; i++) {Serial.print(addr[i], HEX); Serial.print(" ");} if ( OneWire::crc8( addr, 7) != addr[7]) {Serial.print("CRC is not valid!\n"); return;} if ( addr[0] == 0x10) {Serial.print("Device is a DS18S20 family device.\n");} else if ( addr[0] == 0x28) {Serial.print("Device is a DS18B20 family device.\n");} else {Serial.print("Device family is not recognized: 0x"); Serial.println(addr[0],HEX); return;} ds.reset(); ds.select(addr); ds.write(0x44,1);// start conversion, with parasite power on at the end delay(1000); // maybe 750ms is enough, maybe not // we might do a ds.depower() here, but the reset will take care of it. present = ds.reset(); ds.select(addr); ds.write(0xBE); // Read Scratchpad Serial.print("P="); Serial.print(present,HEX); Serial.print(" "); for ( i = 0; i < 9; i++) {data[i] = ds.read(); //we need 9 bytes Serial.print(data[i], HEX); Serial.print(" ");} Serial.print(" CRC="); Serial.print( OneWire::crc8( data, 8), HEX); Serial.println(); //End DS18B20 digital temperature sensor under camper. LowByte = data[0]; HighByte = data[1]; TReading = (HighByte << 8) + LowByte; SignBit = TReading & 0x8000; // test most sig bit if (SignBit) // negative { TReading = (TReading ^ 0xffff) + 1; // 2's comp } Tc_100 = (6 * TReading) + TReading / 4; // multiply by (100 * 0.0625) or 6.25
Whole = Tc_100 / 100; // separate off the whole and fractional portions Fract = Tc_100 % 100;
if (SignBit) // If its negative { Serial.print("-"); } Serial.print("Temp1: "); Serial.print(Whole); Serial.print("."); if (Fract < 10) { Serial.print("0"); } Serial.print(Fract);
Serial.print("\n");
//Start heat tape and leds for DS18B20 temperature sensor if ((Whole) < 4) {digitalWrite(Relay1, HIGH);}//turns on heat tape or something //to warm up an outside pipe while using the least amount of power at night. if ((Whole) > 4) {digitalWrite(Relay1, LOW);}//and then shuts heat tape off. if ((Whole) < 4) {digitalWrite(RB1, HIGH);}//turns on warning LED inside if ((Whole) > 4) {digitalWrite(RB1, LOW);}//and shuts LED off //end flashing warning led for DS18B20 temperature sensor
//Start reading the voltage sensor for SeeLevel II water tank sensor strip that i will need help with please int sensorValue = analogRead(A0); // Convert the digital voltage reading from (11V - 15V) to a percent (0% - 100%) float voltage = sensorValue * (11.0 / 15.0); if (analogRead(Water) > 5) {digitalWrite(RB4, LOW);}//Shuts off red and blue LED if (analogRead(Water) < 5) {digitalWrite(RB4, HIGH);}//Activates red and blue warning LED Serial.print("Water Level: "); Serial.println(voltage); // seriel print out the value you read: //End reading the water voltage sensor
//start analog electret code sensorReading = analogRead(Electret1); //read sensor & store it in variable sensorReading // if the sensor reading is greater than the threshold: if (sensorReading > threshold) {digitalWrite(ElectretLED1, HIGH);} if (sensorReading < threshold) {digitalWrite(ElectretLED1, LOW);} //end electret code //display all sensors onto the arduino serial monitor. //in future displayed on droid app, a webpage and laptop with wifishield. Help? Serial.print("Water: "); Serial.print(Water); Serial.println(""); Serial.print("Tank1: "); Serial.print(Tank1); Serial.println(""); Serial.print("Tank2: "); Serial.print(Tank2); Serial.println(""); Serial.print("Temp1: "); Serial.print(Temp1); Serial.println(""); Serial.print("Temp2: "); Serial.print(Temp2); Serial.println(""); Serial.print("Humidity: "); Serial.print(Humid1); Serial.println(""); Serial.print("Volts: "); Serial.print(Volts); Serial.println(""); Serial.print("Amps: "); Serial.print(Amps); Serial.println(""); Serial.print("Sound: "); Serial.println(sensorReading); Serial.println(""); //end serial monitor
delay(1000); //this rechecks every 1 second? }
|
|
|
|
|