Any way to take input from the user ???

Hello forum.

I am trying to design a system that could monitor the parameters such as temperature, humidity and so on.

For now i am programming the arduino to run on a pre-defined value such as (t>25) and some outputs are connected to it. When temp exceeds that value , the output unit starts.

But this is all pre-defined value , i am planning to modify this system to take input from a user such as (t>a), where a is the input variable from the user.

Anyone can help me out here if they know?

I think keypad is the good way.

Other way is setting via Web or Mobile App. This requires the use of bluetooth or WiFi module

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Use a potentiometer as input device.

Tom.... :)

Getting input from a user also requires giving feedback to the user so they can see what value they have entered - which implies some form of display - perhaps a 2 x 16 line LCD.

...R

i am planning to modify this system to take input from a user

The system will need a screen so the user can see what is entered. As has been suggested using a phone app to do this would be convenient for the user but involve more programming. A keypad and 2 line LCD screen attached to the Arduino would be easier for you but not maybe for the user.

So how can i write the code ?

i mean how should i take the input from the user using keypad???

like, i want to give user the ability to enter his own parameters of temp(for instance). He will have the ability to enter it on any range that he wants and output unit should run accordingly.

for eg; if i put fan as an output unit and if user wants to start fan at t>a (a=any number), the fan should start when it exceeds the limit.

sparrowcinco: So how can i write the code ?

i mean how should i take the input from the user using keypad???

Pretend you are the user coming to this device. What would you expect to see and how would you (as user rather than programmer) like it to behave so as to make it easy to use?

...R

PS ... you should be aware that the extra code for a practical user interface may be as long, or longer than the rest of the program that actually makes stuff happen.

PPS ... if you are content to offer the user a fixed set of options (e.g. 15, 20, 25 or 30) you could do that very simply with a rotary switch. The position of the switch would provide clear feedback to the user. You can have up to 12 positions on a cheap rotary switch.

If you’re afraid of getting in deep with a keypad and LCD, you could try a pair of decimal thumb wheel switches, and simply dial n the target temperature.

If you have a DFR0009 style device, you could do it like #8 here.

Use an ESP, and serve web pages.

I think if OP is asking these questions, he may need to start with a mercury thermometer.

sparrowcinco: So how can i write the code ?

i mean how should i take the input from the user using keypad???

Maybe look at some of the examples that come with the keypad library?

Or at the links that were provided in earlier replies.

IoT_hobbyist: I think keypad is the A good way.

It's more complicated to take in a value of a few digits than the code in that tutorial which just prints the key would make out.

OP if you need a function to read a multi-digit integer or float from a keypad I have one of each. I was never 100% happy with them (can't recall why right now) but they do work.