23 Replies Latest reply on Dec 27, 2017 11:12 AM by cdog580

    My first electronics project, and it's a BIG one

    cdog580

      hello everyone this is my first post and i am very new at electronics. i am a lighting designer that designs and programs lights for concerts and other events. my preferred console that i use is a grand MA2 software and i have a on pc command wing. I have always found electronics fascinating and now that i have the following issue i have decided now is a perfect time to start! here is the project:

       

      i am attempting to make a replica of this fader wing extension which retail cost over $3,500 easy. for my project i need to meet the following:

       

      15 x 60mm linear slide potentiometers

      60 x cherry MX white switches

      USB type B connection to control the hardware via midi control.

       

      the things i would like to do are this:

      1) prototype and ensure that the entire system is working

      2) program a stand alone pcb mounted microcontroller to control the hardware and software interactions preferably without using a arduino or similar thought this may be selfish?

      3) have a proper PCB and Metal housing cut so that i am able to use it on actual jobs.

      my big question is this:

      what do you all recommend for me as a starting point. i can do the research on the potentiometers and the buttons thought those seem easy enough. have the microcontroller listening for the voltage of the potentiometers and for the buttons to send it 5 volts but i know there is no microcontroller that will have the whole 75 inputs i will need. do i use multiple microcontrollers? how do i hook them together? is there something i am missing in this project? thank you all for any input!

       

      ***********************

      *       UPDATE        *

      ***********************

       

      so i have discovered that there is a arduino Mega which has 50 odd connections not the full 75 i need but if there's a way to link the two and then have one USB out to the computer this may solve my issue of lack of i/o ports and dramatically reduce the complexity of this project.

        • Re: My first electronics project, and it's a BIG one
          jw0752

          Hi Chris,

          This is a quite ambitious project especially if you are going to try to design it yourself. The people who can design sophisticated systems usually go to school for it for years and spend most of their lives practicing and developing their skills. Though I have been active in electronics for over 50 years I would not attempt a design from scratch like this. On the other hand there is no rule that says you have to design it from scratch. Look and see if you can find an existing design that is open source and then try to build to those design specifications. As far as the inputs there are techniques that allow a microcontroller to expand its inputs but it is not as simple as it sounds. If I were going to attempt a project like this I would start with an existing design and then I would break it into parts that i could build and test independent of one another. Next I would hook the parts together into larger assemblies and test again. One factor that will help is that there is apt to be quite a bit of redundancy so that once you understand how to build one channel you will be able to replicate the other ones. If you do try to build this I hope you share your journey with us on the element 14 forum.

          John

          7 of 7 people found this helpful
            • Re: My first electronics project, and it's a BIG one
              cdog580

              yea i figured it was going to be a big project. making one row of them is easy enough but to make 15 sets of 5 different parts is definitely going to be a task! maybe making these into modules of 5 faders? that would only have 25 connections though again this is still a lot for a micro controller. seems like research, time, patience, and willingness to ask and learn are going to be a large part of this project. would this maybe be simplified by using something like a arduino?

               

              thanks for your help!

               

              -chris

                • Re: My first electronics project, and it's a BIG one
                  jw0752

                  The advantage of an arduino is that it will come with a self contained power support system, communication (programming) link, and it will have programming resources that are open source. Since I do not understand your application I can not speak to whether it will have the needed computational power and sped or not but probably. The Arduino Mega has a lot more inputs than the standard boards and may get you closer to your needs.

                   

                  https://store.arduino.cc/usa/arduino-mega-2560-rev3

                   

                  John

                    • Re: My first electronics project, and it's a BIG one
                      cdog580

                      basically all i am making is a rather large midi controller that send data to a computer via usb. i can map the signal that is being sent to the computer to any button on the software that i would like. i don't know if that helps. also i have found the arduino mega which has 50 something I/O s. this will let me reach the 75 i need IF they are able to be connected together so i can send all the button info through 1 usb to the computer. i am also assuming i will need a power supply of some sort inside the casing to provide power to everything including the LEDs for the buttons. so actually in theory i am going to need even more outputs because when you store data to a button it becomes brighter so i could link all leds per row in a parallel circuit but i would need outputs for them. meaning i would have to use two megas to get what i need. sorry this is me both asking a question and thinking out loud.

                      1 of 1 people found this helpful
                        • Re: My first electronics project, and it's a BIG one
                          jw0752

                          HI Chris,

                           

                          Some times the Arduinos can drive small loads like an LED directly but the best procedures are to have the Arduino drive an output stage with a transistor that in turn powers the LED or other device. You will have to determine the voltages and power requirements that are needed and then have a power source that is up to the task. The Arduino itself will run on 9 volts which it regulates down to 5 volts or 3.3 volts for actual processor and board operations. It looks like each output can source 20 mA. If all outputs were doing this you would need a supply that could deliver about 2 to 3 amps to be on the safe side. Be sure to check the detail specs on the Arduino as sometimes they will limit the number of outputs that can be sourcing simultaneously because of the danger of overheating the chip. By using external output stages the amount of current needed by the processor can be lowered and over heating is no longer a concern. If your output is just a digital one and not driving LEDs or other devices this would not be a concern.

                           

                           

                          John

                          1 of 1 people found this helpful
                          • Re: My first electronics project, and it's a BIG one
                            beacon_dave

                            You can perhaps reduce the digital IO pin count required by arranging the switches in an 8 by 8 grid. That way with 16x IO pins on the microcontroller, you can read the state of up to 64 switches.

                             

                            You could also perhaps use external shift registers to reduce the pin count required without going to multiple micro controllers. 

                             

                            Your LED's may be a bit harder though if you want to vary the brightness levels between on and off, as you are likely to want PWM enabled outputs for that (and not all digital IO is PWM enabled). Alternatively you could perhaps use pixel LED's, which would allow you to drive all 60 switch LED's from one or two IO pins.

                            1 of 1 people found this helpful
                              • Re: My first electronics project, and it's a BIG one
                                cdog580

                                Interesting thought. I could do the matrix idea to cut down on the use of pins. I may still need a mega though as there are 3 sections of 5 faders where each fader has 4 3 associated buttons. The bottom row of buttons does something different.

                                  • Re: My first electronics project, and it's a BIG one
                                    beacon_dave

                                    The Arduino Mega gives you 4x hardware USARTs as well, just in case you want to replicate the functionality of the DMX512 XLR outputs.

                                     

                                    Note that only 15 pins of the Mega 2560's IO can be assigned to PWM use to allow you to vary LED brightness. However as previously mentioned you could perhaps use pixel LEDs which have built in PWM control instead.

                                    1 of 1 people found this helpful
                                    • Re: My first electronics project, and it's a BIG one
                                      beacon_dave

                                      Just a passing thought but are the faders on the fader wing motorised (perhaps reflecting the cost) ?

                                       

                                      If so, then you will likely need an additional couple of outputs to drive an H-bridge motor controller along with an additional input for the capacitive touch sensing (although I guess the touch sense could disable the H-bridge directly if you aren't using interrupts).

                                        • Re: My first electronics project, and it's a BIG one
                                          cdog580

                                          i was thinking about putting in motorized faders but then i realized how many I/O pins i am using. the one that i am replicating does not have motorized fader, though the ones for their mainstream consoles do. the reason for the high price isn't the hardware as much as it is parameters. in order to control the light you need their hardware that contains a special handshake which allows the piece of hardware to "unlock" parameters. a parameter in the software could be something like color, pan, tilt, intensity, etc. that is where the big money comes into play. i own a command wing which already gives me 2048 parameters which is more than plenty for my application. on their lite console they have 15 faders and "executors" which are very handy to have hardware buttons to control them. that's kinda where this whole idea started was i just wanted to have physical buttons to press.

                                          their console fader wing has motorized faders but this piece of hardware is $7,600

                            • Re: My first electronics project, and it's a BIG one
                              genebren

                              Hi Chris,

                               

                              This is where you might use a multiplexer A multiplexer is switch that can set to select one of it's inputs and connect it to it's output The output of the multiplexer would attach to one of the ADC inputs of the microprocessor(most likely also using a multiplexer to route one of the inputs to an ADC The select lines for the multiplexers(yes you might need a couple of mux's will be driven from the microprocessor to make the necessary selections A suitable part might be an  74HC4051D74HC4051D which is an 8 to 1 multiplexer

                               

                              This is a pretty straight forward approach for reading several inputs with a single microprocessor.  I have used this on several projects.  The microprocessor could use a timer interrupt to manage all of the sampling of your controls (switches and pots).  The logic could be something like this:

                              • 1st interrupt - drive all mux's to input 1, set ADC to first Mux.
                              • 2nd interrupt - start ADC
                              • 3rd interrupt - read ADC, set ADC to next Mux.
                              • repeat steps 2 and 3 until all of the external Mux input 1have been read.
                              • advance external mux's to imput 2, set ADC to first Mux.
                              • repeat until all inputs have been sampled.

                              This process would run continuously sampling all of the pots and switches in the background.  Once all of the data is collected and saved in RAM, the timer routine would set a flag the would indicate to the maim program that the data is ready to be processed.

                               

                              I hope this helps!

                              Gene

                              7 of 7 people found this helpful
                                • Re: My first electronics project, and it's a BIG one
                                  cdog580

                                  time to start researching those haha i knew this was going to be a challenge but it seemed like it was just scaling a small project. might have miss-judged that a little haha. if you have any input on the reply i wrote to john i would be very appreciative of any input. thank you again for your reply!

                                   

                                  -chris

                                    • Re: My first electronics project, and it's a BIG one
                                      genebren

                                      Chris,

                                       

                                      Building your project as a series of smaller boards may also help.  By having something like 5 boards of 3 pot and 12 switches or 3 boards 5 pots and 20 switches might make the project more manageable.  These boards could be designed such that the pots and switches could mount directly to the boards (much less wiring).  The boards could either have their own microprocessors or each be controlled by an Arduino.  With a multiple board approach you would need to have a way to communicate between the boards (serial, I2C, etc) and one of the boards would have to host the USB to the PC (master, with the other boards being slaves).

                                       

                                      A couple of things to keep in mind:

                                      • Only the the pot inputs need to be read by the ADC.
                                      • The switches can be configured such that they can be read by a standard I/O pin (digital).

                                       

                                      Anything is possible, just break things down into simple steps.  Start by using breadboards, an do simple things like reading a pot, or a switch.  Only once you understand how to do each fundamental step should you begin to start laying out the bigger design.

                                       

                                      Best of luck, and enjoy the journey!

                                      Gene

                                      3 of 3 people found this helpful
                                        • Re: My first electronics project, and it's a BIG one
                                          cdog580

                                          Thank you gene for your input! Am I correct in thinking that I can use the arduino to program the microprocessor and then just remove it and mount it to the pcb? Then use ribbon cable or something to connect each pcb together. I would assume that for the main processor and the USB I could use a regular arduino for my main input.

                                            • Re: My first electronics project, and it's a BIG one
                                              genebren

                                              Chris,

                                               

                                              If you are using a microprocessor other than the Arduino, there are simpler approaches to programming.  Most microprocessors can be programmed on the board, through a simple plugin programmer (usually a 6-pin header is all that is needed).  This good to have, as it might take a bit of work to get it all working, so being able tr reprogram is a great thing. As far as the main processor, i assume that an arduino should work (I personally do not have a lot of ardunio experience).

                                               

                                              Gene

                                              2 of 2 people found this helpful
                                              • Re: My first electronics project, and it's a BIG one
                                                beacon_dave

                                                Yes indeed but you may need a few additional support components such as a crystal if not using the internal resonator.

                                                 

                                                Keep in mind that the likes of an Arduino Uno is based around the ATmega328 microcontroller with a few additional peripherals such as clock voltage regulator USB to  RS-232RS-232 interface etc Perhaps take a look at this tutorial to see how to build one on breadboard

                                                https://www.arduino.cc/en/Main/Standalone

                                                 

                                                The ATmega328 supplied in the Uno has an Arduino bootloader loaded onto it which then allows Arduino sketches to be loaded onto it via the Ardunio IDE to run you programs.

                                                 

                                                You can use an Arduino as a programmer to program stock AVR microcontrollers (which don't have the Arduino bootloader loaded). Take a look here for more information:

                                                https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

                                                 

                                                 

                                                The likes of the ATmega328 microcontroller can also be programmed outside of the Arduino IDE environment using something like Atmel Studio 7.  This also gives you access to a much wider range of microcontrollers if you want the flexibility. Take a look at some of the other microcontrollers available in the AVR family:

                                                Atmel AVR 8-bit and 32-bit Microcontrollers

                                                 

                                                The Arduino platform is however an excellent starting point for prototyping due to all the support (books, web pages, forums) that surrounds it.

                                                1 of 1 people found this helpful
                                        • Re: My first electronics project, and it's a BIG one
                                          beacon_dave

                                          You may find this book by Mike Cook of interest as it covers I/O and MIDI with the Arduino platform.

                                          https://www.apress.com/us/book/9781484217207

                                           

                                          As for large numbers of inputs, don't forget that the Atmel ATmega devices as used in the Arduino support the I2C 'two wire' interface and you can get AtoD IC's that can give you the additional expansion you need.

                                          ADS7828 12-Bit, 8-Channel SAR ADC with Internal Reference and I2C Interface | TI.com  

                                          3 of 3 people found this helpful
                                          • Re: My first electronics project, and it's a BIG one
                                            shabaz

                                            I also agree with the sentiment expressed by everyone, to start in smaller chunks. From the URL you linked, it is unclear what the protocol is over USB to the PC software. Is it USB-MIDI, or is it some proprietary protocol between the PC software and the off-the-shelf controller? Also, even if it is MIDI, the traffic would need to be examined to see precisely what information is going over that link, like what channel, instrument number, etc I'm guessing. This is if you're looking for compatibility between that software and your hardware attachment.

                                            Some prototype code should be written (it could be done before even drawing a circuit or PCB), to simulate your input from a fader, and to send the value over the USB connection, receive over the USB connection and send to the DMX connection perhaps. I didn't really understand the flow, is it that the MIDI input is on the hardware device you wish to create, then send the data to the PC via USB, which manipulates it to control a lighting channel in conjunction with the fader setting, and then sends it back to the hardware you wish to create, to output over the DMX connection?

                                            1 of 1 people found this helpful
                                              • Re: My first electronics project, and it's a BIG one
                                                cdog580

                                                the software allows you to map the midi channels to whatever i would like. It would receive and send data back to the controller over USB. what i have learned from the answers of the people above i have decided to possibly approach the project as follows: i will use 3 separate PCBs that will have 5 potentiometers and 20 cherry MX clear switches as well as a LED for each switch. i am currently working on a schematic which i will post soon. i would like to document this journey as i think eventually it may be useful to many people. i will have the PCBs hook up to a arduino mega and one other board but i haven't decided which one yet because if i use a mega i will be short by only 6 digital I/O pins for switches. maybe the ATxmega128A1U? to replace it all. the biggest challenge i see for this project is getting the single, or multiple, micro controllers to communicate properly as well as having the boards communicate with the pc over USB and actually get the midi signal channels to be correct so that in the software i can map them without too much trouble. let me know what you think about this and thank you for your input!

                                                -chris

                                              • Re: My first electronics project, and it's a BIG one
                                                e14phil

                                                Hi Chris

                                                 

                                                I have previously watched this Arduino to Midi series.

                                                https://www.youtube.com/watch?v=DXhxdsGREsU

                                                 

                                                I would suggest it as a starting point.

                                                3 of 3 people found this helpful
                                                • Re: My first electronics project, and it's a BIG one
                                                  e14phil

                                                  .. side note... An Alternative to Arduino>Midi is:   

                                                   

                                                  Arduino>HID>USB>MidiYoke>Midi

                                                  https://www.arduino.cc/en/Reference/HID .

                                                   

                                                  That way you can have multiple input devices.

                                                   

                                                  Phil  

                                                  2 of 2 people found this helpful