Creating serial or USB interface from standard PC

Hi to all. Let me explain weird subject text :-)

I want to avoid using raspberry because it dindt pass basic tests for app that i need to design. Beside, i have to use HDD so PC is better solution.

Anyways, i want to create some electronics that i can use as "GPIO" inputs/outputs but on standard linux based PC.

The idea is to set some serial communication ( over some USB2serial adapter ) or directly if possible.

This device on serial port should read the state of arduino PIN's and that's all. When the state changes java or python based desktop app will set some action ( print/send mail/record picture etc... )

Ideas ?

GM

Reply to
gm
Loading thread data ...

AVR/PIC/ARM/etc. What's your preference? I use RPi just to avoid programing them, even though i know how to do all of them, but it's an extra step to maintain.

Reply to
edward.ming.lee

Den mandag den 2. oktober 2017 kl. 17.18.15 UTC+2 skrev gm:

the Arduino isn't connected to the PC?

Reply to
Lasse Langwadt Christensen

I can't help thinking it would easier on a Raspberry pi or one of the many even cheaper unix based Arm evaluation boards that come with plenty of IO pins and a USB driver to let the host PC interact with it.

Otherwise for a one off buy a dongle that does GPIO and comes with a

range depending on features. Don't underestimate the effort in making a DIY USB device driver even if you could make the hardware from scratch.

If you described what you were trying to do it might be possible to suggest a suitable widget that does it more or less out of the box.

--
Regards, 
Martin Brown
Reply to
Martin Brown

The task is really simple.

Arduino sends impulse when coin acceptor detects correct coin value. PC should print out the bill and take a picture

----------------------------------------- On the other side, barcode scanner should read barcode and if the barcode is correct, program should send trigger to arduino to open the relay.

-----------------------------------------

So, you have two systems in one box. Coin acceptor / barcode scanner / printer / relay.

Arduino is used for triggering relay and reading coin acceptor and PC for all the rest...

----------------------------------------

I have done the same system with raspberry and it has worked OK but it isn't stable. SD card is additional problem. Anyhow, i want to avoid rsp alike systems.

GM

Reply to
gm

Den mandag den 2. oktober 2017 kl. 18.02.20 UTC+2 skrev gm:

so plug the arduino into the pc, it'll show up as a serialport, done ..

Reply to
Lasse Langwadt Christensen

On a sunny day (Mon, 2 Oct 2017 17:18:10 +0200) it happened gm wrote in :

I have a PCI card with PC parport connector, gives you many I/O pins, use it to program PICs, test i2c chips etc.. If you have a free PCI slot that is the simplest way, those cards are cheap. Dunno about java and snakes, just use C ;-)

In an other case (laptop) I use an USB to serial adaptor, and test for the state of DSR (pin 6)in a script. Only 1 pin for input then.

Does an USB harddisk not work on the latest raspberries? Old raspi USB I have is slow shit.

Reply to
Jan Panteltje

What task can't be done with RPi?

Reply to
edward.ming.lee

As others pointed out, there are usb hard disks for data. RPi needs a very good power supply to be stable. Perhaps with a PC power supply.

Of course, the cleanest solution is an FPGA with USB stack hooking up to the PC, but others might disagree.

Reply to
edward.ming.lee

Sounds like a keyboard wedge would do the trick, unless the Arduino signals are shorter duration than the debounce time of the wedge.

Reply to
WangoTango

They work fine from Linux - we use FTDI modules from python scripts.

Reply to
David Brown

Something like a labjack? I had an idea to make a audrino into a labjack type of thing. It's not difficult, most have the ftdi chip on board which makes it USB to IO. Just open a serial port and send commands to read the ports.

Cheers

Reply to
Martin Riddle

*********** what kind of hw do you use for interface between paralell or serial port and let's say arduino ( atmel ) ?

So, idea is to read some value from arduino and send some data from PC to arduino ( impuls )....

Do you have some schematics ?

GM

Reply to
gm

It would be much easier to help if you'd supply some info on how many signals you want to monitor and control. Speeds required? Typical parallel port has more outputs than inputs. Go to ebay and order one of the $2 USB to GPIO devices. Start with the EBAY search term "ESP8266"

Reply to
mike

You can get the cheapest-nastiest USB keyboard and hack it for simple I/O. The coin acceptor triggers a keypress and the scroll lock LED triggers the camera. Lot of easy O/S calls to change num/caps/scroll lock state exist and of course keyboard input is even easier to read.

piglet

Reply to
piglet

On a sunny day (Wed, 4 Oct 2017 21:38:35 +0200) it happened gm wrote in :

1) I have no Duino...

2) The par port on modern PCs outputs about 3.3V. Some pins have high current drive capability. Some pins have reversed logic levels.

3) Here are some examples how I use it,

this controls an ebay frequency synthesizer module:

formatting link

this is a part port PIC programmer (design is not mine, just modified it):

formatting link

Normally the par port I/O address is 0x378 In this simple C file you can see how I interface using i2c:

formatting link
I use diodes to do sda pulldown, sdcl is hard up/down.

In ADF4350_test.c there is a wiring diagram.

I have build many of those test circuits, many are on my site too.

So, take care of the currents that can flow, the logic levels (no idea what a Duino does), and do a web search for PC par port connections and their addresses (control port, and data port).

Write a test routine to toggle and read those pins, use a multimeter or something to check.

Advantage of the PC parport is that you can have very high speed, no unstable USB shit or device renumbering either. No overhead, just read / write to 0x378 0x379, fast C compiler on same PC, unlimited test resources.

IMNSHO a computer without hardware I/O is quite useless really.

To write to the parport you need to be root, see iopl(3) in the C source. To be safe not to smoke your par-port (card?) you could use 330 Ohm resistors in series for a start.

If you are using Bloatsoft Widows, then I have no examples.

Reply to
Jan Panteltje

A usb serial port has 5 inputs and 3 outputs.. all can be reached via ioctl(), but they're kind of slow (~100ms delay)

Get one with TTL voltages for easier interfacing, or get an arduino with one on-board (eg: "uno"), but they may not have all the i/o available.

--
This email has not been checked by half-arsed antivirus software
Reply to
Jasen Betts

True, I've used a USB to serial just for the control I/O's. I didn't need speed, and just needed level translation to toggle a relay and watch an output. worked like a champ.

Cheers

Reply to
Martin Riddle

Has anyone used one of these?

No Delay USB Controller to PC Joystick For 2 Pin Rocker Happ Push Button Cable

--
Never piss off an Engineer! 

They don't get mad. 

They don't get even. 

They go for over unity! ;-)
Reply to
Michael A. Terrell

Yeah, inside a pre-assembled usb arcade style joystick

Probably not that vendor.

These things are popular with the MAME crowd.

--
This email has not been checked by half-arsed antivirus software
Reply to
Jasen Betts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.