InfoNinja is based around an Arduino Ethernet Uno motherboard. It has external connections for power and Ethernet. Internally, it is wired up to an LCD with RGB backlight and three buttons, each with their own light.
The complete hardware design files are in my GitHub repository at https://github.com/BrianEnigma/InfoNinja. I have attempted to document the parts and build here, in case others would like to follow.
The following is a rudimentary schematic diagram. I developed the design using Fritzing, though not all the parts I used are available, so I had to fake it. The three LEDs on the LCD display represent pins 16, 17, and 18 — the red, green, and blue backlight pins. (The part in Fritzing only has 16 pins and assumes it’s a single-color backlight.)
Similarly, the LEDs next to the pushbuttons represent the LEDs inside the pushbuttons.
When I built this in my head and bought up parts, I didn’t realize exactly how many pins I had available. The Arduino Ethernet has fewer pins than the regular Arduino. Five are used by by the Ethernet. One does double-duty as to select the SD card — though I decided not to use the card in this design, at least giving me that pin to use. Because of the limited number of pins, I could not independently wire up the button lights. I tied the center one to power to act as a power indicator, then tied the two outer ones together to the one remaining pin I had after hooking up the LCD data, LCD backlight, and three button inputs.
Building — Parts
I collected the parts up, a few at a time, over a few months. I didn’t realize the total cost until I made this list. Here is what I used:
- Obtain the commodity stuff you might need:
- Obtain electronics parts:
- Obtain hardware (this is all from McMaster-Carr)
- Obtain laser-cut parts
- TODO: link to Thingiverse files and/or svg/eps/pdf. More below.
The case is a laser-cut sheet of 1/8″ acrylic. I picked up an 18“x18” square at TAP Plastics and cut it out at ADX Portland. If you use an online service like Ponoko, you may need to refactor it slightly to fit the available materials and laser design requirements (e.g. Ponoko wants black cut lines).
I attached the LCD with smaller M2 metric machine screws and assembled the rest of the case with M3 screws. You’ll want to solder your connections to the LCD and verify that everything works electrically before attaching the LCD and assembling the case.
Building — Assembly
Wire up the parts to the Arduino. I find it’s useful to start out with a male header in each of the Arduino’s female headers. I then use a different colored paint marker on each one. This means I can temporarily disconnect my wiring. When reconnecting, the marking identifies not only the orientation of each header, but the color indicates what plugs into what. I did not think to snap a photo beforehand, but here’s a blurry photo I made by jamming my cameraphone into the InfoNinja:
When soldering the buttons, remember that their wires need to route through the holes in the acrylic top. It is probably best to attach the buttons to the acrylic first, then solder to them so that you do not accidentally get yourself in a position that you need to unsolder. I mounted my buttons such that the green one is A, the white one (the power indicator) is B, and the red one is C.
Obtain and install the 3rd party webserver library for the Arduino, Webduino
- Create a “libraries” folder in your Arduino sketch folder. For me, this means creating a folder named “libraries” in “~/Documents/Arduino”
- Using your git tool of choice, check out https://github.com/sirleech/Webduino.git into that “libraries” folder.
Obtain and install the 3rd party switch debounce library for the Arduino, Bounce, and install it in the same fashion.
Initial Testing — Board Bring-Up
Once you think you have everything wired up, it’s time to test. My GitHub project page has three apps that are useful for this:
lcd_test— This prints a simple “hello, world!” to the screen. Note that it does NOT enable the backlight. You may need to twiddle the contrast knob to see it.
full_gpio_test— This tests the various inputs and outputs. It builds upon the previous hello world, but adds in the LCD backlight, the button lights and displays on the screen the state of the three buttons.
network_test— This builds upon the previous test, but adds in Ethernet. When you plug in to a network, it attempts to allocate a DHCP address and will print it on the screen.
Finalizing the Build — Putting the Case Together
The large hole on the bottom face gives you access to the TTL serial port used for programming. You can (re-)upload any of the test firmware or upload the release firmware. If you make modifications to the release firmware (and please share with the world if you do!), you can also easily upload it.
You will want to upload the release firmware into the Arduino. Connect it to network and power. Look at the LCD and note the InfoNinja’s IP address. If it reads 0.0.0.0, then it was unable to obtain an IP address. Perhaps your network doesn’t use a DHCP server and has only static IP addresses (setting up a DHCP server is beyond the scope of this text, but most routers and cablemodems do that these days). It is also possible that you plugged in power before network and the DHCP request timed out before you connected it to the network. Load up
test_page.html from the git repository, type in the address, and try a few of the links. This will issue requests to your InfoNinja’s web server and will let you manually set text, change colors, set blink modes, and so on.
At this point, if everything looks good, you are probably ready to continue to desktop software.
Alternative Hardware Configuration
You can use a regular Arduino Uno plus an Ethernet shield instead of the Arduino with the built-in Ethernet, but you will have to expand the cut-out hole in the back to give you access to the Ethernet jack.
You can probably use a WiFi Ethernet shield without a problem, as long as the pins used and API are the same.
If you’re on a budget, you can use the USB port on a regular (non-Ethernet) Arduino to talk to InfoNinja, but you will need to make some large changes to the firmware. Essentially, you will need to rip out the web server and replace it with a serial protocol of your own devising. The advantage of this is that the pins that are usually used up by the Ethernet controller will be free. You can not only have the two side-buttons on separate GPIOs, but you can hook them up to PWM pins for fancy fades.
In the next firmware revision, there are a couple of changes I would like to make.
I would like to use the red “demo mode” button for paging. This would allow multiples of 4 lines, with that button toggling between them. For instance, you might put environmental information on the first page (current temperature, weather forecast, moon phase), transit information on the second page, and build-server information on a third page.
I would also like to add security. Currently, InfoNinja prints whatever it receives. This is good if you are on a small, trusted, network. A larger network could have people accidentally or intentionally sending updates to your InfoNinja. There is placeholder code in there to create a whitelist of one IP address: the first IP address that communicates to InfoNinja will be the only one it allows updates from until you cycle power. Unfortunately, this placeholder code is useless without some core Arduino updates. Internally, the Ethernet subsystem knows what IP address it is talking to, but it does not expose this value to user code. The core Arduino library would need to be patched to expose the IP address, and then the Webduino library would need a patch to pass it along to the user application. This is not hard to do, but I’m not sure I want to monkeypatch the core Arduino libraries. Each system update would require me to re-monkeypatch them again.
If I were to do this again...
If I were to do this again, I might consider Adafruit’s new I2C-driven LCD board. This would chew up fewer pins on the Arduino, allowing not only for the two buttons to have separate lights, but they could be hooked up to PWM lines for slick fade action. The one drawback to the I2C board is that it rules out the cool backlight effects like blinking or fading between two shades of the same color. This new board gives you primary colors only. You could blink between red and black or red and white, but you cannot blink between a bright and dim red. This is a tradeoff I would have to ponder.
InfoNinja hardware by Brian Enigma is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. InfoNinja firmware and software is licensed as GPL v2.0 software.