×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

HELP!! - Need simple 4 sensor digital circuit...

HELP!! - Need simple 4 sensor digital circuit...

HELP!! - Need simple 4 sensor digital circuit...

(OP)
Hi,

I am a programmer by trade, so some of the electrical engineering stuff goes over my head. I will do my best to explain my problem and I would love anyones input.

PROBLEM:
I have an Elexol Ethernet IO24 Digital I/O Module, with an Elexol 8 CH Opto-Isolated I/O Board connected to it.
So now I have 8 digital channels to work with.

I need to build a module that connects to the 8 CH I/O board and supports 4 sensors.

If each sensor has 8 bits of precision, I will need to limit them to 6 bits of "readable" precision. And use the last 2 bits (on my I/O module) for control. Here is some pseudo code to explain my logic, hope it makes sense.

//array is io board, pins 6,7 are control pins, while 0-5 are data pins (from sensors)
$ioBoard = array(0, 0, 0, 0, 0, 0, 0, 0);

//poll sensors based on value of pins 6,7
$ioBoard = getSensorData($ioBoard[6], $ioBoard[7]);

//the sensor circuit
function getSensorData($pin6, $pin7)
{
//6 bits data
$data = array(0,0,0,0,0,0);

//magic circuit logic
switch ($pin6.$pin7)
{
//sensor 1
case '00':
$data = SENSOR_1_8_BITS_TRUNCATED_TO_6;
break;
//sensor 2
case '01':
$data = SENSOR_2_8_BITS_TRUNCATED_TO_6;
break;
//sensor 3
case '10':
$data = SENSOR_3_8_BITS_TRUNCATED_TO_6;
break;
//sensor 4
case '11':
$data = SENSOR_4_8_BITS_TRUNCATED_TO_6;
break;
}
return $data + array($pin6, $pin7);
}

RE: HELP!! - Need simple 4 sensor digital circuit...

Ok. So you have 2 digital outputs and 6 digital inputs. Sounds reasonable. What's the question?

RE: HELP!! - Need simple 4 sensor digital circuit...

Do the sensors have some kind of "chip select" input? Are they open collector or tri-state so that you can wire them all in parallel? Or do you plan to use a multiplexer to select one out of four sensors via a 2->4 decoder?

Gunnar Englund
www.gke.org
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...

RE: HELP!! - Need simple 4 sensor digital circuit...

(OP)
THE QUESTION IS:
I need to build a module that connects to the 8 CH I/O board and supports 4 sensors.

Essentially, how to turn my code into a circuit.

As far as the sensors I am using, I don't have any yet... But I have seen 8 bit digital sensors...

I would probably like to connect sensors of the following 4 types:
-Temperature
-Rel Humidity
-PSI for liquid
-And maybe some photoelectric cells to tell me how much light they are recieving.

Hope this makes more sense and once again, apologies about my lack of knowledge.

RE: HELP!! - Need simple 4 sensor digital circuit...

Your description seems to imply that you think that the "8 channels" represents 8-bits of precision, which could be considered that way, but that means that all 4 sensors are paralleled, and without a chip select or output enable as Skogsgurra alluded to, all 4 sensors are essentially shorted to each other.

A potentially cleaner approach is to use serial output sensors.  Then each sensor would get its own I/O channel and you needn't worry about how to select one sensor and disable the rest.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: HELP!! - Need simple 4 sensor digital circuit...

(OP)
IRStuff... you are right about my assumption. So let me back up a bit.

My 2 control, 6 read idea was just something that made sense to me, but I do NOT know what i'm talking about.

So let me simplify my question.

Given the 8 channel I/O board, how can I read maximum precision from 4 or more sensors?

Thanks again for everyones patients and input. If anyone needs  some code help, I'm here for them.

RE: HELP!! - Need simple 4 sensor digital circuit...

Are you really set on using that specific I/O board?  If you get a board with analog inputs, I think you would have a much larger choice of sensors.  I think it is fairly uncommon that sensors would have a parallel digital output.  IRstuff's serial approach would also be a good one.

RE: HELP!! - Need simple 4 sensor digital circuit...

If each sensor can output serial data, and IF the I/O board has UARTs, then the problem is trivial, since there would be no reason to truncate the sensor data.  Hypothetically, if the sensors had 16, 24, or 32 bit data in serial output, there would be no functionality loss.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: HELP!! - Need simple 4 sensor digital circuit...

(OP)
geekEE: I'm not necessarily married to the 8 channel board, except that I already own it and it works with the host board, which I do want to use. I already have a portion of my project complete using 8 of the 24 channels of the Ether I/O 24 (host).

IRstuff: If I understand what you mean by serial sensors, then that seems like a good solution. I'm not quite sure what UARTs are, so here are a few specs from the Ether I/O 24:

The Ether I/O 24 is an UDP/IP controlled digital Input/Output module. The module features three 8-bit ports with 5V level signal lines. Each of the 24 lines can be independently programmed as either an input or output.
# 24 independently programmable signal lines with configurable CMOS, TTL or Schmitt Trigger thresholds and programmable pull-ups per line
# Easy connection by three 10 way box headers to suit low cost, standard IDC or Crimp connectors
# Integrated Switch Mode Voltage Regulator allows power from any 8-32V DC Power source
# User 5V 500mA output to power external Interface boards or sensors

RE: HELP!! - Need simple 4 sensor digital circuit...

(OP)
I was just looking at sensors, and I think this is what you are talking about IRstuff.

Do either of these seem apliciable?
SHT11 Temperature and Humidity Sensor Module
When it comes to precision temperature and humidity measurement, Sensirion has simplified the process their SHT1x sensor series. Through a two-wire serial interface, both temperature and humidity can be read with excellent response time and accuracy. Parallax has simplified the use of the SHT11 by mounting it in a user-friendly 8-pin DIP module. The module includes a data-line pull-up and series limiter.

DS1620 Temperature Sensor
The DS1620 is as a digital thermometer with +/-0.5C accuracy from a -0C to +70C. The temperature is read out over a 3-wire serial bus in 2's complement format with 9 bits of resolution. Higher resolution readings can be calculated using data from the DS1620 counter and slope accumulator registers.

RE: HELP!! - Need simple 4 sensor digital circuit...

UART- Universal Asynchronous Receiver/Transmitter

This is the component behind an RS-232 serial interface.

Unfortunately, your board does not support serial.  It's basically 3 parallel ports and that's about it.  

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: HELP!! - Need simple 4 sensor digital circuit...

(OP)
Any thoughts on how I can pull this off then?

RE: HELP!! - Need simple 4 sensor digital circuit...

This is a school project.

Gunnar Englund
www.gke.org
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...

RE: HELP!! - Need simple 4 sensor digital circuit...

I'm having problems with this one.  This is like a total neophyte who has no clue about how to do what he wants.  What's amazing is all the members willing to explain what serial ports are , etc, etc, etc.  Even at that they talk on, about 2 miles over his head!

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: HELP!! - Need simple 4 sensor digital circuit...

Perhaps, but I didn't know what a UART was until I actually owned a PC, which was more than 3 yrs after I started working.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources