help for the program for water tank

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???

mkbutan: any help??????

What code do you have so far?

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.

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

mkbutan: 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.

mkbutan: 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.

Proof of concept drawing? Only?.

Bob

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 ????

Docedison: 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

mkbutan:
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 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

Arrch:

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

sir right now i don't have any code

Here's a start:

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?

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); } }

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

Which is?

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

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

I can Switch ON and OFF the one LED

So, you can read several pins and set or reset bits (instead of lighting an LED) in a variable based on the values read from the pins. There's a library for driving the LCD, with examples.

I just wanted to know how to write code for the ARDUINO 328

You have some, so presumably your not as dumb as you are pretending to be.

which have 4 pins input A,B,C,D as (0000 to 1111) on Arduino pin no 3,4,5 & 6

You already know how to read one pin. Read three more EXACTLY the same way.

and the output to be displayed on the LCD as desired.

The LCD can't display binary data, so, no it won't.

YOU need to convert the value YOU form from the 4 pins into text/graphics/etc.

pl any help

mkbutan: pl any help

Aside from writing the code for you, what other help are you looking for?

PaulS:

which have 4 pins input A,B,C,D as (0000 to 1111) on Arduino pin no 3,4,5 & 6

You already know how to read one pin. Read three more EXACTLY the same way.

the input are commented (//....)
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
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

but i dont get the output on the pin#12 with this

and the output to be displayed on the LCD as desired.

The LCD can't display binary data, so, no it won't.

YOU need to convert the value YOU form from the 4 pins into text/graphics/etc.

that's my Question was how to do that? pl explain

Posted on: December 19, 2012, 07:28:35 PMPosted by: AWOL

I can Switch ON and OFF the one LED

So, you can read several pins and set or reset bits (instead of lighting an LED) in a variable based on the values read from the pins.

[u][b]There's a library for driving the LCD, with examples[/b][/u].

pl guide me where???? and how to use it in my program