side_view

InfoNinja Hardware

Overview | Hardware/Firmware | Software

InfoNinja is based around an Arduino Ethernet Uno moth­er­board.  It has exter­nal con­nec­tions for power and Ethernet.  Internally, it is wired up to an LCD with RGB back­light and three but­tons, each with their own light.

The com­plete hard­ware design files are in my GitHub repos­i­tory at https://github.com/BrianEnigma/InfoNinja.  I have attempted to doc­u­ment the parts and build here, in case oth­ers would like to fol­low.

Schematic

The fol­low­ing is a rudi­men­tary schematic dia­gram.  I devel­oped the design using Fritzing, though not all the parts I used are avail­able, so I had to fake it.  The three LEDs on the LCD dis­play rep­re­sent pins 16, 17, and 18 — the red, green, and blue back­light pins.  (The part in Fritzing only has 16 pins and assumes it’s a single-color back­light.)

Similarly, the LEDs next to the push­but­tons rep­re­sent the LEDs inside the push­but­tons.

Design Decisions

When I built this in my head and bought up parts, I didn’t real­ize exactly how many pins I had avail­able.  The Arduino Ethernet has fewer pins than the reg­u­lar 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 giv­ing me that pin to use.  Because of the lim­ited num­ber of pins, I could not inde­pen­dently wire up the but­ton lights.  I tied the cen­ter one to power to act as a power indi­ca­tor, then tied the two outer ones together to the one remain­ing pin I had after hook­ing up the LCD data, LCD back­light, and three but­ton inputs.

Building — Parts

I col­lected the parts up, a few at a time, over a few months.  I didn’t real­ize the total cost until I made this list.  Here is what I used:

  1. Obtain the com­mod­ity stuff you might need:
  2. Obtain elec­tron­ics parts:
  3. Obtain hard­ware (this is all from McMaster-Carr)
  4. Obtain laser-cut parts
    • TODO: link to Thingiverse files and/or svg/eps/pdf.  More below.

Case

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 ser­vice like Ponoko, you may need to refac­tor it slightly to fit the avail­able mate­ri­als and laser design require­ments (e.g. Ponoko wants black cut lines).

I attached the LCD with smaller M2 met­ric machine screws and assem­bled the rest of the case with M3 screws.  You’ll want to sol­der your con­nec­tions to the LCD and ver­ify that every­thing works elec­tri­cally before attach­ing the LCD and assem­bling the case.

Building — Assembly

Wire up the parts to the Arduino.  I find it’s use­ful to start out with a male header in each of the Arduino’s female head­ers.  I then use a dif­fer­ent col­ored paint marker on each one.  This means I can tem­porar­ily dis­con­nect my wiring.  When recon­nect­ing, the mark­ing iden­ti­fies not only the ori­en­ta­tion of each header, but the color indi­cates what plugs into what.  I did not think to snap a photo before­hand, but here’s a blurry photo I made by jam­ming my cam­er­a­phone into the InfoNinja:

If you are new to Arduino, you may want to run through Adafruit’s but­ton tuto­r­ial.  Even if you’re not new to Arduino, you might want to brush up on the char­ac­ter LCD tuto­r­ial.

When sol­der­ing the but­tons, remem­ber that their wires need to route through the holes in the acrylic top.  It is prob­a­bly best to attach the but­tons to the acrylic first, then sol­der to them so that you do not acci­den­tally get your­self in a posi­tion that you need to unsol­der.  I mounted my but­tons such that the green one is A, the white one (the power indi­ca­tor) is B, and the red one is C.

Firmware Dependencies

Obtain and install the 3rd party web­server library for the Arduino, Webduino

  • Create a “libraries” folder in your Arduino sketch folder. For me, this means cre­at­ing 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 fash­ion.

Initial Testing — Board Bring-Up

Once you think you have every­thing wired up, it’s time to test.  My GitHub project page has three apps that are use­ful for this:

  • lcd_test — This prints a sim­ple “hello, world!” to the screen.  Note that it does NOT enable the back­light.  You may need to twid­dle the con­trast knob to see it.
  • full_gpio_test — This tests the var­i­ous inputs and out­puts.  It builds upon the pre­vi­ous hello world, but adds in the LCD back­light, the but­ton lights and dis­plays on the screen the state of the three but­tons.
  • network_test — This builds upon the pre­vi­ous test, but adds in Ethernet.  When you plug in to a net­work, it attempts to allo­cate a DHCP address and will print it on the screen.

Finalizing the Build — Putting the Case Together

