LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplexer 4051 on Labview

Hi,

I have a project to measure the voltage of 20 cells of a battery. I use an arduino uno but it has only 6 analog inputs. So, i use two analog multiplexer 4051 to extend the analog inputs and i want to display the results on LabView. My problem is that i don't know how to use the 4051 on Labview to display the 20 values of the cells. Thank you.

0 Kudos
Message 1 of 9
(4,256 Views)

Do you have the 4051 mux hardware operaing? 

 

Have you read this? Ardunio Playground Analog Multiplexer/Demultiplexer - 4051

 

You need to use three of the Arduio digital pins to address the 4051 and one pin to select direction (you could just tie this pin to +5 or Gnd as needed)

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 9
(4,245 Views)

Yes I read it. I simulated it with Proteus and I wrote the code on arduino and it works. Do I have to create a multiplexer on LabView ? Because I created one on Labview before but I didn't know how to connect the pin.

0 Kudos
Message 3 of 9
(4,242 Views)

All you really need to do is address the 4051 with three digital pins and read the voltage passed through on an analog pin

 

Lets say you have the output 4051 (z) on analog pin 1 and are using D0,D1,D2 for addressing

 

If want to read the voltage on 4051 input y2

 

First write 0 to D0, 1 to D1 and 0 to D3

 

Then read the voltage on Analog pin1

 

I would create a typeDef and sub VI that would take care of all the addressing and read.

 

On closer inspection I see there is no direction pin on the 4051, the E pin is an enable low so just tie it to ground unless you need  to use more than one 4051 on the same analog pin of the Arduino

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 9
(4,228 Views)
How can I read 8 voltages ? analogRead of the arduino on LabView had only one output voltage. Do i have to modify the subVi of the analogRead.vi ?
0 Kudos
Message 5 of 9
(4,211 Views)
You read 8 voltages by setting the mux for 8 different patterns and taking a read each time. This is done inside a loop and you save each read In an array. Or, write your sketch to generate the 8 patterns and the analog read and return the array to LabVIEW. Your choice.
0 Kudos
Message 6 of 9
(4,204 Views)

It sounds as though your electronic skills may be limited. Are you sure that your voltages from the battery never exceed the input ratings of the 4051?  It is a nice device but is not very robust when it comes to overvoltage! You could also damage your Arduino if you are not careful!

 

Lynn

0 Kudos
Message 7 of 9
(4,197 Views)
I use an amplifier and a voltage divider to reduce the voltage. Thank you very much for the help 🙂
0 Kudos
Message 8 of 9
(4,191 Views)

 

@bigboss2582 wrote:
How can I read 8 voltages ? analogRead of the arduino on LabView had only one output voltage. Do i have to modify the subVi of the analogRead.vi ?

Do you understand what the 4051 chip is and does? Have you read the 4051 data sheet?

 

Think of it as an eight input  binary controled selector switch.

 

You select an input and measure that input with one analog pin.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(4,154 Views)