Arduino project with a modification

Hello, I am seeking some advice for following a project that I found online. The programming instructions are clear for the project I want to follow. However, I plan to modify what I use (just slightly) so I figured some of the more knowledgeable members here would advise me if my idea is sound. I would like to build a Jog and Shuttle controller. I am following this project that shows how to do it with parts that work within the Arduino specification. I want to modify the ATMEGA32U4 board part. The reason I want to do that is because of the housing I am choosing. It is not big enough to fit the ATMEGA32U4 that is recommended. I have found another ATMEGA32U4 board that seems to be much smaller. It has a different configuration that is front and back. I would like to be advised as to whether or not this can be used the same way to produce the physical connection of the electronics and the programming instructions by the tutorial? I also am not sure how the other (smaller) ATMEGA32U4 can be set up like the one that is recommended. I show the picture with the differences below. Could someone advise me if my idea will work? I have good understanding of working electronic parts and figure to connect a wire I can get creative. However, I want to know the part can work. Thanks

Samller board (left)
Bigger board (right)


Yes, I think this idea should be possible.

This first image shows the connections between the encoder and the pro micro:
unnamed.png
The encoder is attached to pins 15, A0, A1, A2, A3. But this is for convenience of soldering, not because of any special functions that those particular pins happen to have.

Here is the board you want to use:
s-l400 (26).jpg
The pins used in the original project are not all available and not in the same positions, so you will have to use other pins and connect them to the encoder with short flexible wires. You will need to do some minor amendments to the sketch based on the pins you choose.

How will you connect the usb cable to the pc in your project?

unnamed.png

s-l400 (26).jpg

Like most instructables this one is very poor in terms of electronic design. Using digital pins as a power source is a very bad idea. He seems to have done this because he can’t be bothered to wire it up correctly.

Yes you can use the smaller board, but you will have to add a USB connector to it which might prove mechanically tricky. Forget powering the rotary encoder with digital pins and wire them direct to the two power connectors. You can make things even smaller by cutting off the front of that PCB that is supposed to act as a USB connector.

PS. +1 Karma for posting clickable links correctly, and embedding images into your post instead of only attaching them, on your first post.

PaulRB:
How will you connect the usb cable to the pc in your project?

Yes, your idea will work.
I would think you could remove an old USB cable from a mouse or keyboard, drill a hole in the base and feed the USB cable into the device.
The link shows the maker had made the housing and then left an opening so a USB cable could be attached to the board.

You could cut an opening in your housing and then hot glue your board. Personally, I am not a big fan of PCB USB connections for long term use.

As was noted by PaulRB about the code, you will need to make some adjustments. The maker used analog pins, but it seems you could use any pins. Just a matter of changing pin numbers in your code.

Once you got this working, you have to tell us how you like it.

Hi @PaulRB @Grumpy_Mike @dave-in-nj, thank you so much for the responses, they are super helpful.

PaulRB:
The pins used in the original project are not all available and not in the same positions, so you will have to use other pins and connect them to the encoder with short flexible wires. You will need to do some minor amendments to the sketch based on the pins you choose.

I guess this means that I can solder a short wire to between any pin to the encoder as long as I change them in the sketch? This is the part I am the most unsure about. Could you explain why it does not matter which pin?. I thought each pin should have a route through the logic board and be specific to the nature of there job. I did not know the pins were so interchangeable.

Grumpy_Mike:
Yes you can use the smaller board, but you will have to add a USB connector to it which might prove mechanically tricky.

I am very savvy with soldering and using tools like a Dremel. My plan is cut some of the front of the board off, and then drill very small holes into the USB copper to accept my wire from the cable I will directly connect. This cable has a strain relief that works well with the housing I am using.

dave-in-nj:
You could cut an opening in your housing and then hot glue your board. Personally, I am not a big fan of PCB USB connections for long term use.

My housing already is optimum because it was a USB controller originally. Do you mean that PCB USB connections burn out?
Once again thank you all :slight_smile:

pctechtv:
I am very savvy with soldering and using tools like a Dremel. My plan is cut some of the front of the board off, and then drill very small holes into the USB copper to accept my wire from the cable I will directly connect. This cable has a strain relief that works well with the housing I am using.

Not sure about drilling holes, the back side of the board appears to have a full ground plane, so you would have to relieve that around the holes. I would just leave enough of the USB connector on the top side of the board to solder the wires directly to it, and mount the board and cable solidly together so that vibration would not strain the connections.

david_2018:
Not sure about drilling holes,

