Hi Folks,
I have a microcontroller-based project that I could sure use some guidance on. I have had extremely limited (that is to say, 'almost no') exposure to the universe of ICs available, so I'm having some trouble picking the right tools for my task.
In a nutshell: My microcontroller device must talk to a *remote* device (that I will build) in order to (a) obtain the open/closed status of 16-32 (16 is typical but must plan for 32) microswitches and (b) fire 8-16 (again lower number typical) devices with a 12V signal to their input pins. So I'm looking at 32+16=48 IOs. Remote means 5-30 feet.
Would be pretty straightforward except for some requirements:
1. Communication with the remote device *must* be via RS485 to accommodate a future '485 device that will be installed. Except for returning the status of the switches the remote does not need to send any data.
2. The 'master' and remote must be connected with no more than one eight conductor ethernet cable.
3. I must send 12VDC and ground down that cable.
4. Cheap is good but not an overriding concern. This will be a limited-deployment device with at most 1000 units placed. An extra buck or two won't preclude a potential solution.
So...
I have 4 wires used with power, ground, 485+ and 485- and thus have 4 left for 'whatever'. I'd love to use one of those to power the remote so I don't need a power supply (down from 12V) on the remote.
Again not having had much experience my inclination is to just throw the smallest, cheapest microcontroller (probably a smallish PIC16) that has a USART into the remote along with a 485 tranceiver. Then use 74HC165s to get the status of the switches and 74HC595s (with compound transistors) to fire the devices. I think this would work but my concern is that the part count seems a bit ridiculous (a uC and 6 ICs not counting the 485 to do a phenomenally simple task).
Another approach would be to use a uC on the remote that has enough IOs to handle all 48 items.
Something in the middle would be to use a somewhat smaller uC and multiplex the IOs, perhaps with something from the 4000 family.
And then there is the possibility (how remote I don't know) that I could get away with not using a uC at all - instead expanding 3 or all 4 of those extra inputs and using the 485 lines to clock in/out data (low speed is ok) to/from the other chips from the master. Other factors aside, this would be ok because the 485 lines are really just there in case we move to a different device that uses 485 and will eliminate the 48 IOs (reading and firing all over 485). This sounds cool but my gut feeling is that I'd just be replacing the uC with a few simpler chips and increasing both the part count and complexity of the device.
Can someone help me think this through or suggest something different?
Thanks!
One small point of clarification after reading another guy's closed stun gun thread: The devices I am "firing" are solenoid locks, not missiles, bombs, stun guns, pyrotechnics or employees! They have integral switches to indicate the locked/unlocked status of the lock.
I have a microcontroller-based project that I could sure use some guidance on. I have had extremely limited (that is to say, 'almost no') exposure to the universe of ICs available, so I'm having some trouble picking the right tools for my task.
In a nutshell: My microcontroller device must talk to a *remote* device (that I will build) in order to (a) obtain the open/closed status of 16-32 (16 is typical but must plan for 32) microswitches and (b) fire 8-16 (again lower number typical) devices with a 12V signal to their input pins. So I'm looking at 32+16=48 IOs. Remote means 5-30 feet.
Would be pretty straightforward except for some requirements:
1. Communication with the remote device *must* be via RS485 to accommodate a future '485 device that will be installed. Except for returning the status of the switches the remote does not need to send any data.
2. The 'master' and remote must be connected with no more than one eight conductor ethernet cable.
3. I must send 12VDC and ground down that cable.
4. Cheap is good but not an overriding concern. This will be a limited-deployment device with at most 1000 units placed. An extra buck or two won't preclude a potential solution.
So...
I have 4 wires used with power, ground, 485+ and 485- and thus have 4 left for 'whatever'. I'd love to use one of those to power the remote so I don't need a power supply (down from 12V) on the remote.
Again not having had much experience my inclination is to just throw the smallest, cheapest microcontroller (probably a smallish PIC16) that has a USART into the remote along with a 485 tranceiver. Then use 74HC165s to get the status of the switches and 74HC595s (with compound transistors) to fire the devices. I think this would work but my concern is that the part count seems a bit ridiculous (a uC and 6 ICs not counting the 485 to do a phenomenally simple task).
Another approach would be to use a uC on the remote that has enough IOs to handle all 48 items.
Something in the middle would be to use a somewhat smaller uC and multiplex the IOs, perhaps with something from the 4000 family.
And then there is the possibility (how remote I don't know) that I could get away with not using a uC at all - instead expanding 3 or all 4 of those extra inputs and using the 485 lines to clock in/out data (low speed is ok) to/from the other chips from the master. Other factors aside, this would be ok because the 485 lines are really just there in case we move to a different device that uses 485 and will eliminate the 48 IOs (reading and firing all over 485). This sounds cool but my gut feeling is that I'd just be replacing the uC with a few simpler chips and increasing both the part count and complexity of the device.
Can someone help me think this through or suggest something different?
Thanks!
One small point of clarification after reading another guy's closed stun gun thread: The devices I am "firing" are solenoid locks, not missiles, bombs, stun guns, pyrotechnics or employees! They have integral switches to indicate the locked/unlocked status of the lock.
Last edited: