-1

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
adrian
  • 284
  • 2
  • 4
  • 14
  • Is using a serial-port and MCU a requirement? Or could you use something like a Raspberry Pi via an Internet connection to achieve the same results? – Geremy Feb 15 '15 at 09:29
  • @Geremy Not a hard and fast requirement. its just a preference. Please give me more details on your idea that uses Raspberry PI via internet – adrian Feb 15 '15 at 09:32
  • *"suggest me the best possible way "* -- Without any qualifiers, *"best"* is subjective, *"Not a hard and fast requirement"* -- Without any cost and complexity constraints/requirements (which does not happen in the real world) your question is too open-ended. – sawdust Feb 15 '15 at 23:19

1 Answers1

0

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.

Geremy
  • 2,415
  • 1
  • 23
  • 27