Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logical Circuit Switch

Status
Not open for further replies.
As to the timer, what does it output? Meaning for example a logic high or low for a preset period?

The output of the timer is depend on what you will connect to the output relays.

Yeah. That is what I was getting at. Next, you never mentioned but we will assume a Windows based operating system. I would like to know which one?

I'll give you a few ideas to think about. First the concept of placing a signal in parallel with the front panel On button is not a good idea. While this makes for easy start of a system but using the front panel power button to force a shutdown can be a bad thing depending on the OS (Operating System) power settings.

You did mention you had some programing experience so here is what I suggest so you can experiment a little. If you have a system sitting there with a RS 232 port you can use that for some basic functions. Other than the actual data transmit and receive lines (pins 2 & 3) the RS232 serial interface has a few pins that can be quite easily used as DIO (Digital In Out). For example the CTS pin 8, DSR pin 6 and the DCD pin 1 all can be very easily used as digital imputs sending a true (logic high) or False (logic low) to any software you write.

While I am not very good with this stuff I can read those pins using VB (Visual Basic) and have the OS respond to changes like shutdown, logoff or restart. Those pins are low by default and a logic high is as simple as 5 to 9 volts being applied to any of those pins and ground (pin 5). If you want to take that route maybe I can give you a few code sample programs to work with. They would be in VB 6.0.

Also, I would like to see what carbonzit has in mind as he is also active in this thread and had some thoughts.

My understanding is that in Internet Cafe and Kiosk situations that all the workstations are interfaced through a central server computer. That computer controles the time limits. I know that is far from your objective.

Ron
 
You mean i can connect direct my coin selector gadget direct to a RS232 port?

Actually, i never tried programming like this before, i always depend on the drivers. but if you give some codes as to my guides. i will try to understand to make it work. Visual Basic 6.0 is great than any other tools.

Attached image is a RS232 pin out.

Please see me your VB6 codes to this email moonstar_catcher@yahoo.com.ph

I hope i can work with it... Thanks!
 

Attachments

  • rs232_pinout.gif
    rs232_pinout.gif
    12.9 KB · Views: 209
Last edited:
When I get home from work today I'll make something available. I'll modify a little app I wrote awhile back that uses the RS232 pins I mentioned. It should help you get started with something. What operating system are you working with?

Ron
 
I know it runs on Vista 64 so should run on Windows 7. I'll try it. Have to get ready for work now.

Ron
 
OK, here is the little program I had put together. You can download the file here. The zip folder contains two folders. One with the compiled executable program and the other will all the VB6 source code and other files. If you look at the code (you will need VB6 to see or use the source code) you will see where I added the log off code. You can Log off, Shutdown or Restart but I only used the Log Off. There are several ways to do it so you may want to use other methods, I used a Shell Command. One bit of grief is I can include timed functions for shutdown and restart but could not get the t function to work with log off? Like I said, I am not a programmer type.

Placing pin 1 high will run a log off. The other functions run normal per the info on the form.

Click the link and choose Download then extract the content of the zip folder. Just right click the downloaded folder and choose Extract to wherever you want.

Ron
 
To the O.P. (original poster); before anyone really helps you much further, you're going to need to supply us with more information about the coin acceptor. The best would be a datasheet (in English, please!), but lacking that, any technical information you can give us would help. Especially concerning what kind of output it has: voltage, type of pulse generated (positive, negative), etc.

You can connect it directly to RS232, more or less: it will require some signal-conditioning parts, but they should be pretty simple.
 
Carbonzit, the program I linked to is real similar to this one. If you have a chance download it and let me know your thoughts. It was originally written to watch the basic pins (excluding data transmit and receive) using the RS232 as a simple DIO. For inputting logic levels anything will work. 5 volts or even a 9 volt battery. To look at the DO a simple meter will show the logic shifts. For just DIO you don't need any conditioning. Somewhere in the download zip folder is the setup file.

Ron
 
To the O.P. (original poster); before anyone really helps you much further, you're going to need to supply us with more information about the coin acceptor. The best would be a datasheet (in English, please!), but lacking that, any technical information you can give us would help. Especially concerning what kind of output it has: voltage, type of pulse generated (positive, negative), etc.

You can connect it directly to RS232, more or less: it will require some signal-conditioning parts, but they should be pretty simple.

The URL i posted for the Coin Selector has an ENGLISH link to translate the page in English version. It is located at the upper right of the page.
**broken link removed**

Sorry, I don't have any data sheet for the Coin Selector.
 
Last edited:
Carbonzit, the program I linked to is real similar to this one. If you have a chance download it and let me know your thoughts. It was originally written to watch the basic pins (excluding data transmit and receive) using the RS232 as a simple DIO. For inputting logic levels anything will work. 5 volts or even a 9 volt battery. To look at the DO a simple meter will show the logic shifts. For just DIO you don't need any conditioning. Somewhere in the download zip folder is the setup file.

Ron

In your statement here, it sounds that i can connect directly the coin pulse signal from the Coin Selector to RS232 pin 1, is that correct?
if a RS232 port from the MOBO can detect 5-9vdc as a signal, i can still use the digital timer as an output signal which is 0-5vdc from its microprocessor.

