Open greppp opened 1 year ago
Thanks for your kind words.
I'm not sure to understand, what do you mean by encoder? What is the use case?
Hi @pirateradiohack !
This video explains what a rotary encoder is : https://www.youtube.com/watch?v=v4BbSzJ-hz4
An image :
A rotary encoder like a potentiometer, except it goes further than 360 degrees, allowing to scroll infinitely. They can have built-in clicks (or increments) which gives you a physical feedback when you turn the knob. It can be also seen as a digital version of a potentiometer, as there is no analog reading.
Regarding the use case: for the volume it might sound less interesting as a potentiometer can do the job. But for selecting a radio station (by rotating the knob), it is quite nice : when you turn the knob, every time it clicks it selects the next radio station.
I am interested by this as I want to implement it in an existing vintage radio and be able to use the "TUNING" knob, instead of adding buttons. You could add the feature that once you reach the end of the list, if you turn one more step it selects back station 1, by going to the start of the lsit again. Implementing the "TUNING" knob fonction with a regular potentiometer might be more complicated, i think.
Let me know what you think, and thanks for getting back to me!
Thanks @greppp for clarifying. Good, I now understand what you mean by encoder. Indeed I know what they are, I just did not get what you meant.
Well, my initial goal is to have a limited set of hardware to produce a radio set and support this specific list of hardware through software. Although the hardware can and is definitely changing over time, I want to cover this specific list of hardware. I don't want this project to become a universal support for all types of radios.
And on top of that, the GPIOs are physically limited so I have to focus on the scope of the project.
Now with that out of the way, I also installed this project on a vintage radio and have added support for a potentiometer. I do it through the use of RasPIO analog Zero and GPIO zero in Python.
So I could be ok to have this support in the code as long as it does not break anything else and maintenance is easy. Meaning if it's just a matter of adding the same kind of support through GPIO zero then I would be ok to have it in the code.
And it appears that GPIO zero has support for rotary encoders: https://gpiozero.readthedocs.io/en/stable/api_input.html#rotaryencoder
Right now I do not have a rotary encoder and do not plan to add one. So I see 2 possibilities:
Regarding the function you are talking about, it's just switching to the next or previous radio. This is already implemented in the code and is currently attached to the previous and next buttons. It is just a matter of attaching it also to a rotary encoder (although I can't guaranty it will work as is, some tinkering may be necessary).
Conclusion: I do not want to look like I will accept to add support for any and all hardware but this one seems quite easy to add and is in line with what already exists so I think it should be possible.
Just let me know what you can do on your end (add the code? test the hardware?) and I will organize that. Now I understand you need support for Rapsberry Pi Zero 2 W before you can run the project, is that right? Adding support for this platform is on the way but not here yet. If you can test it on the current version of the project for the Pi Zero W 1 then we could do this quickly.
Hi @pirateradiohack
I can happily test the hardware, as I am not a coder. I have general notions of electronics and microcontrollers, and can have a glimpse at some code but I do not code myself. For reference, here are the rotary encoders I purchased : https://www.aliexpress.com/item/1005002730580614.html
Yes my own setup is Raspberry Pi Zero 2 W, I do not have a Pi Zero W 1 (although I have a Pi Zero 1, but not the W version)
I also do not dislike the idea of a potentiometer, it has the advantage of, by it's physical nature, remembering its last setting when you turn the radio back ON, like an old analog radio. When you turn it back on, it is at the same volume, same station, than when you last used it. I wonder though, how it would be done in the code, for switching in between stations with a potentiometer. If you program only two stations, maybe the code automatically divides the taper area in two, and if you have ten stations, in ten?
My main wish behind this is to re-use an existing radio and their knobs, and it does not matter much if it is a potentiometer or an encoder (for volume and station select).
Hi,
First thank you for this amazing project!
I was wondering how hard it would be to be able to have an encoder for the volume, and one for previous/next station?
Have a great day