04-06-2015 12:50 PM
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.
04-06-2015 01:36 PM - edited 04-06-2015 01:37 PM
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)
04-06-2015 01:41 PM
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.
04-06-2015 04:03 PM - edited 04-06-2015 04:06 PM
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
04-06-2015 05:14 PM
04-06-2015 05:31 PM
04-06-2015 05:45 PM
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
04-06-2015 05:48 PM
04-07-2015 09:27 AM
@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.