1
\$\begingroup\$

I am using arduino Uno for developing my project. There are totally 24 analog hall sensor out put,1 temprature ananlog output, 1 Rshunt voltgae measurement. There are totally 26 Analog sensor.I am distributing 24 analog channel in 8:1 analog multiplxer usingAnalog Multiplexer; Where it used totally 3 analog ,1 temprature,1 voltage sesnor.

Now @ digital side i need

3 For selecting 8:1 Multiplexer 1 for error status 1 for Blink led 1 for SPD status 1 for disconnector status 2 for MODBUS communication 2 for serial communication 8 Pins for selecting Device ID using DIP Switch totally i need 19~20Pins. SO i need Method of reducing it. Please look my schematic attached If any alternation i can do here let me Know.And my question here is this method correct , Switch i represented here is dip Switch followed by 1k resistor.

I wanted to How can i configure device ID 255 No,

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
\$\begingroup\$

Use another multiplexer to read the 8 ID switches, selected by the same 3 bits as the others and with its output going to a single digital I/O pin. That should save 7 pins, leaving 3 spare for other things that you haven't thought of yet.

You could use a digital multiplexer such as MC74HC151 or 74HC251, but it might be cheaper and easier to just use another HCT4051, as then you only need a single pullup resistor on the digital I/O pin, rather than 8 (one per switch) on the multiplexer inputs.

\$\endgroup\$
  • \$\begingroup\$ Aboot . I am using 8:1 digital multiplexer itself, please check properly which is connected to 8 switches. i am asking above schematic correct or not. If any alternate method avilable?? \$\endgroup\$ – Ajit N Nov 22 '14 at 7:16
  • \$\begingroup\$ Your circuit diagram is unreadable. Is the box that the switches are connected to a digital multiplexer? If so then you should already have enough pins free (but you said "@ digital side i need... 8 Pins for selecting Device ID"). \$\endgroup\$ – Bruce Abbott Nov 22 '14 at 7:30
  • \$\begingroup\$ @ Bruce . You goin edit mode you can check my circuit diagram. \$\endgroup\$ – Ajit N Nov 24 '14 at 6:43
0
\$\begingroup\$

For expanding the digital pins you could use PCF8574A for example. It's an I2C expander that will give you 8 digital IO pins in a DIP16 package. You can use up to 8 of them on a single I2C bus.

Similarly for the analog sensors you could use an external I2C ADC converter with a built-in multiplexer. There's many different models to choose from.

This way you can control everything through I2C.

Hope this helps.

\$\endgroup\$
0
\$\begingroup\$

If this is a one-off, and not for production, and you're just detecting thresholds with your Hall Effect Sensors, I'd consider a half dozen quad comparators and dealing with digital outputs instead of analog sampling and analog multiplexers. If all your thresholds will be the same, this is even more appealing.

You'll have more hardware and a few extra dollars, but coding ease and speed may make it worth it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.