# Multiplexing with 74HC4067

**URL:** <https://forum.xod.io/t/multiplexing-with-74hc4067/1302>\
**Category:** Uncategorized\
**Created:** [November 1, 2018, 12:20pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302 "2018-11-01T12:20:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 1, 2018, 12:20pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/1 "2018-11-01T12:20:30Z")

</div>

How would you go about that in xod? using the 74HC4067 or similar?  
Would love to multiplex analog inputs (pots), and output, via demultiplexing, multiple DC outputs from 0-5v.

Can it be done? I’m a compllete noob:)  
thanks!

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 1, 2018, 1:57pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/2 "2018-11-01T13:57:21Z")

</div>

Hello, you can try this and comment if it works

[cesars/4067](https://xod.io/libs/cesars/4067/) update!

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 1, 2018, 1:59pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/3 "2018-11-01T13:59:30Z")

</div>

Cool! thanks!

In my noobness, i cant seem to find that node. Where is it located in xod? Isnt there a search bar in the software somewhere?

If it doesnt work, and there is no node for it, can you make your own? I have no programming skills, but i have seen other examples, and the code for it, so i guess i could pretty much copy paste that.

thanks!

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 1, 2018, 2:02pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/4 "2018-11-01T14:02:14Z")

</div>

> [@the19thbear](#):
>
> If it doesnt work, and there is no node for it, can you make your own? I have no programming skills, but i have seen other examples, and the code for it, so i guess i could pretty much copy paste that.

the name of the node is `ctrl-4067`

> [@the19thbear](#):
>
> In my noobness, i cant seem to find that node. Where is it located in xod? Isnt there a search bar in the software somewhere?

add the library

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 1, 2018, 2:18pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/5 "2018-11-01T14:18:07Z")

</div>

Ok. Thanks. Found it.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 1, 2018, 2:25pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/6 "2018-11-01T14:25:02Z")

</div>

load the library again, is updated

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 1, 2018, 2:27pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/7 "2018-11-01T14:27:17Z")

</div>

You are freaking amazing!  
If you could make a small explanation on how to use it in an actual project (just explaining the ins/outs), that would be awesesome, but only if you have time - I dont really know how to hook it up myself:) Will go get a arduino nano and the 4067 chip today, and test next week.  
Wohooooo!!

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 1, 2018, 4:17pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/8 "2018-11-01T16:17:44Z")

</div>

update with an example, I hope it’s useful, let me know if it does not work  
this only works for inputs

 ![4067](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/3150e7e36402801912390f2d73c2fb86b45be208.png)

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 1, 2018, 4:47pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/9 "2018-11-01T16:47:01Z")

</div>

I dont really get it, but like look into it:)  
I know how a multiplexer works, but can’t really follow everything. But again. I’ll experiment and look into it.

It seems to me that you have a clock generator, and from there you go to a device that steps up from 0-15 I would assume, and the number 6, in green, is where the step has reached? The select block, I don’t fully understand. Also don’t understand the “value” on the lower left.

But I’ll get it at some point:)

Is there an output version in the works?😉  
Or maybe I can find that somewhere else?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 1, 2018, 5:11pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/10 "2018-11-01T17:11:45Z")

</div>

> [@the19thbear](#):
>
> It seems to me that you have a clock generator, and from there you go to a device that steps up from 0-15 I would assume, and the number 6, in green, is where the step has reached? The select block, I don’t fully understand. Also don’t understand the “value” on the lower left.

Ok, `VAL` is the reading of `PORT` (A0), with `a, b, c, d` you control the outputs `ABCD` for channel 0-15, if it is at 6 the value that arrives at `PORT` is channel 6(0-15), and that value will you can see in `VAL`

PORT, INH, A, B, C, D are ports in arduino

> [@the19thbear](#):
>
> Is there an output version in the works?

update, please try it

 ![CD74HC4067](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/ee1a98aaa20e94dc8bbcd1ebfb3ad795f622a82b.png) ![CD74HC4067-2](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/2232dc53d066d310c28974736f882961b243933a.png)

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 2, 2018, 7:31am UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/11 "2018-11-02T07:31:19Z")

</div>

THANKS MAN! 🙂  
I dont have time to test it now, but will probably try it out sometime next week.

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 4, 2018, 11:21am UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/12 "2018-11-04T11:21:19Z")

</div>

WOHOOO. the multiplexing part is working! (well, only have one pot to test with -10k lin -), its working, and i can move the pot to different locations and they all work.

One question:  
I get analog value, ranging from 0-96, i actually thougth i would be getting 0-1023?

another one:  
Filtering:  
I multiply the analog in by 20, just to get a good readout with decimals, to read pot reading stability  
And at the extreme pot point (closed), i get a pretty jumpy value between 0 and 2,5. Other pot locations seem pretty solid.  
Could this be a psu thing? (running the board from my pc at the moment), maybe i need to solder in a cap somewhere between each pot output connection to the multiplexer?  
I can do filtering in XOD, in the sense that i could apply low pass filtering, but my logic tells me that this wont fix the 0-2,5 problem, only small jittery things (which is also needed). Something like a low pass filter/lag processor/slew limiter is needed for the jitter correction. How would i go about doing htis in xod?

If you have any tips/tricks, please reply here: [Pot filtering help](https://forum.xod.io/t/pot-filtering-help/1313)

I’ll keep this thread used only for multiplexer stuff (i’ll probably have other questions, once i need to de-multiplex).

thanks

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 5, 2018, 9:06pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/13 "2018-11-05T21:06:45Z")

</div>

Ok, i updated to your newest nodes. A couple of things i dont understand (and yes, its me not you;)

