Pages: 1 [2] 3   Go Down
Author Topic: Project iCamper  (Read 9108 times)
0 Members and 1 Guest are viewing this topic.
Tasmania - Australia
Offline Offline
Sr. Member
****
Karma: 14
Posts: 307
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I must admit there is not too much for the compiler to verify.

What are you wanting to do, really?
I imagine it would really help you if you wrote a functional description of your project.
What this will look like will be an abstract overview, an objective detailing your desired outcome based on certain criteria, a technical description on how you intend it to function with both hardware and software, and possible consideration for those unlikely but highly probable problems.

A block diagram or flow chart is always a good place to start.

So, just a quick look at your code, some commenting will again always be a very good thing, to help you remember later on but also if you wish for us to understand what it is you are doing in your program.

I have lots of questions or remarks about your code, probably longer than your code in fact.
But why are you bringing in those microphone inputs into your Arduino, I thought they would go to a special voice board you had?

Are you asking for help on your program?

Paul
« Last Edit: February 06, 2013, 09:53:32 pm by rockwallaby » Logged


Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

But why are you bring in those microphone inputs into your Arduino, I thought they would go to a special voice board you had?
Are you asking for help on your program?
Paul

im waiting to get the wifi, bluetooth and voice shields from china when i get the money.
i will ad more comments to the code soon.
Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8501
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i have 255watts of solar panels charging 9 absorbed glass mat batteries
This seems quite unbalanced unless the batteries are small.

OTOH if the 255W keeps up then your batteries are not getting discharged much and that's a good thing.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i have 255watts of solar panels charging 9 absorbed glass mat batteries
This seems quite unbalanced unless the batteries are small.

OTOH if the 255W keeps up then your batteries are not getting discharged much and that's a good thing.

_____
Rob

i have a total of 407Ah. for more info goto http://arduino.cc/forum/index.php/topic,145777.0.html
« Last Edit: February 07, 2013, 09:47:18 am by TrailerTrash » Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

DOH! i forgot to buy the voltage sensor to read my water level sensor. but i would hate to run a wire thru. i will check ebay for something to read 11V-15V. ironic that i need a sensor to read another sensor, huh?

http://www.ebay.com/itm/FrSky-TELEMETRY-Battery-Voltage-Sensor-FVBS-01-/140847262550 $7.99
http://www.ebay.com/itm/High-Sensitivity-Voltage-Sensor-Module-Arduino-Compatible-/270941562338 $8.58
« Last Edit: February 07, 2013, 11:30:41 am by TrailerTrash » Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you asking for help on your program?

Paul

i wanna teach myself but........
the serial monitor is not replacing the old info in the loop.
it just prints the next under the old. here is my updated code.

Code:
//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.
//Worrying can lead to high anxiety. Stress affects you emotionally and physically.

int Water = 22; //Voltage sensor for my SeeLevel II water tank sensor strip
int Tank1 = 24; //load sensor for propane tank 1
int Tank2 = 25; //load sensor for propane tank 2
int Humid1 = 26; //humidity sensor inside
int Temp1 = 42; //DS18B20 temperature sensor under camper
int Temp2 = 27; //DS18B20 temperature inside camper
int Volts = 28; //battery bank voltage
int Amps = 29; //amps being used
int Relay1 = A0; //turns on a relay switch when Temp1 goes below 32degrees
int Mic1 = A2; //Electret mini condenser microphone
int Mic2 = A3; //Electret mini condenser microphone
int Mic3 = A4; //Electret mini condenser microphone
int RB1 = A8; //red and blue blinking led
int RB2 = A9; //red and blue blinking led
int val = 0; //not sure what this does but its needed
int Light1 = A10; //Will control 1156 Leds inside. or maybe i need digital pin.
int Light2 = A11; //Will control 1156 Leds inside. and might need some relays.
int Light3 = A12; //Will control 1156 Leds inside. oh shit, what did i get myself into?
int Light4 = A13; //Will control 1156 Leds outside.
//end of my int pins

//Start Code for one electret microphone
// these constants won't change:
const int ledPin = 13;   // led connected to digital pin 13
const int electret = A1;// the amplifier output is connected to analog pin 1
// 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;
//End Code for the electret microphone


