Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

dubhunter

Computer
Sep 21, 2007
6
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);
}
 
Replies continue below

Recommended for you

Ok. So you have 2 digital outputs and 6 digital inputs. Sounds reasonable. What's the question?
 
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
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
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.
 
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
 
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.
 
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.
 
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
 
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
 
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.
 
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
 
This is a school project.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
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.-
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor