Go Down

Topic: Newbie, how to select between sensors to output (Read 250 times) previous topic - next topic

ricecult

Just have been getting the basics of working Arduino down (I'm new to coding and electronics in general), so I know this is possible, but I haven't seen anything that addresses this directly.

The goal is to be able to select between multiple sensors that will go to a single output. I'm not sure exactly what makes most sense to use, I was originally thinking of a rotary encoder, but it might even make more sense to use a button that cycles through the options each time it is pushed.

Just to make it clear, let's say I have analog inputs 0,1,2,3, I want to be able to select which one (using a button or another device) is being sent to analog output 4. I'm lost in terms of coding this, as well as what approach will be most straightforward.

I'm also curious if anyone has a suggestion concerning sending +5 to multiple sensors, I think for this project I can use a solderable breadboard, but I don't know if that would lead to any unforeseen problems.

Paul_KD7HB

I think you have a ways to go with your project. Sensors sense something and send the information to your Arduino, not the other way around.

Paul

Nick_Pyner

Just to make it clear, let's say I have analog inputs 0,1,2,3, I want to be able to select which one (using a button or another device) is being sent to analog output 4.
It is not likely that you would ever want to do that but, if you had to do it with Arduino, it would/could simply be by software - no button required. A four-way rotary switch would make far more sense - no Arduino.

If you want to use an Arduino sensibly, you might poll analogue pins 0,1,2,3 and send send digital data thereby aquired to a display device, internet, or whatever.

TomGeorge

#3
Aug 11, 2018, 08:49 am Last Edit: Aug 11, 2018, 08:52 am by TomGeorge
Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html.

The goal is to be able to select between multiple sensors that will go to a single output. I'm not sure exactly what makes most sense to use, I was originally thinking of a rotary encoder, but it might even make more sense to use a button that cycles through the options each time it is pushed.

Just to make it clear, let's say I have analog inputs 0,1,2,3, I want to be able to select which one (using a button or another device) is being sent to analog output 4. I'm lost in terms of coding this, as well as what approach will be most straightforward.
From what I gather you want to make a selector switch using the Arduino.
5 analog inputs, selector, 1 analog output.

This is possible however you will have to choose you Arduino model to make sure it has true analog output.
UNO and Mega, the analogWrite command actually outputs a PWM signal, not a DC level.


Using a single or two buttons to do the selecting is possible with a set of 5 LEDs to show which input is selected.

The analog inputs can only tolerate 0 to 5V, and it uses a 10bit AtoD.
If you input levels are higher than 5V, you will have to use a potential divider to get a suitable input.

There are some circuit designs that can convert the PWM to a DC level, depending on  how much time and effort you want to put into the project.

Or DtoA breakout boards that can interface with the Arduino to give you DC levels.

Can you please tell us your electronics, programming, Arduino, hardware experience?

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

ricecult

Thanks for your responses so far!

I realized that I didn't give the context of the larger project that it is a part of, which I think would be helpful. This is going to be part of a musical instrument that will be something like this but that will also be able to control other synthesizers as part of a larger electronic set up using various sensors (optical, tilt, sound, etc). My set up centers around a Koma Field Kit, which only accepts information from one sensor at a time, hence the need for some way to select between them.

I've been using electronic musical instruments for only a couple of years now, mostly analog synthesizers/hardware, but I'm just beginning to venture into trying to understand more about how electronics work so that I can work with them more in depth, and Arduino seems like a good way to do that. Again, I'm new to working with electronics in general, so I appreciate all of your help and patience. 

Nick_Pyner

I realized that I didn't give the context of the larger project .......... which only accepts information from one sensor at a time
I rather feel reply #2 still applies - rotary switch. It's just another knob to turn, and you don't have to mess about with the signals. Further, I don't think Arduino is for handling analogue audio. I believe it is better suited to controlling other devices that do that.

ricecult

I rather feel reply #2 still applies - rotary switch. It's just another knob to turn, and you don't have to mess about with the signals. Further, I don't think Arduino is for handling analogue audio. I believe it is better suited to controlling other devices that do that.
A rotary switch seems to make sense. To be clear though, there is no audio going through the Arduino, only information coming from the sensors.

Nick_Pyner

#7
Aug 11, 2018, 05:01 pm Last Edit: Aug 11, 2018, 05:02 pm by Nick_Pyner
OK. But I think the same applies!

Go Up