void setup() {
// put your setup code here, to run once:
Serial.begin(9600);  // initialize serial communications
pinMode(Temp1, INPUT);
pinMode(Temp2, INPUT);
pinMode(Tank1, INPUT);
pinMode(Tank2, INPUT);
pinMode(Humid1, INPUT);
pinMode(Mic1, INPUT);
pinMode(Mic2, INPUT);
pinMode(Mic3, INPUT);
pinMode(Water, INPUT);
pinMode(Volts, INPUT);
pinMode(Amps, INPUT);
pinMode(RB1, OUTPUT);
pinMode(RB2, OUTPUT);
pinMode(Relay1, OUTPUT);
pinMode(Light1, OUTPUT);
pinMode(Light2, OUTPUT);
pinMode(Light3, OUTPUT);
pinMode(Light4, OUTPUT);
//end my pinmode code

//Start Code for electret microphone
  pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
  while (millis() < 3000) {
    threshold = analogRead(electret);
    // record the maximum sensor value
    if (threshold > sensorMax) {
      sensorMax = threshold;
    }
  }
  // signal the end of the calibration period
  digitalWrite(13, LOW);
  threshold = sensorMax;
//End Code for electret microphone

}//end setup

//these will read inputs and write them somewhere that can be seen in a droid app.
//and also to be seen on my laptop online when im home or away. i will need help.
void loop() {
val = digitalRead(Temp1);
digitalWrite(Temp1, 0);
val = digitalRead(Temp2);
digitalWrite(Temp2, 0);
val = digitalRead(Humid1);
digitalWrite(Humid1, 0);
val = digitalRead(Water);
digitalWrite(Water, 0);
val = digitalRead(Tank1);
digitalWrite(Tank1, 0);
val = digitalRead(Tank2);
digitalWrite(Tank2, 0);


//two load sensors outside to measure how much propane i have in each 20lb tank
if (Tank1 <= 17)
{digitalWrite(RB1, HIGH); }//led alerts me when 20lb propane tank 1 is low
if (Tank2 <= 17)
{digitalWrite(RB2, HIGH); }//led alerts me when 20lb propane tank 2 is low
if (Tank1 >= 18)
{digitalWrite(RB1, LOW); }//led is off for propane tank 1
if (Tank2 >= 18)
{digitalWrite(RB2, LOW); }//led is off for propane tank 2
//end load sensors

//it gets to 15 friggin degress in the winter at night.
if (Temp1 <= 31)
{digitalWrite(Relay1, HIGH); }//turns on heat tape or something to
//warm up a outside pipe with using the least amount of power at night.
if (Temp1 >= 32)
{digitalWrite(Relay1, LOW); }//and shuts it off
//end flashing warning led

//start electret code
//read the sensor and store it in the variable sensorReading:
sensorReading = analogRead(electret);   
// if the sensor reading is greater than the threshold:
if ((sensorReading >= threshold)) {
Serial.println(sensorReading-threshold); //Will send only positive and absolute values of waveform         
}//end electret code


//now i will display all sensors onto my laptop somehow. Help?
//in the future these will be displayed on my droid app.
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("");

delay(10000); //this rechecks every 10 seconds?

}
Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8501
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You cannot "replace" data that's been printed to the serial monitor, characters are printed, the world turns and what's been done cannot be undone.

As the monitor is really just a debugging tool this is not usually a problem. If you really want to do this you need a terminal program that implements control characters (VT100 is the most common IIRC) and then you have to send these control characters to move the cursor back to the home position after (or before) every loop.

Code:
int Light1 = A10; //Will control 1156 Leds inside. or maybe i need digital pin.
int Light2 = A11; //Will control 1156 Leds inside. and might need some relays.
int Light3 = A12; //Will control 1156 Leds inside. oh shit, what did i get myself into?
int Light4 = A13; //Will control 1156 Leds outside.

Are you seriously going to drive 1156 (or is that 4624) LEDs?

______
Rob
« Last Edit: February 08, 2013, 06:34:57 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You cannot "replace" data that's been printed to the serial monitor, characters are printed, the world turns and what's been done cannot be undone.

As the monitor is really just a debugging tool this is not usually a problem. If you really want to do this you need a terminal program that implements control characters (VT100 is the most common IIRC) and then you have to send these control characters to move the cursor back to the home position after (or before) every loop.

