Author Topic: icl7107 to read 5 different voltages  (Read 5904 times)

0 Members and 1 Guest are viewing this topic.

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
icl7107 to read 5 different voltages
« on: September 18, 2013, 08:30:11 pm »
i am trying to build voltmeter to read voltage from a power supply with 5 different channels. i got 2 icl7107 to use as volt meters and amp meters. i was thinking if there is a way of multiplexing the input voltage readout with analogue switches, like 4016 or dg413dj. the ic drives 3 and half digit 7 segment display but using 74hc245 i can connect the output to 5 sets of 3 and half 7 segment led and use 4017 to drive the output enable of the 74hc245. i have build a prototype for the out put and it all works. my problem is the i can not multiplex the input for some strange reason.

can some please let me know what i am doing wrong?
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2123
Re: icl7107 to read 5 different voltages
« Reply #1 on: September 18, 2013, 11:44:06 pm »
A circuit diagram might help diagnosis!

How fast are you trying to run this system? The 245 are not latched. Without looking at the data sheet I think the 7106/7 perform about 10-20 conversion per second (at best). If you manage to get this system working the display will be flashing on for 1/5 of the time at the update rate of 2-4Hz. That's going to be a very annoying display and a very slow to respond.

I know this is probably not the answer you want but wouldn't it be much easier to use five lots of 7107?

Edit: Thinking about this a little more: AFIK there is no easy way to synchronise to the conversion cycle of the 7107, so you will have to wait for two conversion periods to be sure that the output of the 7107 is valid.
« Last Edit: September 18, 2013, 11:53:07 pm by Andy Watson »
 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #2 on: September 19, 2013, 10:50:28 am »
thnx for the info, your right i tried so many different ways last night and no mater what i done i could not get it to work. the reason i wanted to use two of the 7107s is because i only got two of them at the moment and they are about £4 each.

i think the simpler way would be to us MCU, but i not any good at writing software and don't know how to read 5 channels of analogue signals with the MCU. i found a code that read two channel and displays it on lcd and that works fine. but the lcd i got is 16x2 and i can display 4 different readings on it. when i duplicate the code and use to read four channels the first two work and the other two just displays rubbish. 

i am using pic 16f884 in a 44 QFN package.


here is the code: 





// LCD module connections
sbit LCD_RS at RD0_bit;
sbit LCD_EN at RD1_bit;
sbit LCD_D4 at RD2_bit;
sbit LCD_D5 at RD3_bit;
sbit LCD_D6 at RD4_bit;
sbit LCD_D7 at RD5_bit;
sbit LCD_RS_Direction at TRISD0_bit;
sbit LCD_EN_Direction at TRISD1_bit;
sbit LCD_D4_Direction at TRISD2_bit;
sbit LCD_D5_Direction at TRISD3_bit;
sbit LCD_D6_Direction at TRISD4_bit;
sbit LCD_D7_Direction at TRISD5_bit;
// End LCD module connections

char Message1[] = "V:";
unsigned int ADC_Value1, DisplayVolt1;
char volt1[6] = "00.00";

char Message2[] = "A:";
unsigned int ADC_Value2, DisplayVolt2;
char volt2[6] = "00.00";

char Message3[] = "V:";
unsigned int ADC_Value3, DisplayVolt3;
char volt3[6] = "00.00";

char Message4[] = "A:";
unsigned int ADC_Value4, DisplayVolt4;
char volt4[6] = "00.00";


void main() {

  AD1CON1 = 0b00001111; // Analog channel select
  TRISD = 0b00000000; // PORTD All Outputs
  TRISA = 0b00001111; // PORTA All Outputs, Except A0,A1,A2,A3
  ADC1_Init();
  Lcd_Init();        // Initialize LCD
  Lcd_Cmd(_LCD_CLEAR);             // CLEAR display
  Lcd_Cmd(_LCD_CURSOR_OFF);        // Cursor off
  Lcd_Out(2,1,Message1);
  Lcd_Out(2,9,Message2);
  Lcd_Out(1,1,Message3);
  Lcd_Out(1,1,Message4);



do {

   ADC_Value1 = ADC1_Read(0);
   DisplayVolt1 = ADC_Value1 * 2;
   volt1[0] = DisplayVolt1/1000 + 48;
   volt1[1] = (DisplayVolt1/100)%10 + 48;
   volt1[3] = (DisplayVolt1/10)%10 + 48;
   volt1[4] = (DisplayVolt1/1)%10 + 48;
   Lcd_Out(2,3,volt1);
   delay_ms(120);


    ADC_Value2 = ADC1_Read(1);
    DisplayVolt2 = ADC_Value2 * 2;
    volt2[0] = DisplayVolt2/1000 + 48;
    volt2[1] = (DisplayVolt2/100)%10 + 48;
    volt2[3] = (DisplayVolt2/10)%10 + 48;
    volt2[4] = (DisplayVolt2/1)%10 + 48;
    Lcd_Out(2,11,volt2);
    delay_ms(120);


    ADC_Value3 = ADC1_Read(2);
   DisplayVolt3 = ADC_Value3 * 2;
   volt1[0] = DisplayVolt3/1000 + 48;
   volt1[1] = (DisplayVolt3/100)%10 + 48;
   volt1[3] = (DisplayVolt3/10)%10 + 48;
   volt1[4] = (DisplayVolt3/1)%10 + 48;
   Lcd_Out(1,3,volt3);
   delay_ms(120);



   ADC_Value4 = ADC1_Read(3);
   DisplayVolt4 = ADC_Value4 * 2;
   volt1[0] = DisplayVolt4/1000 + 48;
   volt1[1] = (DisplayVolt4/100)%10 + 48;
   volt1[3] = (DisplayVolt4/10)%10 + 48;
   volt1[4] = (DisplayVolt4/1)%10 + 48;
   Lcd_Out(1,11,volt4);
   delay_ms(120);

   } while(1);
 }
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2123
Re: icl7107 to read 5 different voltages
« Reply #3 on: September 19, 2013, 12:20:17 pm »
thnx for the info, your right i tried so many different ways last night and no mater what i done i could not get it to work. the reason i wanted to use two of the 7107s is because i only got two of them at the moment and they are about £4 each.
Are those from RS?