In the node “example 1”. If i plug the output of the 4067 common in/out to the A0 in of my arduino, i get a pot reading from 0 to 97.  
Then i tried for fun to take the common in/out and connect it to analog 1 instead, and still got a reading. This time from 0-60. and in a2 i get a reading from 0-38 and i can go on from there. Is this normal behaviour? Maybe i connected something wrong.

With a 10k lin pot connected the the4067, what is the normal max value i would get? Thanks!

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 5, 2018, 9:22pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/14 "2018-11-05T21:22:42Z")

</div>

I have a hard time understanding English, could you upload an outline of your connection?  
I do not understand if the value 0-97 is at the exit of 4067 or the reading in XOD.  
To adapt the signal you must use `map` or `map clip` node

> [@the19thbear](#):
>
> In the node “example 1”. If i plug the output of the 4067 common in/out to the A0 in of my arduino, i get a pot reading from 0 to 97.

With those nodes you can not do read write, unless you use 2 HC4067

If you are going to read, delete the `dataselect` and `4067-write` nodes

[test-4067-read.xodball](https://forum.xod.io/uploads/xod/original/1X/77054f2f137bdd027d8c2a733ba85ba8f3d68584.xodball) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [November 6, 2018, 1:31pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/15 "2018-11-06T13:31:00Z")

</div>

Thanks. I’ll look into it and write later.

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [December 25, 2018, 10:13am UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/16 "2018-12-25T10:13:03Z")

</div>

Ok. I have been working with 2 pots now, and cannot get it to read both pots.

In the “read 4067” node, from left to right, there is: IN (what is this?), INH-Out (what is this?), INH(what is this?), D,C,B,A (I know that that is). and lastly, IN0-15. Im assuming the IN0-15 is where you connect at constant value. If the value is set to 0, It will read port 0 on the 4067 and output in on VAL. And if the constant is 1, it will read port1 on the multiplexer and output that on VAL. Right?

RIght now, I have 2 pots connected to a 4067, and therefore I have 2 of your “read 4067” nodes in my patch. On has the constant value, at IN0-15 set to 0, the other has it set to 1. That way I should be able to read both pots, right?  
Right now, the pot connected to multiplexer 1, controls both values, for some reason. The one connected to inout 0 on the multiplexer does nothing.  
 ![1](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/339bcfd9fed7164f1cbf4a2b40bf22bc8f08ce31.png)

Maybe i’ll order a different 4067 and see if that tmakes a difference.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [December 25, 2018, 2:56pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/17 "2018-12-25T14:56:17Z")

</div>

> [@the19thbear](#):
>
> IN (what is this?), INH-Out (what is this?)

Hi, Here is a description and an example, I could connect N from wave-square to IN0-15, when N exceeds 15 it does a reset… [link](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/041aa2a7b89ca1fc1fc23a34706ff1cdfc827214.png)

- IN - input port A0 (it can be another)

- INH-OUT- output PORT D1(it can be another)

- INH - change out INH-OUT (True-False)

- A,B,C,D -output PORT D8,D9,D10,D11()

- IN 0-15 - is input value.(if you want to read more than 1 pot it should be variable, not constant)

> [@the19thbear](#):
>
> and therefore I have 2 of your “read 4067” nodes in my patch.

if it uses 2 nodes it will have to have 2 hc4067, and it will occupy twice as many pins

 ![4067](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/ebe889aefc9036ea705b1a9a251beb580fad7908.png)

---

<div class="post-metadata">

**Author:** ![the19thbear](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@the19thbear](https://forum.xod.io/u/the19thbear)\
**Post date:** [December 25, 2018, 3:37pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/18 "2018-12-25T15:37:57Z")

</div>

Thanks. In real life, i want to use all 16 inputs of the multiplexer. In your example, you use “if-else”. Which only can have 2 pots. What node would you use instead of “if-else” if you need 16 inputs?

Another thing: Why do i need INH-OUT port? Normally, in all examples i can find, there is no need for this port. Normally (also in the drawing you sent me earlier in this post), there are 4 digital ports connected to S0-S3, 5v and analog in. Thats all that is needed. Why the INH-OUT port?  
Sorry for asking so much, but for some reason, its hard for me to understand.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [December 25, 2018, 3:44pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/19 "2018-12-25T15:44:08Z")

</div>

> [@the19thbear](#):
>
> i want to use all 16 inputs of the multiplexer. In your example, you use “if-else”. Which only can have 2 pots. What node would you use instead of “if-else” if you need 16 inputs?

👇

> [@cesars](#):
>
> when N exceeds 15 it does a reset… [link](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/041aa2a7b89ca1fc1fc23a34706ff1cdfc827214.png)

> [@the19thbear](#):
>
> Why do i need INH-OUT port? Normally, in all examples i can find, there is no need for this port. Normally (also in the drawing you sent me earlier in this post), there are 4 digital ports connected to S0-S3, 5v and analog in. Thats all that is needed. Why the INH-OUT port?

this output connects to the EN pin (board HC4067) I’m going to change it because it confuses, sorry  
[cesars/4067](https://xod.io/libs/cesars/4067) update

as soon as I can I will update it completely …

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [December 25, 2018, 4:16pm UTC](https://forum.xod.io/t/multiplexing-with-74hc4067/1302/20 "2018-12-25T16:16:37Z")

</div>

> [@cesars](#):
>
> Why the INH-OUT port?

if on board 4067, EN is ground, in node it is not necessary.

[Next page](https://forum.xod.io/t/multiplexing-with-74hc4067/1302.md?page=2)
