Real time online push button based counting system

arduinoatmegaavrmicrocontrollerserial

I am doing this project:

I have 4 inputs. These are push buttons, connected to a microcontroller.

Each time a push button is pressed, say for example pushbutton_1 is pressed, the press of a switch button should be recognised as a HIGH.

In its normal unpressed state it should be recognised as a LOW.

Then using serial communication i should transfer it to a computer.

Along with this, i need to implement a count for each button.

Each time a push button is pressed, the count that is assigned to that push button, should increment by 1.

The data arriving through serial communication should be transferred to an excel sheet/database.

The excel sheet/database should display a count for each pushbutton.

I have 4 important question areas:

  1. Which microcontroller should i use? (I have experience with arduino development platform)

  2. How do i implement the transfer of data from microcontroller to computer via serial communication?

  3. Afterwards, how do i transfer the arriving data to MS excel/database?

  4. How do i run implement the system in realtime?

Please suggest me the best possible way to implement this system.

Best Answer

What's "best" depends on the factors that are important to you. The simplest is probably to use the flow control lines on a serial port to read the pushbuttons. An example is shown here for a single input. This is likely the cheapest solution.

Next simple is probably the Arduino since you are already familiar with it. It is trivial to read a number of switch inputs with Arduino. Then you will implement a communications protocol to transfer the data. Possibly send a packet every time a switch changes state.

And then there are multiple off the shelf systems that can do what you want. For some definitions of "best" they would work.

The problem of saving data to Excel is probably easiest done if saved as a .csv file. IF it must be done in native Excel format, I think it can be done from a .NET program as long as Excel is installed on the target system since you will need to link to the Office assemblies.

Edited to add that I was a bit curious about what was available in .NET and I just discovered the OpenXML SDK that will let you create Microsoft Office files. May be worth looking at.