http://cpc.farnell.com/ £2.40
http://www.rapidonline.com £3

But I think you're right, a microprocessor/controller would make more sense.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #4 on: September 19, 2013, 12:33:16 pm »
Quote
i was thinking if there is a way of multiplexing the input voltage readout with analogue switches, like 4016 or dg413dj. the ic drives 3 and half digit 7 segment display but using 74hc245 i can connect the output to 5 sets of 3 and half 7 segment led and use 4017 to drive the output enable of the 74hc245. i have build a prototype for the out put and it all works. my problem is the i can not multiplex the input for some strange reason.

It is not clear to me what you want to do. Multiplexing inputs (selecting which analog source to read) isn't difficult, nor is multiplexing outputs (selecting which lcds to send the read out to), albeit more challenging. Both can be done with or without the use of a mcu.

It is also not clear what you have "built" and "made" to work.

The first thing to solve any problem is to define what the problem is that you want to solve.

================================
https://dannyelectronics.wordpress.com/
 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #5 on: September 19, 2013, 02:32:33 pm »
ok

i want to read 5 sets of voltages from a power supply. now using icl 7107 i can read 1 out 5 voltages at one time. but i want to be able to display all five at once. like a power supply voltage display

i have tried to multiplex the voltages to the input of the icl7017 but it does not work. no mater which frequency i use to switch between the in puts the 7107 seems to see only one of the voltages.

now using pic16f884 i can read out two different voltages at one time and display it on an lcd, but the lcd i have is 16x2. the display reads out like this:

V: 00.00         xxxxxxx
A: 00.00         xxxxxxx

now being a 16x2 display means i can show two more readouts on the right hand side where the xxxxxx is.the code reads ok for the two voltages on the left. but the ones on the right displays crazy letters.

compiling the code in mikro c does not give any error so i assume it to be ok. as i said before i am useless when it comes to coding and stuff so if there is a error in the code that i am probably not seeing. i am not sure if i have to read the ADC pins of the mcu in sequence or it does it automatically and if so what am i doing wrong. the code was for just one adc readout but i duplicated it to two and it worked so i figured it should work for four as well but not.

 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #6 on: September 19, 2013, 02:48:47 pm »
no from rapid. the rs prices seem to be better. rapid with VAT its about 3.37. still a bit to pay for if i have to get 3 of them and about 20 of 7 segment led. i wanted to build with what ever i have at home already. funny enough i found another 7107, so now i got 3. lol.

i have an old programmable power supply which has a 7 seg led display for two channels. looking inside it only has one icl7107 for the display, tracing the lines they go to two of mc6800 MCUs.  just thinking is there a way of say holding a data which the 7107 sets out to the led so then i can switch between channels.

so say i enable channel one and change the voltage to 5, the display reads 5 and when i select channel two the output of the 7107 is latch to channel one display and it holds. then the same for other channels. i mean this must be the way the power supply i got is doing it using the 6800 MCU?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #7 on: September 19, 2013, 02:52:44 pm »
Quote
but i want to be able to display all five at once. like a power supply voltage display

Does that mean you want to display 5 readings on 5 different displays or 5 readings on 1 display - the latter is considerably tougher to do given that you are dealing with segment lcds.

Quote
i have tried to multiplex the voltages to the input of the icl7017

You can switch the input with an analog switch - easily done.

Quote
but it does not work. no mater which frequency i use to switch between the in puts the 7107 seems to see only one of the voltages.

That's how it works.

Quote
V: 00.00         xxxxxxx
A: 00.00         xxxxxxx

You do realize that it has a voltage reading and a current reading. Quite different from "5 voltage readings".

Quote
compiling the code in mikro c does not give any error so i assume it to be ok.

Bad assumption: being able to compile without error / warning is just the first step in a long long journey.

Quote
as i said before i am useless when it comes to coding and stuff

Then pick an approach that you are good at.
================================
https://dannyelectronics.wordpress.com/
 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #8 on: September 19, 2013, 03:13:25 pm »
