digital coded switch

I have inherited a problem from a fellow member of my radio club, this involves a tone controlled switch board. This board has 5 binary outputs that are switched between 5 & 0 volts depending upon the tone received there is also a independent output that goes high upon a valid tone being received. What is required is to display the value of the tone received on a small oled screen and to switch a output upon a certain combination of the binary switches received for a set amount of time. I have very little programming (read that as none apart from editing sketches) so any pointers will be gratefully received.
I have to build the tone board and I am hoping to integrate the Arduino onto a daughterboard mounted to a 14 pin output on it which incorporates both the binary switch outputs and a 5v and ground output so I should be able to power both boards from a single supply and hopefully encase it all into a relatively small housing if anyone foresees a problem doing so please tell me.
Thanks in advance

If you can do this: : Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board

then you can bootload replacement 328P chips for Unos or standalone products, an Arduino goal btw.

That address also covers breadboarding "the Mighty" 1284P with 32 IO pins and 16K RAM, costs less than $6.

There's quite a few others to choose from, even 14-18 pin ATtinys.

sorry I think I have missed something out I have the board already that receives the tone and creates a 5 bit binary output and I have a nano that is mounted to a daughter card that I have what I do not have is the software to manipulate the 5 bit output from the tone board into a single switched output and a message on the oled

sorry I think I have missed something out


A schematic of the project might help. What have you tried in terms of writing the code?

We will help to get your code working, but can't write it for you.

Read the how to use this forum stickies to see how to post code and error messages and some abvice on what we need to know to better help you.

So the decoder generates a BCD value and strobe.
As a radio club project, I’d guess it’s probably a DTMF decoder..?

Your project reads the BCD value when the strobe pin goes true... displays that value in an OLED screen, and for specific binary values may set or clear some GPIO pins.

Does the OLED display anything else?
If the output is 4-bits plus strobe (16 values), Perhaps a single 7-segment display would be sufficient 0-9 A-F.
Can you post a link to the decoder, or a part number/schematic?

Project should be straightforward with sufficient hardware detail and output requirements.

The board is actually a CTCSS decoder which outputs 25 binary values from 00001 to 11001 these are dependent upon the CTCSS tone received. I would like to use the Arduino Nano to display the binary value received as the tonal value for every tone received but upon receiving a certain value I would like to switch a output to activate a relay to trigger an output transmitter. Also there is a verified tone switch which goes high on all valid tones this I wish to use as an indication that the Arduino and the decoder have received a tone. having never done much more than set up a 3d printer running on marlin this is going to be a challenge not asking for anyone to write this for me but looking for some guidance and assurance that what I am looking at doing is actually possible.

OK, (I have no experience with CTCSS)]

Common 0V between the decoder and the Arduino circuitry.
Bring the five data pins to convenient pins (ideally on the same Arduino PORT)
Same for the strobe pin.

  • Make sure they're all voltage compatible with the Arduino input ratings 5/3V etc)

In code -
Create global variables as needed.
Do your setup() to initialise the pins and anything else.

In loop(), you should poll the strobe pin to check when it changes state to 'true', not simply if it 'is' true. (There are many online examples for state-change detection.)

Then immediately read the data pins into an 'unsigned int' (aka uint16_t on 8-bit AVRs - 16-bit) variable for local processing. Let's call it 'data_word'.

You can ignore the strobe for now (it will go 'false' some time before the next 'true').
Using that data_word, you can test for all the possible/required values - and act on them (possibly a switch-case block).

Some punters may suggest using interrupts - which is valid if your box is doing something else in real-time, but the speed of an Arduino is certain to be much faster than the incoming data/strobe.

Importantly - avoid using delay() after you get out of setup() - you may lose later strobes if the cpu is buried in delay() for any significant period.

Good luck.

thank you

by strobe I am guessing that would be the valid tone received pin on the ctcss decoder that goes high upon reception of a valid code.
I was also going to feed the vcc and ground from the ctcss cards output header so that would make it on a common power supply.
all pins on ctcss decoder switch between 5v and 0 volts high upon active so should be compatible with 5v nano.
So now all I hopefully have to do is work out my sketch lol going to have a search for a starting point and then hopefully build from that.

Just make sure the +Vcc pins you share are capable of supporting the current drawn by the target devices.
Common 0V/Gnd is always a priority. (and bypass capacitors close to the chips!)