• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using keypad one wire library and rotary encoder

Not open for further replies.
I was wondering if anyone had had any experience using the keypad one wire library and a rotary encoder? I am trying to implement such a scheme in a dual tracking power supply design in one of my projects.They would be used to change a pwm signal which would control the output voltage and current.Mega accuracy is not a fundamental criteria in my design, only to learn something on how you would go about interfacing ,the two devices in order to control the same thing in essence.I have built linear power supplies before with success but knowledge of digital control would be of great benefit to me presently.The microcontroller to be used may be an atmega 328p as in a stand alone arduino design or a pic microcontroller.The basic principles would be the same I am assuming?


Well-Known Member
Most Helpful Member
Which one wire device are you looking to use? I'm not familiar with one for a keyboard.

This was one link I found on YouTube

The original idea came from a link on pin interest ,from brainy bits.com which did have a YouTube video associated with it.
After searching you tube for it,now cannot find original video or link to it .Typical !! I am sure that a hackaday article on this subject,mentions the brainy bits tutorial and has a link to GitHub,with the library required for this circuit,to be used with an arduino.
The idea is simple by using a voltage divider network,a 4 x 4 keypad can be connected and the output fed,into an arduino or any adc input of a microcontroller.This only uses one wire and therefore saves pins There is a library file associated with this if using the arduino.


Active Member
Using an analog input to sense many different pushbuttons/keys appears in an early publication from Microchip, Microcontroller Tips 'n Tricks.
Refer to tips #5, 6 and 7.
They don't give any code examples for these, but it should be straightforward, just a series of comparisons.

It looks like the document has been expanded since I last downloaded it.
Rotary encoder and keypad control of pwm,has anyone implemented this and how can it be done either with an avr or pic ?
I would even consider using an arduino.


Well-Known Member
I dont see any rotary encoder in your video, rotary encoder look like dials with holes in them.
neither do i see any 1-wire devices, this is the name for a communication protocol.

In your video i see you using an "analog pin" to read the values of a voltage divider network. which is done by the "read analog" function, googling this will get you better hits for code examples.
Not open for further replies.

Latest threads

EE World Online Articles