Code:
int Light1 = A10; //Will control 1156 Leds inside. or maybe i need digital pin.
int Light2 = A11; //Will control 1156 Leds inside. and might need some relays.
int Light3 = A12; //Will control 1156 Leds inside. oh shit, what did i get myself into?
int Light4 = A13; //Will control 1156 Leds outside.

Are you seriously going to drive 1156 (or is that 4624) LEDs?

______
Rob

you just gave me an idea for a Christmas light display controlled by ........... Arduino!

but seriously i ment to say "1156 LED bulbs".
its the kind of bulbs in your cars turn signal you goofball. lol
« Last Edit: February 08, 2013, 08:46:51 pm by TrailerTrash » Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8501
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
its the kind of bulbs in your cars turn signal
I drive a 40+ year-old 6x6 Army truck, there is not a single LED in sight of the thing.

If a comment says "1156 Leds" or even "1156 Led bulbs" that means (to me at least) 1156 LEDs, not a single assembly with X number of LEDs.

Remember you are asking for help from engineers or at least people with an engineering mindset, as such when we see a magic number like that we ask if you really intend driving 1156 LEDs. If the comment was "Will control 1000s of Leds inside" or "Will control a shit-load of Leds inside" I may skip over it until you post again asking why your Arduino dies when you turn the LEDs on.

What's the significance of the number 1156?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
its the kind of bulbs in your cars turn signal
I drive a 40+ year-old 6x6 Army truck, there is not a single LED in sight of the thing.

If a comment says "1156 Leds" or even "1156 Led bulbs" that means (to me at least) 1156 LEDs, not a single assembly with X number of LEDs.

Remember you are asking for help from engineers or at least people with an engineering mindset, as such when we see a magic number like that we ask if you really intend driving 1156 LEDs. If the comment was "Will control 1000s of Leds inside" or "Will control a shit-load of Leds inside" I may skip over it until you post again asking why your Arduino dies when you turn the LEDs on.

What's the significance of the number 1156?

______
Rob

i googled and i dont know why they picked that number but its the universal part number for a light bulb with off set nipples.
« Last Edit: February 08, 2013, 08:20:50 pm by TrailerTrash » Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8501
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, so it's a part number...I get it.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i gotta go clean 16inches of snow off my camper roof before something happens.
or maybe i will invent a robot to do it. he will have windshield wipers as hands.
if i dont post here within a couple days i will probably be dead.
Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

aahhhhh, nipples. But seriously heres my updated code. my white led dont light when i speak and my blue and red led does not go off after sticking the sensor in snow. i should probably ask in another thread for help. but they will just say "hey, you just posted that in another thread" lol

Code:
//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.
//Worrying can lead to high anxiety. Stress affects you emotionally and physically.

int Water = 22; //Voltage sensor for my SeeLevel II water tank sensor strip
int Tank1 = 24; //load sensor for propane tank 1
int Tank2 = 26; //load sensor for propane tank 2
int Humid1 = 28; //humidity sensor inside
int Humid2 = 30; //humidity sensor inside
int Temp1 = 42; //DS18B20 temperature sensor under camper
int Temp2 = 34; //DS18B20 temperature inside camper
int Volts = 36; //battery bank voltage
int Amps = 38; //amps being used
int Relay1 = 40; //turns on a relay switch when Temp1 goes below 32degrees
int RB1 = A9; //red and blue warning led for Temp1
int RB2 = A10; //red and blue warning led for Tank1
int RB3 = A11; //red and blue warning led for Tank2
int Light1 = A12; //Will control 1156 bulbs inside. or maybe i need digital pin.
int Light2 = A13; //Will control 1156 bulbs inside. and might need some relays.
int Light3 = A14; //Will control 1156 bulbs inside. what did i get myself into?
int Light4 = A15; //Will control 1156 bulb outside.
int val = 0; //not sure what this does but its needed
//end of my int pins

//Start Code for one Electret mini condenser microphone pins
// these constants won't change:
const int ElectretLED1 = A2; // led connected to analog pin 2 will light up when i talk
const int Electret1 = A1;//amplifier output connected to analog pin 1
// these variables will change:
int sensorReading = 0;// variable to store the value read from the sensor pin
int sensorMax = 2000;
int sensorMin = 1023;
int threshold = 1200;
//End Code for the electret microphone

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);  // initialize serial communications
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(Relay1, OUTPUT);
pinMode(Light1, OUTPUT);
pinMode(Light2, OUTPUT);
pinMode(Light3, OUTPUT);
pinMode(Light4, OUTPUT);
pinMode(ElectretLED1, OUTPUT);
//end my pinmode code

//Start Code for Electret1 microphone
 analogWrite(A2, HIGH);
 while (millis() < 3000) {
 threshold = analogRead(Electret1);
 // record the maximum sensor value
 if (threshold > sensorMax) {
 sensorMax = threshold;
    }
  }
  // signal the end of the calibration period
  analogWrite(A2, LOW);
  threshold = sensorMax;
//End Code for electret microphone

}//end setup

//these will read inputs and write them somewhere that can be seen in a droid app.
//and also to be seen on my laptop online when im home or away. i will need help.
void loop() {
val = digitalRead(Temp1);
digitalWrite(Temp1, 0);
val = digitalRead(Temp2);
digitalWrite(Temp2, 0);
val = digitalRead(Humid1);
digitalWrite(Humid1, 0);
val = digitalRead(Water);
digitalWrite(Water, 0);
val = digitalRead(Tank1);
digitalWrite(Tank1, 0);
val = digitalRead(Tank2);
digitalWrite(Tank2, 0);

//two load sensors outside to measure how much propane i have in each 20lb tank
if (Tank1 <= 17)
{digitalWrite(RB2, HIGH); }//led alerts me when 20lb propane tank 1 is low
if (Tank2 <= 17)
{digitalWrite(RB3, HIGH); }//led alerts me when 20lb propane tank 2 is low
if (Tank1 >= 18)
{digitalWrite(RB2, LOW); }//led is off for propane tank 1
if (Tank2 >= 18)
{digitalWrite(RB3, LOW); }//led is off for propane tank 2
//end load sensors

//start DS18B20 temperature sensor under camper.
if (Temp1 <= 0)
{digitalWrite(Relay1, HIGH); }//turns on heat tape or something to
//warm up a outside pipe with using the least amount of power at night.
if (Temp1 >= 1)
{digitalWrite(Relay1, LOW); }//and then shuts it off
if (Temp1 <= 0)
{analogWrite(RB1, HIGH); }//turns on warning LED inside
if (Temp1 >= 1)
{analogWrite(RB1, LOW); }//and shuts LED off
//end flashing warning led for DS18B20 temperature sensor

//Start reading the water voltage sensor that i will need help with!
int sensorValue = digitalRead(22);
// Convert the digital voltage reading from (11V - 15V) to a percent (0% - 100%)
float voltage = sensorValue * (11.0 / 15.0);
Serial.print("Voltage: ");Serial.println(voltage); // print out the value you read:
// end reading the water voltage sensor

//start electret code
//read the sensor and store it in the variable sensorReading:
sensorReading = analogRead(Electret1);    
// if the sensor reading is greater than the threshold:
if ((sensorReading >= threshold)) {
Serial.println(sensorReading-threshold); //Will send only positive and absolute values of waveform        
}//end electret code


//now i will display all sensors onto my laptop somehow. Help?
//in the future these will be displayed on my droid app.
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("");

delay(1000); //this rechecks every 1 seconds?

}
« Last Edit: February 12, 2013, 05:59:02 pm by TrailerTrash » Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

Eindhoven (NL)
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice to see another person which has the idea to build a camper control panel  smiley
I have just (sort of) finished mine, it's my first Arduino project.
Check it out on:

http://508.winand.nl/?p=1087

(On the right hand side there is a translation option, just hover over the flags, you'll see)
The panel is not build in the camper van yet, which is still under contruction.
I have experimented with a gas sensor to detect gas leaks.
Works well, but the power consumption is arround 100mA, which is too much for my likings
(remember it has to be on all the time..)
I'm thinking of replacing that with measuring the weight of my LPG tank (I use a standing
LPG tank, so putting sensors underneath it should be simple)
Logged

Earth
Offline Offline
Full Member
***
Karma: 2
Posts: 111
Webmaster
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

everythings working somehow. new update soon
Logged

Webmaster living off grid in a camper with 300watts of solar panels charging 9 absorbed glass mat 12V batteries. i own about 40 dot coms. i

Pages: 1 [2] 3   Go Up
Jump to: