Best wireless approach for 2 Atmega328 units

Hello everyone,

I am making a MIDI program change pedal that will interact one way with software for a band I work with. That’s all fine, but I’ve been asked to create 2 identical pedals for both sides of the stage. One of them being the master unit that sends the MIDI command via standard DIN cable to the software, and then a second remote unit that wirelessly communicates with the master. It will need to display the preset bank and currently activated preset. Whatever happens on one, needs to be reflected on the other.

I’ve attached a snapshot of the schematic I’m in process of creating for the master unit. Using 2 shift registers for LED and foot switch’s, and a MAX7219 for the 4 segment preset display. Since the TX will be sending the MIDI command, what do you think the most straight forward approach would be?

I’ve considered adding a second Atmega328 via I2C to the master unit, and then utilizing the RX/TX for communication there (either via bluetooth, XBee, etc). The remote unit will only be used to speak with the master, so it won’t need to use MIDI out. Wireless is a new area to me, so I’m hoping to get some guidance so I don’t do things the hard way first.

Thanks!

Some things to think about when choosing a wireless system are range, amount of data to send, reliability, price, and interference.

What range do you need? That is, how far apart are the sender and receiver? Is that line of site, or will there be things (and people) in between?

How much data do you need to send? How often?

How critical is it that ALL the data gets through? Is it OK if an occasional packet gets lost?

How much of the error checking, packet construction/deconstruction, retransmission, etc. do you want to write? How much do you expect to be built in?

How much are you willing to spend?

What other wireless communication is happening? What voltage levels are present?

Bluetooth is simple to implement. It is really just serial-by-wireless. If a wired serial connection would be OK then a Bluetooth link should also be OK.

Another option is the cheap nRF24L01+ 2.4GHz transceivers which work well and have longer range than Bluetooth. However it is probably a little more complex than Bluetooth.

I got my nRF24s working with this Tutorial

I suggest you use the TMRh20 version of the RF24 library - it solves some problems from the ManiacBug version

The pair of programs in this link may be useful.

...R

Thanks for the quick replies-

PaulS - The amount of data will be really minimal, and the range will be no further than 10-20 meters, line of sight, maybe a few speakers here and there, floor level. This band plays big festivals, so even on the widest stages, it couldn't exceed that. The way it will function is one press, one MIDI program change message, with a bank indicator and LED showing what preset is currently selected. No continuous data back and forth, only when a change happens. Once every 30 seconds or so- But they will always need to match up without anything lost.

Robin2 - With bluetooth, will I be able to send and transmit via the A4 and A5 pins on the atmega? If so, that just might be my answer!

With bluetooth, will I be able to send and transmit via the A4 and A5 pins on the atmega?

If they are not otherwise being used, yes.

If so, that just might be my answer!

If you can live with the 10 meter range...

PaulS:
If they are not otherwise being used, yes.
If you can live with the 10 meter range...

If it is going to be be at the max end of its range, then it might not be.

As far as the nRF24 route goes, I'm seeing that it uses the MOSI, MISO, and SCK connections- As I am already using those for the Max7219/4-Digit number display, would it be a case of a second Atmega328 used exclusively for radio communcations on both circuits, connected to the master Atmega via i2c?

My rough understanding of the communication link-

nRF24 sends and receives data to/from remote unit into slave Atmega328 -> i2C communication of that data to Master Atmega328 -> final command to MIDI out. Something like that?

My apologies if that is completely wrong, still finding my way around

would it be a case of a second Atmega328 used exclusively for radio communcations on both circuits, connected to the master Atmega via i2c?

No. MISO, MOSI, and SCK form the SPI BUS pins. Check out a bus sometime. Lots of seats.

You can have multiple SPI devices on the bus, as long as each has its own SS/CS pin.

Apart from nRF24, there's also the RFM69 that works on sub-GHz frequency, had built-in encryption and offers great range/reliability. Here some "Arduino" boards with RFM69 built-in available:

http://www.rocketscream.com/blog/product/mini-ultra-pro-with-radio/ (based on ARM MCU)
Whisper Node - AVR - Wisen (can be powered by AA or CR2032 batteries)
Anarduino MiniWireless Details (built in RTC)

And here an excellent RFM69 library: RadioHead: RH_RF69 Class Reference

Cheers