Another alternative, although the OP did not ask for this:
There are usb-to-serial adapters. Depending on the type of adapter, you may also need a cable with a null modem.
They are extremely easy to use under Linux, work under windows if you have working drivers installed.
Thus, you can work directly with sensors, and you do not need to try to emulate data. Thus, you may even get rid of the creation of an anemic system. (Due to your emulated data inputs, which do not cover all cases, lead you to a fragile system.)
Its often best to work with real things.
sjas Jul 11 '15 at 9:11 2015-07-11 09:11
source share