Once you have ver­i­fied that all of the elec­tron­ics are work­ing cor­rectly, you are ready to but­ton up the whole pack­age.  Attach the LCD to the face using M2 screws.  Be sure to ver­ify the ori­en­ta­tion — you don’t want to have to read the LCD upside-down.  The sol­der pads should be at the top.  I used two M2 nuts behind each screw to pro­vide a lit­tle extra lock­ing.  Attach the Arduino the the base, using M3 screws and plas­tic stand­offs.  Because of the hole spac­ing, there is only one way the Arduino will fit.  With the Arduino Ethernet Uno, one of the holes is obscured by a con­nec­tor, so you can only use three mount­ing screws.  You’ll want to use nylon wash­ers between the board and try not to over-tighten because sev­eral parts are very close to the mount­ing holes.

Next, attach the feet.

Finally, assem­ble the box.  The panel attach using a “bolted mor­tise and tenon joint,” which is how the pan­els of a Makerbot fit together.  The first few pan­els are easy to assem­ble because you can get your fin­gers on either side of the nut to help secure it in its chan­nel.  As you approach the end, it’s a lit­tle more dif­fi­cult.  You can still do it, but if you have tweez­ers, reverse tweez­ers, or for­ceps, it might make the job a lit­tle eas­ier.

Firmware

The large hole on the bot­tom face gives you access to the TTL ser­ial port used for pro­gram­ming.  You can (re-)upload any of the test firmware or upload the release firmware.  If you make mod­i­fi­ca­tions to the release firmware (and please share with the world if you do!), you can also eas­ily upload it.

You will want to upload the release firmware into the Arduino.  Connect it to net­work 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 net­work doesn’t use a DHCP server and has only sta­tic IP addresses (set­ting up a DHCP server is beyond the scope of this text, but most routers and cable­modems do that these days).  It is also pos­si­ble that you plugged in power before net­work and the DHCP request timed out before you con­nected it to the net­work.  Load up test_page.html from the git repos­i­tory, 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 man­u­ally set text, change col­ors, set blink modes, and so on.

At this point, if every­thing looks good, you are prob­a­bly ready to con­tinue to desk­top soft­ware.

Alternative Hardware Configuration

You can use a reg­u­lar 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 prob­a­bly use a WiFi Ethernet shield with­out a prob­lem, as long as the pins used and API are the same.

If you’re on a bud­get, you can use the USB port on a reg­u­lar (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 ser­ial pro­to­col of your own devis­ing.  The advan­tage of this is that the pins that are usu­ally used up by the Ethernet con­troller will be free.  You can not only have the two side-buttons on sep­a­rate GPIOs, but you can hook them up to PWM pins for fancy fades.

Future

In the next firmware revi­sion, there are a cou­ple of changes I would like to make.

I would like to use the red “demo mode” but­ton for pag­ing.  This would allow mul­ti­ples of 4 lines, with that but­ton tog­gling between them.  For instance, you might put envi­ron­men­tal infor­ma­tion on the first page (cur­rent tem­per­a­ture, weather fore­cast, moon phase), tran­sit infor­ma­tion on the sec­ond page, and build-server infor­ma­tion on a third page.

I would also like to add secu­rity.  Currently, InfoNinja prints what­ever it receives.  This is good if you are on a small, trusted, net­work.  A larger net­work could have peo­ple acci­den­tally or inten­tion­ally send­ing updates to your InfoNinja.  There is place­holder code in there to cre­ate a whitelist of one IP address: the first IP address that com­mu­ni­cates to InfoNinja will be the only one it allows updates from until you cycle power.  Unfortunately, this place­holder code is use­less with­out some core Arduino updates.  Internally, the Ethernet sub­sys­tem knows what IP address it is talk­ing 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 appli­ca­tion.  This is not hard to do, but I’m not sure I want to mon­key­patch the core Arduino libraries.  Each sys­tem 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 con­sider Adafruit’s new I2C-driven LCD board.  This would chew up fewer pins on the Arduino, allow­ing not only for the two but­tons to have sep­a­rate lights, but they could be hooked up to PWM lines for slick fade action.  The one draw­back to the I2C board is that it rules out the cool back­light effects like blink­ing or fad­ing between two shades of the same color.  This new board gives you pri­mary col­ors only.  You could blink between red and black or red and white, but you can­not blink between a bright and dim red.  This is a trade­off I would have to pon­der.


Creative Commons License InfoNinja hard­ware by Brian Enigma is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.  InfoNinja firmware and soft­ware is licensed as GPL v2.0 soft­ware.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>