OK, that sounds like some good advice. Thank you @david_2018 :slight_smile:

I would also like to add I don't have any experience with Ardunio. I am more than sure that the advice to use any pin that I received above is accurate. So, I would feel better is someone could say use pin??, pin??, pin??, pin??, and pin?? so I will know that I am not causing an error with a bad configuration. Thanks

As Mike suggested, connect the + and GND pins on the encoder to 5V and GND on the Arduino. The other 3 pins, you really do have almost any choice you like. Some Arduino pins do have special functions, but the encoder only needs to be connected to ordinary digital inputs, which is a function almost any/every pin can perform.

pctechtv:

You could cut an opening in your housing and then hot glue your board. Personally, I am not a big fan of PCB USB connections for long term use.

My housing already is optimum because it was a USB controller originally. Do you mean that PCB USB connections burn out?
Once again thank you all :slight_smile:

the Digilspark has copper traces on the board and no actual USB housing.
the idea is to just plug the Digispark into the USB port to program.
My personal preference is that a 'real' ie: manufactured USB connector is better than just a PCB with traces.
if you cut off part of the end and drill holes and or solder wires, then you would make a better connection for a permanent USB use.

dave-in-nj:
the Digilspark has...

Its not a Digispark, they are based on attiny mcus. This is based on atmega32u4, so similar to Pro Micro.

pctechtv:
Could you explain why it does not matter which pin?. I thought each pin should have a route through the logic board and be specific to the nature of there job. I did not know the pins were so interchangeable.

Welcome to the forum.
Can you tell us your electronics, programming, arduino, hardware experience?

It appears you may have a misunderstanding of how programmable microcontrollers work.

Have you programmed any code yet and got familiar with the programming environment?

Thanks.. Tom.. :slight_smile:

PaulRB:
Its not a Digispark, they are based on attiny mcus. This is based on atmega32u4, so similar to Pro Micro.

I stand corrected. the form is similar to the DigiSpark.

Now I have come to a point in this project where I need to make another modification. I realize that my housing cannot fit the encoder with the breakout board. I want to use one without the breakout board. However, the information I am finding online makes me think I will need some more electronics added to the new type of encoder. The diagram I have found seems to explain how the elections should be built on the encoder without the breakout board. I will wait for someone more experienced with this and Arduino to advise is my thinking correct. Thanks

I don't think this will be a problem. Often, the PCB that is supplied with such modules does not contain any electronics necessary to adapt the component for use with Arduino. What the PCB does is provide a physical adaptation between the component (in this case a rotary encoder) and some means to connect it to a breadboard or to an Uno/Mega using Dupont cables.

Please post a link to your encoder so we can check this, but I suspect all you need to do is buy a bare encoder or unsolder the encoder from the PCB and solder new wires to the Arduino.

There may be 2 or 3 pull-up resistors on the PCB, but these can be dispensed with by using the Arduino's INPUT_PULLUP feature instead.

I read on site that the EC11 encoder I am using does not need to connect the 5v connector. I followed this and It is the first time I have seen it do anything but show a steady red light. Now the light stays on but when using the encoder it flashes another light. However, it seems to be sending a key like an up(arrow) everywhere all the time. I put the cursor in the Arduino code it just moves very fast to the end, I cannot even type. In other programs, it is doing the same thing.

In post#3 I gave you a karma point. If I could take it away again I would be doing that now. Read the forum guide in the sticky post, modify your post post and correct it.

Where did you get this code? Reading it, I can see why it behaves as you describe. I don't think the author knows what they are doing. They certainly don't understand how encoders work at all.

PaulRB:
In post#3 I gave you a karma point. If I could take it away again I would be doing that now. Read the forum guide in the sticky post, modify your post post and correct it.

Hi, could you be more clear on what you mean? What specifically I have done that is not in good etiquette with the forum rules. Was it the long code posted? I would like to be a good member, and by all means, don't want to upset any members with what I do, or do not know. Thanks

Edited: I should also add that after seeing this forum, I am very interested in being a member. The help that I received from you and the other is impressive, to say the least. As for my project, I think I was in quest of finding a quick solution to something I want to do on the computer. "quick" I tend to know is not always the best idea with computers and electronics. Now I am interested in being an active member of this forum because I am more interested in Arduino after seeing the full scope of what is possible with this project. I currently know nothing about Arduino. I plan on learning about Arduino the correct way and getting the fundamentals first. So please let me know what is wrong so I can correct it. Thanks