Controlling frequency and state of the DI signals. - Page 1
Forum section: electronics / beginners

author: Goran
author_rank: Contributor
timestamp: April 21, 2016, 10:40:37 pm
content: Hi,I have one ICP DAS ethernet I/O module with 8 DI and 8DO. I would like to make a closed test environment where I would simulate up to 8 random voltage signals on 8 DI, and then read those signals through ethernet connection. DI specification for module says:On Voltage Level +10 VDC ~ +50 VDCOff Voltage Level +4 VDC Max.All DIs can be set to act as counters. What I need to be able to do is:- switch each signals on / off- control the frequency of signals. So, one signal could come every 15s, and one every 75ms.I am a software engineer, and I am not much versed in electronics, I have mostly done some simple circuits on a need to base. Can anyone point me to any resource that would tell me what components would be required to achieve this?Thanks.

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 22, 2016, 05:28:37 am
content: Not 100% clear what you're trying to build, perhaps tell what the end usage scenario would be. Here are some relevant questions:What range of frequency do you need for the signals ?How do you want to switch the signals on / off?How do you want to control the frequency ... or how easy / difficult should it be from a user perspective ? How precise does the control have to be ?Do you need to control the amplitude of the signal ?Are signals square waves ?

author: Goran
author_rank: Contributor
timestamp: April 22, 2016, 08:41:07 am
content: I am trying to build a simulation where I would be able to control 8 different inputs to ICP DAS. By control I mean how frequent are they and if they exists or not. The goal is to be able to count for those signals on the ICP DAS. In a production environment signals would come from some sensors (like an inductive sensor), and are commonly 24V DC, so I am assuming that ICP DAS is responding to a positive edge signal.From simple point of view, layout for single input would look like this:24VDC power supply -> Switch -> Frequency control (signal goes ON / OFF) -> ICP DASSo, here is how I would use it:Set the frequency of the first signal and turn it on. Check if my software is detecting that there is an active signal on the 1st DI.Set the frequency of the second signal and turn it on. Check if my software is detecting that there is an active signal on the 2nd DI.Set the frequency of the sixth signal and turn it on. Check if my software is detecting that there is an active signal on the 6th DI.Turn off second signal, and see if my software will detect a missing signal.>> What range of frequency do you need for the signals ?I guess satisfying range would be from 10ms to 10s.>> How do you want to switch the signals on / off?Lets say i would switch one signal with on / off switch (button)>> How do you want to control the frequency ...Lets say with a potentiometer. It does not have to be precise, it is just used by me for a testing purpose.>> Do you need to control the amplitude of the signal ?I am not aware that I do need to control amplitude>> Are signals square wavesYou can see the on / off level voltage for the DI in the question. Ideally, signals should have 2 levels: 24V and 0V, like in binary logic (1 or 0).

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 22, 2016, 03:05:04 pm
content: Seems like you could just use a 555 oscillator per channel like :http://www.circuitstoday.com/wp-content/uploads/2008/04/variable-frequency-oscillator-circuit.gifUse the output to drive a MOSFET like this :http://www.pretzellogix.net/wp-content/uploads/2011/03/LED-MOSFET.pngSince 555 is meant to work to max 18V, use a linear 12v regulator to power the 555's and have only the MOSFET deal with the 24V.Adjust the frequency with a potentiometer + add a switch to control on / OFF state.Disadvantage is that 555 has tricky behavior with multi-second delays so you won't have great stability at high periods.Alternative would be an Arduino Mega 2560 and do everything in software.The output of the Mega would feed a mosfet that would do the same thing as in the case of the 555.Set the frequency using a potentiometer on different analog pins, etc.

author: Goran
author_rank: Contributor
timestamp: April 24, 2016, 02:27:39 pm
content: Hi, thanks for the info.NE555 looks like what I need. I am not sure about MOSFET though. Basically I do not need end signal to be 24VDC. If you look at the specification for ID, it needs minimum 10VDC for ON state.So, if I already have a 24VDC supply, schematics would look something like this:24VDC supply -> voltage drop to 15V (maybe through a resistor / zener?) -> NE555 -> ICP DASSince you mentioned microcontroller board, that solution could be more interesting to me. Can you clarify one thing for me (from 2560 specification):Operating Voltage 5VInput Voltage (recommended) 7-12VInput Voltage (limit) 6-20VWhen it says input voltage, does it mean DI / AI voltage? Does that I cannot bring 24VDC signal to DI, recommended 12VDC?

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 24, 2016, 02:59:38 pm
content: For the 555 - yes, you do not need the MOSFET if you're ok with driving the DI with 15V.The voltage drop should be through a linear regulator, you'll probably be using 20 mA / ch at peek => 160mA total. So your zenner would be dissipating 1.5-2w, which would be too much for a zenner, not to mention inefficient.For the 2560:The 2560 board also looks internally like : DC supply => voltage drop to 5v( via linear regulator ) => output(0V/5V) to whatever you connect it to (in your case DI)So the input voltage referes to the supply maximum voltage, which means that you can't power it directly from 24v, you'll need a linear regulator (7812) between the 24v supply and the 2560.Since the output is maximum 5v, you'll need to use the MOSFET circuit mentioned above to generate 10V+ for the DI.BTW another way to do it if you want more software, less electronics( use Google translate to translate to English ), here is an article trying to do something very similar to what you are trying to do:http://labkit.ru/html/autocontrol?id=136That circuit is using PC software to control 8 LEDs via RS232 . You can build the circuit and also add a MOSFET for every LED that would control the DI.For RS232 you can use this:http://www.aliexpress.com/item/6Pin-USB-2-0-to-TTL-UART-Module-Serial-Converter-CP2102-STC-Replace-Ft232/32364013343.html

author: Goran
author_rank: Contributor
timestamp: April 25, 2016, 01:39:21 am
content: Thank you for the link with controlling LEDs through serial port, this looks interesting to know.To summarize what I have learned before I can proceed acquiring required components.If I have a 12VDC power supply, I can connect it directly to Arduino, since its recommended Input voltage is 7-12VDC. The DO on Arduino is 5VDC. Since my ICP DAS DI require 10+VDC to become ON, I need to use MOSFET.I was reading about MOSFET, and how to connect it. this is what I have found out:Arduino DO -> MOSFET gate (its recommended to put 100K resistor between Gate and ground to ensure MOSFET stays off by default)12DC power supply -> MOSFET SourceMOSFET Drain -> ICP DAS DI.For this I need an appropriate P-MOSFET Logic Level type. And I would require MOSFET for each ICP DAS DI.Is this correct?

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 25, 2016, 07:57:24 am
content: Quote from: Goran on April 25, 2016, 01:39:21 amYes all that you say above is correct.Also you may want to check if the DI input is compatible with being left "floating". When the MOSFET will be off, the DI input will be left floating( not connected to anything, specifically ground in this case). To fix that you might need a pull-down resistor directly on the DI input.

author: Goran
author_rank: Contributor
timestamp: April 25, 2016, 07:42:27 pm
content: Then its best to get pull-down resistors before I start assembling.Would 10KOhm be good enough for this purpose?And this MOSFETs:http://pdf1.alldatasheet.com/datasheet-pdf/view/123973/TSC/TSM3401CX.html

author: michaeliv
author_rank: Frequent Contributor
timestamp: April 25, 2016, 08:22:13 pm
content: 10k would be what I would try first too.The MOSFET looks good.