Skip to main content

Reply to "Recommendation for a Potentiometer with Stops (Detents)"

After some experimentation, this is what I've learned.

First, the CD4026BE does a good job at driving the seven segment displays that I have. I used a low value resistor (22 ohms) on the common cathode of the display and that produces a nice bright output. I attached the detent pot (over a 6 foot cable) to an Arduino Mega 2560 and the input from that is sent via clock pulses to the display. Checking the pot every 100ms gives a good response on the display as the pot is rotated from one position to another.

However, with only the clock to the 4026 connected to the Arduino, if the display got out of sync, there was no way to program it back to a known state. It would roll up and down in response to the potentiometer movements but the value was wrong. So I added a second connection to the RESET input of the 4026 and changed the display code to use it quite a bit (to generate fewer clock pulses to affect a change). And that worked perfectly. But now it used 2 connections for the one digit display.

How did it get out of sync? Just by modifying the program and downloading the Arduino code would start it up with the wrong digit. I found that if I rotated the pot so that the display showed zero and then hit the reset button on the Arduino, it would go back to the correct value. But that's not an acceptable way to operate.

I did not try the power on reset technique that Stan mentioned earlier. That may have helped with this situation. Instead, I decided to move on to the shift register approach which makes more sense in this case where there are really 3 digits involved.

So I got some CD74AC164E chips and set up 3 of them on a separate breadboard each feeding the display digits. Wow! Two connections to the CLOCK and DATA inputs of the shift register and a new class for the Arduino code base was all it took to convince me that this was how this should be done. I added hexadecimal digits to the seven segment display table of values to push to the shift registers and controls for decimal points and blank displays. Everything works great! And the whole thing is tied to the Arduino over an 8 foot cable.

There is no noticeable intermittent flashing of the displays at all no matter what I try to make it do. I've had the one digit display flashing on and off at a 200ms interval while the two digit display counts down in hexadecimal every second  without any problems. Nice!

Using just 2 Arduino pins for 3 digits with some distance is what I was after. The shift register approach is flawless. So the control box is now Power and Ground plus 2 pins for the displays then 2 analog inputs for the pots. That's 6 wires so far. Now the switches and button. It's odd that I found some cable in the basement that has 7 conductors. Keep your fingers crossed!

Attachments

Images (1)
  • mceclip0

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×