Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« on: December 18, 2012, 10:52:20 am » |
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??????
|
|
|
|
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
California
Online
Edison Member
Karma: 51
Posts: 2176
|
 |
« Reply #1 on: December 18, 2012, 11:13:30 am » |
any help??????
What code do you have so far?
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 38
Posts: 6050
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #2 on: December 18, 2012, 12:49:29 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 34
Posts: 2404
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #3 on: December 18, 2012, 01:27:50 pm » |
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
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
UK
Offline
Tesla Member
Karma: 100
Posts: 6784
-
|
 |
« Reply #4 on: December 18, 2012, 02:00:06 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 34
Posts: 2404
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #5 on: December 18, 2012, 02:29:09 pm » |
Proof of concept drawing? Only?.
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« Reply #6 on: December 18, 2012, 03:03:09 pm » |
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 ????
|
|
|
|
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« Reply #7 on: December 18, 2012, 03:09:57 pm » |
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
|
|
|
|
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
UK
Offline
Tesla Member
Karma: 100
Posts: 6784
-
|
 |
« Reply #8 on: December 18, 2012, 03:32:43 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 34
Posts: 2404
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #9 on: December 18, 2012, 03:36:51 pm » |
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
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« Reply #10 on: December 19, 2012, 06:03:00 am » |
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
|
|
|
|
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 334
Posts: 36453
Seattle, WA USA
|
 |
« Reply #11 on: December 19, 2012, 06:10:39 am » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« Reply #12 on: December 19, 2012, 08:13:59 am » |
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); } }
|
|
|
|
« Last Edit: December 19, 2012, 08:17:49 am by mkbutan »
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 334
Posts: 36453
Seattle, WA USA
|
 |
« Reply #13 on: December 19, 2012, 08:22:04 am » |
but don't know the idea how to solve my problem Which is? It's time to CLEARLY state what your problem is.
|
|
|
|
|
Logged
|
|
|
|
|
Mumbai -INDIA
Online
Newbie
Karma: 0
Posts: 33
|
 |
« Reply #14 on: December 19, 2012, 08:53:20 am » |
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
|
|
|
|
|
Logged
|
"THE LIFE IS VERY SMALL TO LEARN ELECTRONICS" ε∫εζτ√°ηiζ≈ AND yes PROGRAMMING
|
|
|
|
|