<div dir="ltr">Hi Paul<div>A bit more information about analog selector ICs such as the 4051. The big brother of the 4051 is a 4067 (such as a 74HC4067) which is a 16 channel multiplexer (i.e. an analog selector). This is used on the Sparkfun BOB-09056 breakout board, available through Mouser or Digikey, etc for under $10. This allows 1 Arduino analog input pin to read 16 different analog signals, but as it doesn't care whether the Arduino pin is being used for analog or digital input, it can also be used to read up to 16 digital inputs (e.g. from switches). It requires 4 output signals from the Arduino to select which of the 16 inputs to read.</div><div>For those not familiar with using selectors, it might seem that this isn't enough to allow the Arduino to read the multiple switches and analog input in Paul's project, as it still only reduces 16 pins down to 5. However you can use multiple selector ICs in several ways to achieve the desired result. The simplest expansion is to use several selector ICs on different analog input pins of the Arduino, but use the same 4 digital output pins to drive the different selector ICs, i.e. parallel up all of the Select0 pins and drive from one Arduino pin, parallel all the Select1 pins and drive from the second Arduino pin, etc. The Arduino software can set up the selection, wait a moment and then read several analog inputs, change the selection and wait again, then read the next set of analog inputs, etc.</div><div>For bigger systems, one selector IC can be used to select between the common output terminals of several other selector ICs, so one analog input of the Arduino can read 32, 48, 64,... analog inputs using 2+1, 3+1, 4+1, 5+1... etc selector ICs. However the master selector IC's select inputs need to be driven from different Arduino digital output pins than the individual selector ICs. The disadvantage of this approach is that the settling time is greater, as the resistance of two CMOS switches is in series, and this also makes the system a bit more vulnerable to noise pickup. Scanning is also slower as the software needs to wait the increased settling time when changing any of the selector lines.</div><div>For critical, high speed or high precision analog inputs (such as the joystick position measurements perhaps), I would recommend either a direct connection to a dedicated Arduino input or the use of an I2C ADC board, but the multiplexers are fine for the less critical stuff like monitoring the rotary switches.</div><div>There are digital versions of the selector ICs, such as the 74HC151, and the select inputs of these can be driven from the same outputs as the select inputs of the 4051 or 4067. Although the digital ICs cannot be used for analog readings, they are faster and less vulnerable to noise when reading digital inputs. However I am not aware of any commercially available breakout boards for these ICs.</div><div>I hope this helps, (or at least educates).</div><div>Trevor</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 19, 2018 at 12:16 PM, Trevor Wignall <span dir="ltr"><<a href="mailto:zl3adz@gmail.com" target="_blank">zl3adz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Paul<div><br></div><div>I see from the diagram that you plan on using SX1509 I2C I-O modules - 20 of them. Be aware that the I2C addressing for these modules only allows 4 of them on the same I2C bus. If you are prepared to bit-bash the I2C, then the same Arduino board can support more than one I2C bus, or it may be possible to incorporate an I2C switch.<div><br><div>The diagram lists 25 pots and 15 rotary encoders. I am not quite sure what you mean by a rotary encoder, but if this is implemented with a resistor divider network, that would mean a total of 40 analog inputs. The SX1509 does not appear to support analog inputs but the Arduino itself does, although not 40 of them. 4051 or similar selector ICs can be used to allow one or a few of the analog inputs of the Arduino to be used to read 40 or more analog signals.</div></div><div><br></div><div>The diagram also lists 80 push button switches. Are these momentary switches or push-on push-off switches, i.e. do they stay on? A switch matrix using momentary switches can be quite simple if it doesn't have to cope with more than two switches being closed simultaneously, but if three or more switches can be closed at the same time, then diodes are needed to prevent phantom switch presses - a switch appearing to be closed when it is actually open but other switches on the same row and column are closed.</div><div><br></div><div>Thanks for sharing with us.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Trevor</div><div><br></div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 19, 2018 at 11:47 AM, Paul Sharp <span dir="ltr"><<a href="mailto:paulsharp360@gmail.com" target="_blank">paulsharp360@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Trevor,<div><br></div><div>Thank you for your interest.</div><div><br></div><div>Here is what I have just put together <a href="https://docs.google.com/drawings/d/1f8SLsSIm2VDcym7C_tvF0J3xjTBrV1xGKGb4beIdqfM/edit?usp=sharing" target="_blank">here</a>. I am sorry it doesn't address your questions specifically as I am not sure of how to answer at this stage.</div><div><br></div><div>Cheers</div><span class="m_8635246053832376104HOEnZb"><font color="#888888"><div>Paul</div><div><br></div><div><br></div></font></span></div><div class="m_8635246053832376104HOEnZb"><div class="m_8635246053832376104h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, 17 May 2018 at 22:29, Trevor Wignall <<a href="mailto:zl3adz@gmail.com" target="_blank">zl3adz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Paul<div>I saw some push button switches with built-in lights on your display. Presumably these will also need to be driven from the computer. Could you tell us the voltage and current of these lights and how many lights need to be driven in total? Also are there any 7-segment displays or similar? I ask because in some ways having a lot of outputs is harder to achieve than a lot of inputs.</div><div>Cheers</div><div>Trevor</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 17, 2018 at 11:32 AM, Paul Sharp <span dir="ltr"><<a href="mailto:paulsharp360@gmail.com" target="_blank">paulsharp360@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear All,<div><br></div><div>Thank you for showing an interest in my project. It is very much appreciated. I am trying to get up to speed with electronics [beyond beginner] as quick as my time allows (I am reading your comment, researching your comment, reading my recently purchased electronics book etc, then reading your comments again).</div><div><br></div><div>For those of you who are interested in the project; here is my google plus page <a href="https://plus.google.com/u/1/collection/Mra5TE?pageId=none" target="_blank">here</a></div><div><br></div><div>Thanks again for all the support.</div><div><br></div><div>Cheers</div><div>Paul.</div></div><div class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286HOEnZb"><div class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, 16 May 2018 at 19:31, Mark Atherton <<a href="mailto:markaren1@xtra.co.nz" target="_blank">markaren1@xtra.co.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-cite-prefix">OK, before you pile in, he is using I2C
on a VGA port. Very cool idea.<br>
<br>
-mark<br>
<br>
On 16/05/2018 7:27 PM, Mark Atherton wrote:<br>
</div>
<blockquote type="cite">
<p>Synco,</p>
<p>Still not sure how X-plane connects to the I2C devices - maybe
a USB to I2C bridge, or are you bringing the SMB bus directly
off of the motherboard ?</p>
<p>-Mark</p>
<p>-----------------<br>
</p>
<p>Couple of our messages have been corrupted, here is Synco's
earlier reply to me</p>
<p>-----------------</p>
<p><span>Wed May 16 00:33:27 2018</span> </p>
<p>Hi Mark+,<span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline!important;float:none"></span><br>
I've written a few plug-ins for X-Plane, rather than use the UDP
protocol, yet by next meeting that'll most likely have changed
and will be happy to share. If each panel was to be stand-alone,
from all the different I2C port expanders out there, it's likely
you would have spare I/O that would avoid multiplexing /
scanning tricks. Also, if you are running Linux, and don't want
to use a Raspberry Pi, another option is to use the I2C adapter
on your monitor connector. I've done this in the past, (and will
again), yet be careful to ensure voltage levels and device
addresses don't conflict !<br>
</p>
<p>For example here is what it looks like on my pc:<br>
$ sudo apt install i2c-tools<br>
$ i2cdetect -l<br>
i2c-3 unknown NVIDIA i2c adapter 7 at 1:00.0 N/A<br>
i2c-1 unknown NVIDIA i2c adapter 4 at 1:00.0 N/A<br>
i2c-4 unknown NVIDIA i2c adapter 8 at 1:00.0 N/A<br>
i2c-2 unknown NVIDIA i2c adapter 6 at 1:00.0 N/A<br>
i2c-0 unknown NVIDIA i2c adapter 2 at 1:00.0 N/A<br>
<br>
$ sudo i2cdetect -y 0<br>
0 1 2 3 4 5 6 7 8 9 a b c d e f<br>
00: -- -- -- -- -- -- -- -- -- -- -- -- --<br>
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
70: -- -- -- -- -- -- -- --<br>
<br>
$ sudo i2cdetect -y 4<br>
0 1 2 3 4 5 6 7 8 9 a b c d e f<br>
00: -- -- -- -- -- -- -- -- -- -- -- -- --<br>
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
30: -- -- -- -- -- -- -- 37 -- -- 3a -- -- -- -- --<br>
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- --<br>
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --<br>
70: -- -- -- -- -- -- -- --<br>
<br>
And if you run out of addresses you can always add a i2c-i2c
bridge: <a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-freetext" href="https://www.aliexpress.com/item/TCA9543A-Low-Voltage-2-Channel-I2C-Bus-Switch-Interrupt-Logic-And-Reset-Module/32763291440.html" target="_blank">https://www.aliexpress.com/ite<wbr>m/TCA9543A-Low-Voltage-2-Chann<wbr>el-I2C-Bus-Switch-Interrupt-<wbr>Logic-And-Reset-Module/<wbr>32763291440.html</a><br>
<br>
/s<br>
<br>
On 15 May 2018 at 22:01, Mark Atherton <a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-rfc2396E" href="mailto:markaren1@xtra.co.nz" target="_blank"><markaren1@xtra.co.nz></a>
wrote:<br>
<br>
> Hey Synco,<br>
><br>
> Any chance of a quick tutorial how X-Plane processes
incoming UDP packets, and assigns associated bytes/bit-positions
to each function.<br>
><br>
> Getting some kind of spec. from Paul (or help write one)
would be very useful to determine cable loom lengths, number of
inputs, types etc. For each control: Push Button, On/Off, Rotary
(number of positions) ,or Potentiometer (and resolution), and
max scan time.<br>
><br>
> He may have been using a 4 position switch with 4 wires,
when it may actually be an encoded 2-bit problem. Not sure if
full size, low cost rotary binary outputs switches are readily
available - hex coded switches are obviously too small... There
was mention of an R-2R ladder on the switch and an ADC - this
seems a bit over the top (?). How about using a 1 of 4 rotary
switch, and a small diode matrix (4 diodes + 4 pull down
resistors) to encode to binary - there are obviously larger
bit-savings with 8 and 10 positions switches.<br>
><br>
> Not personally a fan of carrying I2C any great distance due
to noise immunity issues (or lack thereof), but screened twin
cable (and associated unwanted capacitance) with low clock rate
(10kHz ?) and careful grounding may be OK though.<br>
><br>
> R-PI seems over the top to convert bits into UDP, but I
guess they are readily available, well supported, and low cost,
so why the hell not...<br>
<br>
</p>
<br>
<fieldset class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
Chchrobotics mailing list <a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-abbreviated" href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.co<wbr>m</a>
<a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-freetext" href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">https://lists.ourshack.com/mai<wbr>lman/listinfo/chchrobotics</a>
Mail Archives: <a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-freetext" href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipe<wbr>rmail/chchrobotics/</a>
Meetings usually 3rd Monday each month. See <a class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441m_7975190749022677647moz-txt-link-freetext" href="http://kiwibots.org" target="_blank">http://kiwibots.org</a> for venue, directions and dates.
When replying, please edit your Subject line to reflect new subjects.</pre>
</blockquote>
<p><br>
</p>
</div>
______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.co<wbr>m</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mai<wbr>lman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipe<wbr>rmail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.</blockquote></div><br clear="all"><div><br></div></div></div><span class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286HOEnZb"><font color="#888888">-- <br><div dir="ltr" class="m_8635246053832376104m_5093087379774657021m_-2328589030601773286m_-8772966284341754441gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Paul<div>0292 360 360</div></div></div>
</font></span><br>______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.co<wbr>m</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mai<wbr>lman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipe<wbr>rmail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.<br></blockquote></div><br></div>
______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.co<wbr>m</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mai<wbr>lman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipe<wbr>rmail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_8635246053832376104m_5093087379774657021gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Paul<div>0292 360 360</div></div></div>
</div></div><br>______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.co<wbr>m</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mai<wbr>lman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipe<wbr>rmail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>