yes i  want to display 5 different voltages on 5 different 7 segment led. i know just because the code didn't give error don't mean its ok, but as i said i am useless at coding lol.
 
i can switch between the inputs with analogue switches but say i am reading channel one and it reads 5, if i switch to channel two i will lose the reading of channel one. i want to be able to display all channels simultaneously.

now the power supply i  got which i am trying to read out the voltage from been modified so i have an out put of 0-2 volts from one of the op-amps to represent the 0-2 amp of the power supply which feed to the ADC pin of MCU can represent 0-2 amp of the power supply.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #9 on: September 19, 2013, 03:41:45 pm »
Quote
i  want to display 5 different voltages on 5 different 7 segment led.

Your code does none of that - I am sure you understand that, right?

The simplest approach (for me) would be to use the 7107 as a (high precision) adc: you will switch the input and you will need a lot of pins to read the 7107's output to obtain a reading of its adc results. From there, you can drive 5 sets of 7-segment leds: that can be done with either slave display drivers (7219 for example) or via multi-tasking - requires high clock speed; and more importantly it requires coding.

Another solution is to use an analog switch to switch sources and then use latches to drive 5 sets of displays. They can be driven by a mcu (with minimum coding) or with a clock - given 7107's slow conversion speed, something like 1hz clock would work here.
================================
https://dannyelectronics.wordpress.com/
 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #10 on: September 19, 2013, 04:02:33 pm »
no the code that i have showed is only for MCU to read out 4 of the ADC channels and convert the voltage and display it on LCD.

regarding the 7107, how can i latch the out put of its 7 segment display bit to an driver. the 7107 does not multiplex the output of its led display. it has 4 sets of 7 segments display with individual letters.

is there any logic chip like the 4000 or 7400 series that can do the latching, i am only saying that because i have lots of logic chips at hand.

the idea behind this was to use my resources that i have and learn in the process, i know i can buy volt meters from ebay for few pounds but it defeat the purpose.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2123
Re: icl7107 to read 5 different voltages
« Reply #11 on: September 19, 2013, 04:25:07 pm »
The more I think about this, the more I think you're on to a loser in trying the multiplex the outputs of a 7107. The basic problem is that the 7107 was designed to be a stand-alone ADC with an LED output. It does not provide a signal to indicate the end-of-conversion, nor can you control conversion process. This means that you cannot (easily) know when the outputs change state - consider what state would be latched if the 7107 was flipping between 0.999 and 1.000 as you read it.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5140
  • Country: ro
  • .
Re: icl7107 to read 5 different voltages
« Reply #12 on: September 19, 2013, 04:48:54 pm »
Trying to read the output of the ICL7107 is not a good idea. You're better off just going directly to a similar dmm IC that exports the measurement through i2c  or SPI. Then you can use multiple ICs to import measurement into the microcontroller.

ICL7106 , ICL7107 etc only do 3 samples per second as far as I know, so I don't think you can use an icl710x to read several voltages within a second.

I'd suggest looking into something like MCP3002: http://uk.farnell.com/microchip/mcp3002-i-sn/adc-10bit-2-7v-2ch-spi-8soic/dp/1834969


 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #13 on: September 19, 2013, 05:56:21 pm »
Quote
how can i latch the out put of its 7 segment display bit to an driver.

Too many to list. Given that you are driving leds from bcd output, you may want to look for a 7-segment driver with bcd input (4511). Those chips typically have latched inputs and you need 4 of them (can be 3 with a little bit of brain storming).

Again, you should find what you are good at and figure out an approach that suits your skills.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #14 on: September 19, 2013, 06:03:37 pm »
Quote
You're better off just going directly to a similar dmm IC that exports the measurement through i2c  or SPI.

Some of them output pwm so that's fairly easy to read.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #15 on: September 19, 2013, 10:52:35 pm »
Quote
a 7-segment driver with bcd input (4511)

I have to take it back - I must not be thinking straight then.

The output is 7-segments + signaling. So you will need a total of 24 pins, and the signaling is not BCD.

That means 3 8-bit latches. 273 fits the bill.
================================
https://dannyelectronics.wordpress.com/
 

Offline mj21Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: icl7107 to read 5 different voltages
« Reply #16 on: September 20, 2013, 08:23:25 am »
thnx guys for all the help..

last night i found icl7135 which is 4 1/2 digit DVM chip and i was trying to interface it with 4511 and well you know they say never work if your tiered, they were right lol i connected the supply wrong way and blow up the chip.

i am going to try to interface the 7107 with 74237s see it i can get it to work. by the way i have 74374 and 74574 as well. will they work. the 74574 is (Octal D-type flip-flop; positive-edge trigger) so its the same as 74273, but got better pin configuration.



« Last Edit: September 20, 2013, 08:27:32 am by mj21 »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: icl7107 to read 5 different voltages
« Reply #17 on: September 20, 2013, 01:06:59 pm »
If you are getting a new one, try to get one that has a pwm output - a lot easier to interface with.

Otherwise, the latches will work.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf