# multiplexer coding for calibration system

Hi,

Im currently doing my final year project titled online self-calibration for RTD sensor using multiplexer. To make it short and save your time, I will briefly explain about the project. Basically, this project is using multiplexer to select one reference voltage at one time, which I need to program it using the Arduino. The multiplexer will select each switch which represent the voltage that the RTD supposed to supply. So, first thing, I need help to program the multiplexer. And second one, to do an algorithm for the calibration of the system. At each switch, it should produce a certain voltage output, for example at X1 will be 6V. So, if let say X1 is switched ON, but the output voltage produce at the end of the circuit is not 6V, thus, the algorithm will fix it. if anybody has an idea,it would be great if you guys can share it with me. But it is not really a problem as I have a rough idea about the algorithm.

BUT i really need help on the selecting switch coding. Pretty please. I have attached my circuit design in case it is needed. Thank you!

final_draft_circuit.PDF (128 KB)

Your circuit does not seem to show what the supply voltage (Vdd) for the 4051 is, but I guess it is the same 5V as U2. So, assuming you are using a 5V Arduino, you just need three digital outputs to drive the A B and C inputs of the 4051. I don't see that you need to be able to control the 4051 inhibit input, so you could just ground that. If you really need to connect "nothing" to the U7 input, you could just select the unused X7 input, but I don't think you even need to do that.

I'm glad you have some idea for the algorithm, because I don't have a clue what you need to do, nor do I know how you propose that the Arduino will "know" what the output voltage from your circuit is.