I'm working on project where I need watch voltage (0-5VDC) on 24 pins then I'm looking for ADC module with 24-channel (or more) it can be 8-bit I don't need high preccision with I2C or SPI communication. Is there a chance to find cheap one?
Can you tell more about your project ? Are you trying to measure 24 batteries ? Are those batteries connected in series ?
There are analog multiplexers: https://www.gammon.com.au/forum/?id=11976. With 2 of 16-channel multiplexers you have 32 analog input.
There are also multichannel external ADC modules: Overview | Adafruit 4-Channel ADC Breakouts | Adafruit Learning System.
For every situation, there is a good solution, except when you want to measure 24 batteries that are in series.
I want to read the value from three 7-segment LED displays 8-pins from each segment, total 24-pins. I have ADS1115 but it have only 4 inputs and I can connect only up to four of these (bcause of I2C address). With multiplexers I probably can't read it fast enought.
For reading whether an LED is on or off you are probably better off with digital inputs. Not only are they faster, the LEDs are normally only ever full on or full off so reading this through an ADC doesn't make sense. Use three 74HC165 shift registers (needs three pins; can use the SPI bus for highest speed), or three PCF8574 port expanders (I2C; slower but still way faster than using analog inputs).
It is very well possible that your displays are multiplexed, if that's the case the reading becomes a whole lot more challenging.
I think reading multiplexed digits wouldn't be too bad - you'll have 7 segments, and 3 digits.
As long as you know which is which, you wait for a digit line to go low, and then capture all the segments.
Then wait for the next digit line to go low, and capture all the digits.
Repeat for the 3rd.
Even at MAX7219 speed, where multiplexing is going on at 800 Hz, that means all segments are driven for 1250uS, which a PINx read can handle all at once, ex.
segments = PIND;
Or two PINx commands if using an Uno, which only has 1 8-bit port available (and Serial() uses two of the pins); such as
segmentABCD = PIND & 0xF0 >>4; // read 4 segments pins 7-6-5-4
segmentEFGDP - PINB & 0x0F; // read 4 segments in pin 11-10-9-8
1284P, Mega, have multiple full ports available.
CrossRoads:
I think reading multiplexed digits wouldn't be too bad - you'll have 7 segments, and 3 digits.
As long as you know which is which, you wait for a digit line to go low, and then capture all the segments.
Then wait for the next digit line to go low, and capture all the digits.
Is it safe to connect PCF8574 directly to 7-segment LED if I use 3.3V esp8266?
Depends on the voltage the LED is driven at. You have to know/measure this.
Do you have the grounds of your project and the one that has the LEDs in it connected? Mind: the cathode of the display is not necessarily the ground of the system, there may be a low side switch.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.