Go Down

Topic: help for the program for water tank (Read 4503 times) previous topic - next topic

mkbutan

Hi
I am new to ARDUINO and Programming in 'C'
I have design the   Circuit for the Wire less WATER LEVEL indicator
with [ Empty  10% , 20% , 25% , 30% , 40% , 50% / HALF , 60% , 70% , 75% , 80% , 90% , 100% / FULL  ]
to be display on the LCD
but
I don't know how to write the program for the same.
any help?????? 
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING


liudr

The sketch is a bit sketchy. Let's say your sensor + transmitter is working, what format of information is being transmitted to arduino? Is it ASCII like "12.5" or is it binary? Then some more detail on the 4X16 thing is also helpful.

Docedison

Converting all to binary 1 of 16 is a waste of time as well as the Holtek devices. What schedules the tank transmitter or does it just blabber all the time?.
scan the tank sensor strip when the tank is being used and go to sleep...
Or inquire the tank status from time to time send the code as an byte (uint8_t) and decode the low order bits (0 to 15).
Typically I would have (and did many times) checked the tank status when either the valve or pump motor was used by the system.
All 'systems' are different and you are lacking some detail about what you are controlling, Tank volume, use, source of water, potable or irrigation...
All are important and are necessary...
For example the water sensor leaves some details out.
Are you scanning the sensor and is it AC and capacitive or DC and resistive. These are very important. What is the power source and is it reliable... There are many things that make or break a sensor like this...
I once built a sensor with 10 float switches calibratable from the input flow sensor data... as a matter of fact the final "Solution" for that job went to the programmer after I added a flow meter to the tank output line. The pump ran just enough to replace the water used and it was about 10 lines of code that obviated the sensor assembly I made for the job at the customers insistence and he paid happily for both the sensor and the modifications to his existing clock code to keep the tank happy.
I later mounted the sensor on the wall... all 20 feet of it as a reminder of how not to try to engineer a job.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

PeterH


I have design the   Circuit for the Wire less WATER LEVEL indicator


That sketch looks suspiciously like the sort of thing you're left with after your teacher/tutor has finished walking through the problem with you.


I don't know how to write the program for the same.
any help?????? 


You need to understand how your overall solution will work in terms of interactions between the Arduino, these various bits of hardware and the various people and things in the outside world that will interact with your solution.

You need to understand how the various bits of hardware work, how to connect, power and use them from the Arduino.

You need to write code that interfaces with the hardware, and implements the algorithms that join these inputs and outputs together into the overall solution, and test and fix that code until it does what you want.
I only provide help via the forum - please do not contact me for private consultancy.

Docedison

Proof of concept drawing? Only?.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

mkbutan

hi
thanks to all for the reply

##1
I think the (Tx section) have 00-15(0000-1111) binary input as a switch in the water tank (here we use 00-13(0000-1101) for the sensing switches in the tank) and 14(1110)turn on the audio (UM66) and 15(1111) to turn off the tank input.
The 16-04 Multiplexer convert the 16 I/P to 04 Hex (0000-1111) which will be Tx via HT12E   

##2
and the (RX Section) have 04 O/P via HT12D and fed to 04-16 De-Multiplexer and will light the LED  indicator as 00-13 (0000-1101) with
[ 00% , 10% , 20% , 25% , 30% , 40% , 50% , 60% , 70% , 75% , 80% , 90% , 100% ] 14(1110) turn on the audio (UM66) and 15(1111) to turn off the tank input.


##3
and the Arduino 328 will have pin no. 3,4,5 & 6 from HT12D as an Binary I/P as (000-1111) which to be displayed on the LCD of 2x16 as   
[ Empty  10% , 20% , 25% , 30% , 40% , 50% / HALF , 60% , 70% , 75% , 80% , 90% , 100% / FULL  ] from the pin no. 7,8,9,10,11,12 &13 of the ARDUINO 328

any IDEA pl ???
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING

mkbutan


Proof of concept drawing? Only?.

Bob


right now yes
the tx/rx is working I would like to add the ARDUINO or the MSP430 with it.
thanks in advance
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING

PeterH


any IDEA pl ???


Idea about what?  Surely you don't expect people to write all the code for you, so what is it you're asking for help with?
I only provide help via the forum - please do not contact me for private consultancy.

Docedison

I think there is a language disconnect here... OP didn't respond to my questions or comments. Or he really expects us to get out the crystal ball and figure out what he neglected to post... He keeps mentioning "C" platforms but nothing else.. useful. IMO

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

mkbutan



any help?????? 


What code do you have so far?



thanks for the reply
sir right now i don't have any code
I just wanted to know how to write code for the ARDUINO 328
which have 4 pins input A,B,C,D as (0000 to 1111) on Arduino pin no 3,4,5 & 6
and the output to be displayed on the LCD as desired
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING

PaulS

Quote
sir right now i don't have any code

Here's a start:

Code: [Select]
void setup()
{
  // Put some stuff here
}

void loop()
{
   // and here
}


You have made NO attempt to do a damned thing for yourself. Why should we try to help you, when what you really mean is do your homework for you?

mkbutan

#12
Dec 19, 2012, 02:13 pm Last Edit: Dec 19, 2012, 02:17 pm by mkbutan Reason: 1
I can Switch ON and OFF the one LED on pin #12 of Arduino with an Switch on pin #3 with this code's
but don't know the idea how to solve my problem


/*
 pin 12, when pressing a pushbutton attached to pin 2.
 The circuit:
* LED attached from pin 12 to ground
* pushbutton attached to pin 3 from +5V
* pushbutton attached to pin 4 from +5V
* pushbutton attached to pin 5 from +5V
* pushbutton attached to pin 6 from +5V
*/
const int buttonPin = 3;     // the pushbutton pin A
//const int buttonPin = 4;     // the pushbutton pin B
//const int buttonPin = 5;     // the pushbutton pin C
//const int buttonPin = 6;     // the pushbutton pin D
const int ledPin =  12;      // the LED pin

int buttonState = 0;

void setup()
{
   pinMode(ledPin, OUTPUT);      
   pinMode(buttonPin, INPUT);    
}

void loop()
{
   buttonState = digitalRead(buttonPin);
   if (buttonState == HIGH)
{    
   digitalWrite(ledPin, HIGH);  
}
 else
{
   digitalWrite(ledPin, LOW);
 }
}
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING

PaulS

Quote
but don't know the idea how to solve my problem

Which is?

It's time to CLEARLY state what your problem is.

mkbutan

I just wanted to know how to write code for the ARDUINO 328
which have 4 pins input A,B,C,D as (0000 to 1111) on Arduino pin no 3,4,5 & 6
and the output to be displayed on the LCD as desired. the Arduino 328 will have
pin no. 3,4,5 & 6 from HT12D as an Binary I/P as (000-1111)
which to be displayed on the LCD of 2x16 as   
[ Empty  10% , 20% , 25% , 30% , 40% , 50% / HALF , 60% , 70% , 75% , 80% , 90% , 100% / FULL  ]
from the pin no. 7,8,9,10,11,12 &13 of the ARDUINO 328
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS"
                           ??????°?i??
                           AND
                           yes
                           PROGRAMMING

Go Up