Search code examples
excelarduinoserial-portmicrocontrolleravr-gcc

real time online push button based counting system


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.


Solution

  • To solve this using an MPU like an RPi via the Internet, its pretty trivial. To do this:

    1. Wire your switches to the GPIO inputs on the Pi. This is a trivial example: http://razzpisampler.oreilly.com/ch07.html
    2. When the state changes, send a message via a realtime service such as PubNub (free for student and other uses: http://www.pubnub.com/free-evangelism-program/)
    3. On a remote "server-side", take the data received via the subscriber logic write to a CSV.

    If you followed these directions, you would use the PubNub python client to publish the data from the Pi: https://github.com/pubnub/python/tree/master/python#publish

    and then you would use python (PubNub supports over 70 languages, so you could use python or the language of your choice) to subscribe to the pushbutton data channel(s)

    https://github.com/pubnub/python/tree/master/python#subscribe

    You could even make a cool realtime updating web page in HTML/JS using the PubNub JS client

    Source: https://github.com/pubnub/javascript/tree/master/web Docs: http://www.pubnub.com/docs/javascript/api/reference.html#subscribe

    to dynamically update a dashboard, with no file writing needed.