Please correct me if i am wrong. :)
 
Last edited:
In your statement here, it sounds that i can connect directly the coin pulse signal from the Coin Selector to RS232 pin 1, is that correct?
if a RS232 port from the MOBO can detect 5-9vdc as a signal, i can still use the digital timer as an output signal which is 0-5vdc from its microprocessor.

Please correct me if i am wrong. :)

RS232 Voltage Levels:
The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels for the data transmission and the control signal lines. Valid signals are plus or minus 3 to 15 volts; the ±3 V range near zero volts is not a valid RS-232 level. The standard specifies a maximum open-circuit voltage of 25 volts: signal levels of ±5 V, ±10 V, ±12 V, and ±15 V are all commonly seen depending on the power supplies available within a device. RS-232 drivers and receivers must be able to withstand indefinite short circuit to ground or to any voltage level up to ±25 volts. The slew rate, or how fast the signal changes between levels, is also controlled.

For data transmission lines (TxD, RxD and their secondary channel equivalents) logic one is defined as a negative voltage, the signal condition is called marking, and has the functional significance. Logic zero is positive and the signal condition is termed spacing. Control signals are logically inverted with respect to what one sees on the data transmission lines. When one of these signals is active, the voltage on the line will be between +3 to +15 volts. The inactive state for these signals is the opposite voltage condition, between −3 and −15 volts. Examples of control lines include request to send (RTS), clear to send (CTS), data terminal ready (DTR), and data set ready (DSR).

Because the voltage levels are higher than logic levels typically used by integrated circuits, special intervening driver circuits are required to translate logic levels. These also protect the device's internal circuitry from short circuits or transients that may appear on the RS-232 interface, and provide sufficient current to comply with the slew rate requirements for data transmission.

Because both ends of the RS-232 circuit depend on the ground pin being zero volts, problems will occur when connecting machinery and computers where the voltage between the ground pin on one end, and the ground pin on the other is not zero. This may also cause a hazardous ground loop. Use of a common ground limits RS-232 to applications with relatively short cables. If the two devices are far enough apart or on separate power systems, the local ground connections at either end of the cable will have differing voltages; this difference will reduce the noise margin of the signals. Balanced, differential, serial connections such as USB, RS-422 and RS-485 can tolerate larger ground voltage differences because of the differential signaling.[6]

Unused interface signals terminated to ground will have an undefined logic state. Where it is necessary to permanently set a control signal to a defined state, it must be connected to a voltage source that asserts the logic 1 or logic 0 level. Some devices provide test voltages on their interface connectors for this purpose.

Yes, I have used both 5 volts from a small 5 volt PSU and also used a 9 volt battery to provide a logic high to the pins I mentioned. I don't know exactly what your coin system is giving you. The idea was to show that there are lines on the RS232 that can serve as simple DIO lines. The input logic lines are either true or false (True = High and False = Low) they are false by default.

If you want to use the port for more then you would use the TX & RX lines and write a program accordingly to communicate with the device. Doing so requires knowing more about the coin taker and a coin taker designed for connecting via RS232 as well as the protocol of the device.

Again, what I linked to is simply to show you how the computer can read the port and do things.

Ron
 
I don't know exactly what your coin system is giving you.

Reading the English version of the page for the coin acceptor, we do have some information. It operates on 12 volts, so it's going to give a signal somewhere between 5 and 12 volts. Fortunately, it also gives the user the choice of three pulse lengths (30, 50 and 100mS), which is nice.

We still don't know exactly what this pulse looks like, but we know it's at least one single pulse, and that might well be all it outputs. A simple test with either a scope or even a PC sound card input would confirm that.

Another question of the O.P.: how many different coins are in use where you are? how many of these does this acceptor accept? If it takes more than one type of coin, then obviously there's the problem of distinguishing them from its output. Again, this could be discovered by a simple test.

Do you know how to connect something to your sound card input? This would give you a pretty good idea of what exactly the output of this device is.
 
Another question of the O.P.: how many different coins are in use where you are? how many of these does this acceptor accept? If it takes more than one type of coin, then obviously there's the problem of distinguishing them from its output. Again, this could be discovered by a simple test.

Do you know how to connect something to your sound card input? This would give you a pretty good idea of what exactly the output of this device is.

I haven't tried doing that thing in my computer sound card, but i will try and check it out. The coin selector accepts only a coin type you put in its coin clipper. Otherwise, it will reject all non-match coins.

Question: Does it make a short circuit to my motherboard if i connect the output line of my digital timer which is supply a 0-12vdc to RS232 port? It will just go high (12vdc) if a coin is inserted.
 
Last edited:
Ron, this is for you. Thank you for the Source Code that you gave to me... I tried to open the VB6 code, but unfortunately the source has a missing file named MSCOMM Test.frm. Would you mind to resend the source code so that i can run it perfectly.

Thanks
 
Last edited:
Here you go, sorry about that. I forgot to make sure it was in the download folder. Just click the link.

Ron
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top