APC Australia

Make an Arduino-powered wireless message board

Darren Yates combines a compact LED-matrix board, Bluetooth module and Arduino Nano to create a wireless message board you load via your Android phone.

-

Scrolling message boards are cool and you see them just about everywhere. This month, we’ll show you how to make your own. However, this one is a little different — you upload the message wirelessly via Bluetooth from your Android phone or tablet using a free app from Google Play.

MAX7219 4-IN-1 LED MATRIX

The key component of our message board is a MAX7219 4-in-1 8 x 8-LED matrix board. These are all over the web and come with four 8 x 8-pixel LED modules in a row, giving you a 32 x 8-pixel panel to play with. We’ve connected ours via SPI (serial peripheral interface) with three wires for the control signals to an Arduino Nano board. The other two wires provide DC power.

HC-06 BLUETOOTH MODULE

But to get text onto the message board, we’ve also added an HC-06 Bluetooth module. It runs at a low 9600bps data rate, but it’s more than fast enough for our needs. It’s designed to send and receive data over a serial connection, but to make installati­on less complicate­d, we’ve added the AltSoftSer­ial library, which adds a second serial port on Arduino Nano pins D8, D9 and D10. The HC-06 is powered by the Nano’s 5V voltage rail; however, its ‘receive’ (RX) input can only take 3.3V. So we include 10kohm and 20kohm resistors to form a voltage divider connecting the Nano’s D9 I/O pin to the HC-06’s RX input. The voltage divider drops the voltage from 5V down to 3.3V and, by placing the resistors as we have, we can just drop the HC-06 straight into the small 170-point breadboard.

BUILDING THE MESSAGE BOARD

These tiny breadboard­s are great for compact designs. To make things even more compact, we’ve fixed the breadboard to the back of the LED matrix board with double-sided foam tape. They’re both about the same height and make a surprising­ly neat little bundle. Follow the overlay wiring diagram and you shouldn’t have too many problems. Just make sure to have the usual tools (needle-nose pliers, side cutters and so on).

FLASHING THE NANO

The last piece of the jigsaw from the Arduino side is our source code. Download it from apcmag.com/magstuff.

Unzip the file and copy the contents of the ‘libraries’ subfolder into the same of your Arduino IDE installati­on (we’re using the excellent Adafruit_ GFX, AltSoftSer­ial and Max72xxPan­el libraries). Reboot the IDE (get it from arduino.cc), load up the ‘WireMessBo­ard.ino’ file, plug in your Arduino Nano board, select it from the ‘Tools’, ‘Board’ list, choose the COM port the Nano is connected to (not COM1 — that’s your mouse) and press the green ‘upload’ button top-left to flash the code to the Nano. Plug the Nano board into the breadboard, power it up from a USB phone charger and it should fire up.

ANDROID APP

Once you’ve got the hardware up and running, it’s time to try it out. We’ve designed this project to work with the ArduDroid app on Google Play ( tinyurl.com/gr3lk6m) — it’s free and works with any Android device with at least Android 2.3/Gingerbrea­d and built-in Bluetooth.

The first step is to power up the message board, at which point, you should see the welcome message appear on the LED matrix as well as a flashing LED on the HC-06 Bluetooth module (the latter indicates it’s waiting to pair with another Bluetooth device).

Next, install ArduDroid from Google Play. After that, go to the Android ‘Settings’ menu, select ‘Bluetooth’ under ‘Wireless & networks’, search for available devices and wait until you see ‘HC-06’ appear in the list (launch a new search if you have to).

Tap on the entry when it appears, type in the four-digit pairing password

(should be ‘1234’) and tap OK. After a couple of seconds, the HC-06 should be listed under ‘Paired devices’.

Next, launch ArduDroid, tap your device’s menu button and select ‘Connect me to a Bluetooth device’. You should now see the HC-06 listed — tap on the entry. Shortly after, ArduDroid should indicate that it is now connected.

Now for the moment of truth — in ArduDroid’s ‘Send/Get Arduino Data’ screen panel, there’s a text box next to the ‘Send Data’ button. Tap inside the text box and type a message. When you’re done, press the ‘Send Data’ button. After the message board has completed its current message scroll-through, it should instantly update and begin displaying the message you sent. If so, congrats — it’s working! Your new message will continue to loop until either you enter a new message or remove the power.

We’re not sure of the maximum message length, but given the Arduino Nano’s limited 2KB of RAM, you should get up towards 500 characters comfortabl­y (we’ve tested to 100 characters — that seemed enough for whatever we could think of saying at the time).

MODDING THE CODE

The two main source-code parameters you can adjust are the LED brightness and the message scroll speed. The brightness is set via the ‘ brightness’ variable, which must be a number from zero (dull) to 15 (sunnies). We feed this value into the ‘matrix.setIntensi­ty()’ command which sets the brightness. Be warned, though — running the matrix board flat-stick will chew up a lot of current, possibly more than your power source (and the Arduino Nano) can provide. You should find that a setting of ‘8’ will be more than bright enough for most applicatio­ns. Even the zero-level setting is easily seen in a well-lit room.

The scroll speed is primarily set via the ‘scrollSpee­d’ variable — the lower the value, the faster the scroll. The default is ‘40’, which isn’t too fast as to make you carsick, but you can speed it up or slow it down to suit your needs.

RANGE AND POWER

Bluetooth is a low-power wireless networking standard and the HC-06 is good for around 10 metres or so. This will vary depending on the radio-frequency and physical interferen­ce (line of sight) between you and the module.

In terms of power consumptio­n, the whole thing draws approximat­ely 100mA of current with zero-level brightness and the standard welcome message. That goes up to 200mA with a setting of ‘8’. If all LEDs are lit on an ‘8’ setting, expect it to be around 600mA — but we don’t recommend you use the ‘all LED’ setting for any length of time.

BUILD SOMETHING!

Arduino is a fun way to get your hands dirty and learn how to build your own computer-coded electronic gadgets. Even the tiny Arduino Nano microcontr­oller board is capable of much more than what we’re using it for here. All it’s waiting for is your imaginatio­n.

 ??  ?? The MAX7219 LED matrix combines four 8 x 8 LED modules into one board.
The MAX7219 LED matrix combines four 8 x 8 LED modules into one board.
 ??  ?? The breadboard is fixed to the LED module with double-sided foam tape.
The breadboard is fixed to the LED module with double-sided foam tape.
 ??  ?? Our message board connects to your Android phone via Bluetooth.
Our message board connects to your Android phone via Bluetooth.
 ??  ?? The wireless message board forms a low-profile design.
The wireless message board forms a low-profile design.
 ??  ?? Pair your Android phone with the HC- 06 before you send your message.
Pair your Android phone with the HC- 06 before you send your message.
 ??  ?? Select the HC- 06 from the ArduDroid’s settings menu before you begin.
Select the HC- 06 from the ArduDroid’s settings menu before you begin.
 ??  ?? Once paired, type in your message and press the Send Data button.
Once paired, type in your message and press the Send Data button.

Newspapers in English

Newspapers from Australia