Arduino for long lifetime

​Hello, i am loking for a way to get reviews from
cutomers with the 3 button, happy, medium and
sad face module that i ve seen in some supermarkets
It is a box with 3 buttons that gives a feedback with the
Button count pressed to the computer.
Is arduino a choise for this purpose or u may sugest other better
Options, will arduino last for long time and give real output
From thepush button in time without bouncig?

Certainly arduino can do this. The buttons will need to be debounced, but this is easy to do in the code. How do you wish the survey results be read out/saved? Knowing that will help us to recommend which model of Arduino to use.

A simple option would be an lcd screen to view the results and a button to set the results to zero.

If you want to keep the results for a long period and have records of the button presses on each day, these could be stored on an sd card which could be later transfered to a pc for analysing or viewing. You might need an rtc module also, so that the date/time of each press can be recorded.

An Arduino Nano would be a good choice for those 2 options.

More sophisticated would be to use an arduino with wifi, for example wemos mini, to send the presses to a server where they can be viewed on a web page or downloaded, or the arduino could store the results and allow them to be viewed on a Web page.

The module is gone be connected to a pc via usb cable that enable serial comunication between the pc and arduino also providing power to it, that specific pc has the selling program used by the employee to sell products and the module is on the front of the table where the customer should press a button. The press is noticed by the arduino then stored, and send the number to the pc trought serial where a the selling program get the number and send it to the big database of the main selling program wich is on a server.
For this the reading must be really precise, i don't know is arduino will last in time, for debonce it needs to know the milliseconds from when it started runing until present wich will add up in time, how much of it can store, it will reset at a point ? And what happen if the start bebounce variable stores millis and the arduino reset after vrification with the end debounce for the press ?
Also somehow after arduino noticed the push, it send that to the pc and it should get a verificaton feedback from the pc after that reset the count on arduino and keep adding on the pc when it needs in case that the arduino is disconected, or the program java isn t runing it should keep that count for when it can send it

Also i would opt for another method for this job i f i will need an expensive arduino, it won t worth the money to buy an expensive one if i could find already a builded module cheaper or maybe a 3 button keyboard and 3d print and enclosure

Arduinos are cheap, very cheap. Clones can be had for as little as USD2-3 each.

For counting button presses, use the EEPROM. No need for an SD card. Each EEPROM cell lasts for guaranteed at least 100,000 writes (i.e. button presses), in reality more like a couple million. Should be enough.

However if all you want is to have the button presses to be read by a computer, consider a Makey-Makey instead. Basically turns those buttons into keyboard keys, connects over USB.

Ok, i know arduino clones are cheap , those makey makey doesn't satisfy me, i would prefer a push button action instead of those capacitive pads that maybe could be triggered by accident in contact to something, i had a capacitive touch pad that trigered when i took it in my hand from the edges instead of the pads

alex0512343:
Hello, i am looking for a way to get reviews from customers with the 3 button, happy, medium and sad face module that I've seen in some supermarkets
It is a box with 3 buttons that gives a feedback with the Button count pressed to the computer.
Is arduino a choice for this purpose or u may suggest other better Options, will arduino last for long time and give real output From the push button in time without bouncing?

OK, well I was going to ask how you would power this, but if you will be permanently connected to a PC, that will provide the power source just fine. Note the USB cable is limited to something like 7 or 10 metres.

The recording as such can be done on the PC, you could just arrange for it to log everything sent by the Arduino via USB serial. It sounds as if you want the time of each button press to be recorded. That is probably better done by a program on the PC that waits for something sent by the Arduino and records it to a file together withe the time from the PC clock.

The Arduino is at least as reliable as the PC, that is not a matter of concern.

Debounce is performed on the Arduino. It can also have a display - such as LEDs or even text on an LCD - to query and/ or confirm responses to the customers.

For interaction with the "general public" you should be using proper pushbuttons - such as those used on arcade machines - not cheapies. :sunglasses: Mounted on a "utility box".

OTOH, capacitive touch pads work fine - they simply do not care whether you touch the middle or the edges - it's no accident, it's simply a matter of how you mount (and touch) them. :roll_eyes:

Thanks for the answers, the psu would be the pc that is located just unde the table so tha cable won t exced ~ 1.5 m, the problem with the clock is that if somehow the arduino can't send to the pc that recording of the push(the pc wont receive it and not confirm) it has to store it in eprom so i wouldn't know the clock at it was pushed anymore using the pc. For that an external clock may work also the lcd is a good idea but i will stick to a simpler version maybe led to not increase in price to much per total.

I found some push buttons rated for 12, 24 .. v

Also can arduino reset itself after a long time, maybe after it milliseconds have increased to much so it will start working slowly?
The reset of it won t be as much as a problem because after it successfully send the recorded push to the pc and get confirmation it reset the push count on the board so it s as it is when is started but i am trying to get rid of any errors in functionality that may not count a push or not work as intended. When i debounce i have to check the time pressed using millis of the board wich at a point will get too big and maybe lead to malfunctions

alex0512343:
Also can arduino reset itself after a long time, maybe after it milliseconds have increased to much so it will start working slowly?

No, it will run as long as it has power provided you don't have anything in your code that crashes it.

The reset of it won t be as much as a problem because after it successfully send the recorded push to the pc and get confirmation it reset the push count on the board so it s as it is when is started but i am trying to get rid of any errors in functionality that may not count a push or not work as intended. When i debounce i have to check the time pressed using millis of the board wich at a point will get too big and maybe lead to malfunctions ?
What could go wrong, normaly in industrial designs what option they choose?

Millis()

This number will overflow (go back to zero), after approximately 50 days

This is what i am saying, what happens when the number reset in the middle of a debouncing when it compares values?

unsigned long math the millis() takes care of that.

Try this on your Windows calculator in Programmer mode:
0000000f - fffffff0 = ?
where 0000000f is the time shortly after a rollover, and fffffff0 is the time shortly before a rollover.
The result is fffffffff0000001f because the calculator does 64 bit math.
But Arduino only does 32 bit math, so upper 8 f's get thrown away and the duration you'll see is 0000001f, which is what is expected.

If your duration were to last more than 1/2 the 49.71 days of time that millis() supports, then I think you might find some scenario where the math works out funny. But will you have a button press lasting that long? Not too likely.

For a simple debouncing application like this, you don't even need to use millis(). A simple delay(20) will do just fine. I say this because it seems like a $0.10 issue has become a $100 problem for you.

alex0512343:
When i debounce i have to check the time pressed using millis of the board wich at a point will get too big and maybe lead to malfunctions ?
What could go wrong, normaly in industrial designs what option they choose?\

The main option is to understand integer math and how overflows work. Then you can understand that the overflow of millis() is not an issue at all.
Also it won't start working slower or so after some time. Remember, it's a microcontroller, it runs your program and only your program. There's no crap like Windows on it - that's for the past 20+ years been what makes people believe such nonsense as computers working slower after time and needing reboots.
There are plenty of Arduinos and related micrcontrollers out there in all kinds of applictions that continuously count milliseconds or seconds that roll over time and again and they work for sometimes years without reset.

You can also just accept the fact that millis() rollover is not a problem when used as documented and demonstrated in the standard examples, and move on... it's good to understand it but not strictly necessary...

Ok, so overall it should work,
Maybe can i get some help with the comuncation betwen java on pc and board, debonce ?

To avoid any fact that could freze the arduino

Okay, please post your code in code tags and you can get help.

The Arduino sends and receives data on its Serial/USB interface. As long as you program the Arduino correctly (including proper input sanitising) it will work fine and stable. What you do on the PC side is irrelevant to the Arduino - it just sends and receives its data.

The logic of a simple effective debounce is ridiculously simple - whenever you detect a keypress, wait 20 milliseconds. There are more complex ways, but that one does work, and it's easy to implement.