Hi everyone,
I haven't bought a rasbperry pi yet, nor the toggle switches.
I'm trying to connect 7 or 8 toggle switches (SPST) to a raspberry pi, all of which could be read in individually to amount to 128 to 256 different combinations.
Photos will be stored on either a micro SD card or USB and based on the combination, a picture will be displayed on a HDMI connected screen.
My questions are the following:
- Can I do this with a Raspberry Pi 1 Model A+?
- Do I need to look for anything specific when buying toggle switches?
- What other materials do I need to connect the toggle switches? / Can I do it without a board and have them all connected through wires?
Anything would help. I genuenly don't know what I'm doing.
Thanks everyone!
Re: Connect multiple toggle switches to a raspberry pi
Fundamentally, yes. We can fill in the details later.
Hmm. What can I put here?
Re: Connect multiple toggle switches to a raspberry pi
What ame said, but is there any particular reason you want to use such an old model?
E8 85 A2 40 C9 40 81 94 40 81 95 40 89 84 89 96 A3
Still NF Shirls
Still NF Shirls
Re: Connect multiple toggle switches to a raspberry pi
Reasons to go with an A+ that I can think of are you already have one (not the case here) or size, power consumption and cost, but I think Pi Zero is better choice on all those fronts.
It could be worth looking at rotary BCD switches as a simpler way to select big numbers from few inputs.
Maybe something like this
https://uk.rs-online.com/web/p/pushwhee ... 4b92a59cf7
Two of those to 8 gpio for 0 to 99 with two switches.
Add another for higher range.
I think you could multiplex these with one output per switch and four inputs to read all switches. May need some diodes as well.
So 11 gpio for 3 BCD switches giving up to 999 values.
Unless you really like using binary.
It could be worth looking at rotary BCD switches as a simpler way to select big numbers from few inputs.
Maybe something like this
https://uk.rs-online.com/web/p/pushwhee ... 4b92a59cf7
Two of those to 8 gpio for 0 to 99 with two switches.
Add another for higher range.
I think you could multiplex these with one output per switch and four inputs to read all switches. May need some diodes as well.
So 11 gpio for 3 BCD switches giving up to 999 values.
Unless you really like using binary.
Last edited by PiGraham on Wed Nov 30, 2022 9:55 am, edited 1 time in total.
Re: Connect multiple toggle switches to a raspberry pi
Another approach could be to display the election value on a display and have a few setting buttons. One button to select the digit and another to increment the digit could be sufficient. This would work especially well if you mainly want to increment the value. Default to LSD and just press one increment button to progress all images.
You could quickly access any photo from 1000 with no more than 3 x 9 button pushes.
Add a third button to cerement selected digit and get max 3 x 5 pushes
If you overlay the selection number on the HDMI you don't need a separate display for selection. Just show the ID briefly onscreen as it changes.
You could quickly access any photo from 1000 with no more than 3 x 9 button pushes.
Add a third button to cerement selected digit and get max 3 x 5 pushes
If you overlay the selection number on the HDMI you don't need a separate display for selection. Just show the ID briefly onscreen as it changes.
Re: Connect multiple toggle switches to a raspberry pi
Hi, no particular reason. I just wanted something that had input/output pins that would allow me to connect 7-8 toggle switches, an SD or micro SD card, USB drive and HDMI cord for the display. That's all I need. Would you reccomend a different model?
Re: Connect multiple toggle switches to a raspberry pi
Thanks for the suggestions. I'm attached to the idea of toggle switches as I'm trying to make almost an art installation. I'm going for the toggle switch experiencePiGraham wrote: ↑Wed Nov 30, 2022 9:36 amReasons to go with an A+ that I can think of are you already have one (not the case here) or size, power consumption and cost, but I think Pi Zero is better choice on all those fronts.
It could be worth looking at rotary BCD switches as a simpler way to select big numbers from few inputs.
Maybe something like this
https://uk.rs-online.com/web/p/pushwhee ... 4b92a59cf7
Two of those to 8 gpio for 0 to 99 with two switches.
Add another for higher range.
I think you could multiplex these with one output per switch and four inputs to read all switches. May need some diodes as well.
So 11 gpio for 3 BCD switches giving up to 999 values.
Unless you really like using binary.
Re: Connect multiple toggle switches to a raspberry pi
Hi. Thanks for the reply. I would like to connect a diplay that would display a photo not just an ID. As far as the input. I'm attached to the toggle switch concept as part of the experience. Is this doable with a raspberry pi?PiGraham wrote: ↑Wed Nov 30, 2022 9:53 amAnother approach could be to display the election value on a display and have a few setting buttons. One button to select the digit and another to increment the digit could be sufficient. This would work especially well if you mainly want to increment the value. Default to LSD and just press one increment button to progress all images.
You could quickly access any photo from 1000 with no more than 3 x 9 button pushes.
Add a third button to cerement selected digit and get max 3 x 5 pushes
If you overlay the selection number on the HDMI you don't need a separate display for selection. Just show the ID briefly onscreen as it changes.
Re: Connect multiple toggle switches to a raspberry pi
Hi ame. Thanks for the reply.
- Anything specific I'd need to look for when it comes to toggle switches?
- How do they connect to the raspberry pi (I'd like to avoid using a breadboard) for individually parsed input?
Thanks!
Re: Connect multiple toggle switches to a raspberry pi
Any model Pi can do what you want, but if you may in the future repurpose it for another project then look at the 4 series. The zero series will require a hub if you want keyboard/mouse & USB drive connected simultaneously.
Just be aware of the chip crisis and the difficulty of obtaining a Pi.
E8 85 A2 40 C9 40 81 94 40 81 95 40 89 84 89 96 A3
Still NF Shirls
Still NF Shirls
Re: Connect multiple toggle switches to a raspberry pi
Nope. Any toggle switch will do. Pick something you like the look of.
Next, get some DuPont connectors. You will need 9 pieces of wire for your 8 switches, with female DuPonts on one end. Connect all the centre pins of the switches together then connect a DuPont wire to that, which will plug into GND on the Pi. Next, connect the other 8 DuPont wires to the switch outputs and plug them into 8 GPIO pins on the Pi (doesn't matter which ones, but choose 8 pins that aren't used for other functions).
In your code, configure the 8 GPIO pins as inputs with pull-ups turned on. Done!
If you want to avoid soldering you can choose toggle switches with screw terminals.
Hmm. What can I put here?
Re: Connect multiple toggle switches to a raspberry pi
The point is you can show a photo and other info. That info can be shown temporarily, maybe fade in & fade out in seconds.techbro2 wrote: ↑Wed Nov 30, 2022 4:50 pmHi. Thanks for the reply. I would like to connect a diplay that would display a photo not just an ID. As far as the input. I'm attached to the toggle switch concept as part of the experience. Is this doable with a raspberry pi?PiGraham wrote: ↑Wed Nov 30, 2022 9:53 amAnother approach could be to display the election value on a display and have a few setting buttons. One button to select the digit and another to increment the digit could be sufficient. This would work especially well if you mainly want to increment the value. Default to LSD and just press one increment button to progress all images.
You could quickly access any photo from 1000 with no more than 3 x 9 button pushes.
Add a third button to cerement selected digit and get max 3 x 5 pushes
If you overlay the selection number on the HDMI you don't need a separate display for selection. Just show the ID briefly onscreen as it changes.
It will probably be useful to confirm the ID of the photo.
You can just have binary on toggle switches, of course. The switch state is an info display of a sort.