2
\$\begingroup\$

I am working on a project of mine in which I am getting data from multiple sensors into an 8051 microcontroller.

I'm building a car simulator in which I have various car components such as a steering wheel, brake, accelerator and clutch paddles and some other components. I have some sensors attached to each of these components.

The data from each sensor won't exceed more than a byte. In total I have 8 sensors, which makes a total of 8 Bytes data and the data should be transmitted at least 100 times in one second.

Now, I have to continuously transmit the data coming from these sensors to the PC via micro-controller where it would be further processed. Is there any way I can communicate this data to the PC in parallel as I have data coming from a number of sensors?

\$\endgroup\$
  • \$\begingroup\$ At what intervals you would be getting data from Sensors? \$\endgroup\$ – Swanand Jan 1 '13 at 13:26
  • \$\begingroup\$ Let me explain you the whole scenario a bit more. I m building a car simulator in which i have various car components such as steering wheel, brake, accelerator and clutch paddles and some other components. I have some sensors attached to each of these components. Now i have to continuously transmit the data coming from these sensors to the PC via micro-controller. \$\endgroup\$ – Rehan Abbasi Jan 1 '13 at 13:38
  • \$\begingroup\$ Which 8051 microcontroller are you using? Do you have USB device capability on it? \$\endgroup\$ – Gustavo Litovsky Jan 1 '13 at 17:15
  • \$\begingroup\$ I am using AT89C51 micro-controller. \$\endgroup\$ – Rehan Abbasi Jan 1 '13 at 18:38
  • \$\begingroup\$ @RehanAbbasi Next time, edit your question instead of putting extra details in comments. I've amended your question with your extra details. You can do this once you earn a few points of reputation on the site (you should be able to do so now with 21 points). \$\endgroup\$ – Adam Lawrence Jan 1 '13 at 22:25
3
\$\begingroup\$

It will be essential to know the size of the data read from each sensor, how many sensors and how fast of repetition rate that you need to get the data into the PC. Without that data it will be difficult to recommend an exact solution.

That said it may be reasonable to suggest that you configure your 8051 UART port's TXD and RXD lines to talk to a 1x6 header that can mate to one of these cables:

enter image description here

This can then plug into your PC's USB port. Using the appropriate virtual comm port driver from the FTDI web site the solution can easily transfer data in serial manner from your 8051 to the application in the PC. The PC app thinks it is simply talking to a COM port.

These serial adapter cables can easily transfer serial data at rates to 230.4 K baud. Using a standard 8N1 serial framing this baud rate translates to a just over 23000 bytes per second of raw transfer rate. If you had 12 sensors, each with two bytes of data and you wanted to update the data to the PC at 100 times per second this would equal an application data rate of 12*2*100 = 2400 bytes per second. As you can see there would be plenty of remaining bandwidth on the virtual comm port channel to wrap a protocol around your application data and send it to the PC.

\$\endgroup\$
  • \$\begingroup\$ The data from each sensor won't exceed more than a Byte. And in total i have 8 sensors. which makes a total of 8 Bytes data and the data should be transmitted atleast 100 times in one second. \$\endgroup\$ – Rehan Abbasi Jan 1 '13 at 18:41
  • \$\begingroup\$ Can you please suggest me a detail study for this purpose . \$\endgroup\$ – Rehan Abbasi Jan 1 '13 at 18:42
  • 1
    \$\begingroup\$ +1. Using UART is the easiest way to get data out of just about any microcontroller, especially data that's already in a byte format. USB-to-UART also makes things simpler than UART-to-RS232 these days. \$\endgroup\$ – Adam Lawrence Jan 1 '13 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.