Arduino Demultiplexing problem

Hi, I'm testing demultiplexing signal using arduino mega and analog mux/demux TS5A9411DCKT

For test, 5V input and switching it with port 2 (High -> Low -> HIgh ...)

and for check signal, using analogread() function with A0 and A1

I expect that 5V signal comes out one side(High) and the other side 0(Low) comes out or floating pin value

But when i printed it, both side have 5V output (about 1020~1023 analog value)

Why??

I'm tested mux/demux chip using multimeter and switching done well

Here is my arduino code and schematic

#include <Wire.h>
bool MUXFlag = false;
int aP1 = A0;
int aP2 = A8;
int a1 = 0;
int a0 = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);
  delay(10);
  pinMode(2,OUTPUT);
  delay(10);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (MUXFlag == false)
  {
      digitalWrite(2,HIGH); 
      MUXFlag = true;
  }
  else if (MUXFlag == true)
  {
      digitalWrite(2,LOW);
      MUXFlag = false;
    
  }
     delay(1000);
  a0 = analogRead(aP1);
  delay(100);
  a1 = analogRead(aP2);

  Serial.print("A0 : ");
  Serial.println(a0);
  Serial.print("A1 : ");
  Serial.println(a1);
 
}

mux_demux

aP1 and aP2 have no active pull downs. They are floating when not selected so they mostly reflect their previous value.

I made pull down to NO and NC (with 13k ohm resistor)

Signal goes down to 600~800 analog value (about 3~4V)

Is impossible to makes 0V?

Which arduino? Can you provide a complete schematic showing how the chip is wired to the Arduino in full detail?

Certainly seems odd from the description so far.

This is my full schematic

Hi,

Come on join it all together, this is for troubleshooting not PCB production.

What about;
Power Supply.
Controller.
Bypassing.

You have your project in front of you, we don't.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Write a sketch that toggles your "PWM" pin instead of PWM'ing it. Assuming you've assembled things right, with P2 in one state, one of NO or NC will be at 5V, the other at 0V. With P2 in the other state, both NO and NC should change state. Doing it at a slow rate will help to debug it.

I can't imagine what you are up to.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.