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.

interfacing multiple feild sensors with microcontroller.

Status
Not open for further replies.

sanddune008

New Member
Hi All,

I am designing Hub which will take in inputs from 6 sensors and based on the sensor sends control command over UART interfaced to the RS485 network.

Now how do i interface these 6 field sensors to the PIC. Which can contain at the most 3 EXT INT's.

Assuming the field sensors to be passive devices which just gives a basic trigger circuit.

Is current loop 4-20ma the way to go?

Can any one suggest a solution in the design?.

Thanks in advance
 
It will receive Pulses......Basically i need to sense the pulse from respective sensors and send unique control commands to the network.
 
It will receive Pulses......Basically i need to sense the pulse from respective sensors and send unique control commands to the network.
 
If it's just pulses then use something like a 16F690 that has 10 interrupt on change pins.

Mike.
 
What is the distance between the sensors and the PIC? How are the sensors powered? Yes, what are the sensors?
 
I am sorry with misaddressing by defining sensors.....I will connected multiple switch inputs when the switch is closed sends a pulse. eg : activation of multiple door bells

Distance is again a grey area....roughly around 100mts diameter.

All i need a edge trigger and a way to define the exact source from were i am receiving.

As you can see that the physical device is totally dumb.

It would be wonderful if someone can give a right direction.

Thanks to all in advance....
 
Do you have two available I/O pins on the PIC? or even one will work.
 
Last edited:
If you only have 6 push buttons to read then use a 16F690 as I suggested earlier.

Mike.
 
Thanks for your time........


Do you have two available I/O pins on the PIC? or even one will work.

I am using PIC16F628A which has just one EXT INT and about 8 -10 I/O pins.

Can multiplexers be used for the same....but by doing this identity of the source generating the pulse is not known......as i need the identity to send specific control commands.

Thanks to all........
 
If you only have 6 push buttons to read then use a 16F690 as I suggested earlier.

Mike.

Thanks for your time.

But this will involve me to poll for the push buttons status.....that is not i what i want........

This how it is : I have 4 doorbells at different locations . Now when a bell is pressed i need to know which bell is pressed and send a specific command to all the end device connected to the network.

So i have introduced a hub. And struck how to proceed.
 
Okay, when I asked if you have one or two I/O I was under the impression from your first post that you had three INT inputs, not one. I also see that you are looking for an edge meaning that you must respond to the switch closure instantly, rather than waiting for a poll of the switch to detect a closure? Perhaps because the switch does not remain closed long enough for a poll detection, or because the response to a closure must be very fast?
 
The reason it's called interrupt on change is because it, ermm, interrupts.

Anyway, what is wrong with polling? What else does your "hub" have to do?

Mike.
 
Okay, when I asked if you have one or two I/O I was under the impression from your first post that you had three INT inputs, not one. I also see that you are looking for an edge meaning that you must respond to the switch closure instantly, rather than waiting for a poll of the switch to detect a closure? Perhaps because the switch does not remain closed long enough for a poll detection, or because the response to a closure must be very fast?

Exactly you got my problem.....

I am struck......changing the PIC won't be a problem.....but that is not the solution.
 
I am pretty sure that you can poll six I/O pins fast enough to detect a manual push of a doorbell switch. A manual switch closure and then release involves tens of milliseconds of closure time to complete.
 
This how it is : I have 4 doorbells at different locations . Now when a bell is pressed i need to know which bell is pressed and send a specific command to all the end device connected to the network.

I missed the fact you were using a 16F628. However the 628 also has interrupt on change on the top 4 bits of port b and so could be used to read 4 push buttons. With a bit of ingenuity you can easily make an array of 4*4 switches produce an interrupt when 1 or more are pushed.

Maybe you should explain what you are trying to do as push buttons are normally so slow that polling would be easily fast enough.

Mike.
 
Thanks for your time......


See it need not be a switch all the time...it could be a any trigger pulse to the PIC input. Ex: a trigger pulse from an existing Fire alarm device(tapping the signal to my PIC). or any device that can trigger a pulse.

Can 82c59 PIC (programmable interrupt controller be used for the same)....to logically increase the No: of interrupt lines.If so does anyone have any schematics for the same.
 
Thanks for your time......


See it need not be a switch all the time...it could be a any trigger pulse to the PIC input. Ex: a trigger pulse from an existing Fire alarm device(tapping the signal to my PIC). or any device that can trigger a pulse.

Can 82c59 PIC (programmable interrupt controller be used for the same)....to logically increase the No: of interrupt lines.If so does anyone have any schematics for the same.

The 82c59 seems like overkill for your application, but I suppose you could use it to do the job.

I'm thinking six edge-triggered flip-flops (like the 74HC175) to capture and store an edge event. Present the output of the flip-flops to your I/O pins directly, or follow with a multiplexer so that you can identify and route the stored event into one of 3 interrupts.

Those hundreds of feet of cable are a definite design consideration. A cable that long is subject to picking up all sorts of EMI and triggering an event. The cable should be twisted shielded pair and a schmitt-trigger, and or other input conditioning scheme should be placed in front of the edge storage function.
 
Last edited:
Hi,

You might try putting a 555 timer used as a "one shot" on each button so that the PIC will see the initial signal as an interrupt, and then have enough time to poll which timer is still high.
 
Status
Not open for further replies.

Latest threads

Back
Top