flat assembler
Message board for the users of flat assembler.

Index > DOS > Analog counter control

Author
Thread Post new topic Reply to topic
me239



Joined: 06 Jan 2011
Posts: 200
me239
Hey everybody! Today I came across a small device from around the 70's that has a mechanical counter controlled by just a small electromagnet. The way it works is you have a switch connect and disconnect from one of the poles connected to a six volt battery. My question is, how do I control this from a serial port? How many volts is a byte? Do I need to build a contraption to control it?
Here is a picture of what I'm talking about:
Image
Post 26 May 2011, 20:45
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

a digital/analog I/O card
+ a kernel driver

"How many volts is a byte?" Shocked

but with this question, I think there is still much to learn before that. Wink

maybe first just a "hello_word" driver ?
This would be a great start!

edit : What is your OS ?

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 May 2011, 20:56
View user's profile Send private message Send e-mail Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
http://en.wikipedia.org/wiki/RS-232#Voltage_levels (although you should interpret this as "how many volts is a bit?")

I would advice about how to make a circuit but I think I'm way too amateurish for that.

For handling the COM port in DOS, please search around, surely you will find something (e.g. "serial mouse driver", "UART 16550 programming" (or UART 8250), etc.)
Post 26 May 2011, 21:47
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
this kind of device is:

low frequency, don't imagine to have more than 2 inc per second.

certainly controled by pulse.

one pulse = one count.
a pulse is a signal, edge, level, shape...

to control this, using standard interface, i'd prefer lpt becaus eit covers the one bit application domain.
only one bit for the count signal.
Post 27 May 2011, 03:23
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
edfed, he could still use serial in the way you propose (use a single LPT data line?), but rather than using the TxD pin, he could use the RTS or DTR pin and the wire could be extracted from a defunct COM mouse (since both signals are part of the Microsoft mode mouse protocol).

Still, voltage adaptation would be needed (if not "current adaptation" as well be means of a transistor + external power supply to provide the pulse), but although I think I have an idea of how to make the circuit, I think I'll wait for shoorick to say something first Razz
Post 27 May 2011, 03:53
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
he-he Smile i have never operate with RS232, but as i know it has a control bit which can be set on or off directly (transmittion output is hadware generated depending on set mode and sent byte). RS232 levels are -12V for 0 and +12V for 1, another thing solenoid in mechanical counter consume sufficient current, which may exceed max load for RS232 output amplifier. if you can set any bit on RS232 or LPT, you just need something like mosfet to drive this counter. just check if mosfet you wish to use able to keep current (you may find this data written on counter or check with AVOmeter) and it is possible to send signal from pc port to mosfet gate (usually +20/-20 is allowed, but there are variations)


Description:
Filesize: 3.11 KB
Viewed: 1699 Time(s)

mechanic counter.png



_________________
UNICODE forever!
Post 27 May 2011, 05:55
View user's profile Send private message Visit poster's website Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
Thanks everyone! Hey shoorick, would you happen to know what kind of transistor I should get?
Post 27 May 2011, 20:56
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
This counter is an inductive load, so don't forget about the protection diode in parallel.
Post 28 May 2011, 04:55
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
yes, backward diode will be not bad Smile i use a while only mosfets extracted from old monitors and hard drives. i've been using IRFD123 - i like it Smile it keeps load current 1A, say, IRF630 keeps current up to 9A etc. you have to read parameters from counter (voltage and current) and search either for mosfets table, or just put parameters into google, like this. if your counter will use high voltage (100-220V) directly from wall outlet - you must use isolator, say, optocoupler like PC817, but then there will be some play with resistors Wink

_________________
UNICODE forever!
Post 28 May 2011, 06:50
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.