Recently I got to work on a project that was destined to serve as a table display at a major U.S. tradeshow. Complicating matters was that I would not be traveling to the tradeshow myself so the contraption had to be shipped and set up by those who would not see the hardware in person until the day it was delivered. Furthermore, while I was the hardware guy with a limited software background, the smart folks setting it up were software engineers with limited hardware background. One last background fact, the project was built to showcase the services and capabilities of three separate companies who were teaming up for this specific effort. Also, one of the major components was a given so we had to work within the constraints of the hardware and firmware of that device.
I learned quite a few lessons about building a project that was more than a prototype and less than production-ready. It was also a rather physically large contraption (relative to what I typically work on) coming in at 36” (L) x 18” (W) x 12” (H). And as I mentioned before it had to be shipped across the country and set up by others with my support only possible over the phone.
This blog is meant to serve as a quick and dirty debrief of those lessons in case you find yourself in a similar predicament.
First, let’s look over the top-level requirements for the project:
- Two tanks that move liquid between them while monitoring the water levels with alerts when either tank becomes full.
- Send tank and pump telemetry to the designated IoT cloud service.
- Minimize hardware complexity since the demonstration is about the Cloud and software
- Quiet
- Desktop size (Estimated Overall Dimension: 30” (L) x 18” (W) x 12” (H)
- Lightweight so to be easily transportable
- Constraint: x4 4-20mA or 0-10V sensor inputs
- Constraint: x5 Open Collector Output, 200mA; selectable 3.3, 5, 15, 24 VDC
In short, it was a rather straightforward demonstration of an industrial process meeting the Internet of Things (IoT) in a small, demo-sized form factor.
Lessons Learned
- Do not permanently mount any component that might need to be replaced or is fragile enough that it may need to be shipped separately. Ensure that any mounting is easily swappable. Consider magnets, velcro, or universal mounting systems such as DIN rail. Screws and adhesives should be used only if absolutely necessary.
- Use lever-nuts connectors to connect wires between components. Do not solder or use other permanent connectors between wires.
- Use quality 20 or 22 SWG solid core wires for breadboarding. 18 AWG stranded wire for routing wire long distances or with lots of bends.
- Establish q wire color code (e.g black for ground, red for power, yellow for clock signals, white for data signals)
- Use colored heat shrink to indicate the purpose of grouped wires in a wiring harness.
- Use zip ties or hot glue around cables when they go external from an enclosure to provide strain relief.
- Always tin the ends of wires before joining two wires together.
- Use ¾” standoffs to raise up project off the table. It gives enough clearance to route wires without being too tall. It also adds some ruggedness during shipping.
- When cutting a hole through plastic use a step bit, go slow, and coat with dish soap. Use a piece of tape to indicate which bit step to stop at.
- Ensure that you are not using oddball components in your project. Being able to source components quickly and cheaply relies on using common parts. Octoparto’s Common Parts Library is a great source to find which electronic components are easily sourced. When it comes to screws, #6-32, #4-40, and #2-56 are among the most common with common lengths being 1”, 3/4”, 1/2”, 3/8” and 1/4”.
- Don’t invent the wheel if not needed. Breakout boards of components are your friend. Do not create your PCB if not necessary.
- When inserting switch in series with external battery pack, cut positive cable and insert a switch/button in series
- Measure power consumption on the low side, between load and ground.
- Use a “#define DEBUG” macro to easily toggle whether or not the microcontroller is printing debug messages over the serial connection.
- Know the difference between const int, static int, and the #define preprocessor directive.
- Know the difference uint_16 vs int
- Know the difference between delay functions, interrupts, timers, and schedulers.
- Follow PEP8 naming conventions for variables:
- variable and function names use lower_case_with_underscores
- class/struct names use CamelCase,
- constants/DEFINE use CAPITALS_WITH_UNDERSCORES
- byte RfidReaders[] = {RFID_READER1_CS};
- _VarName for private variables
- enum PuzzleState {Initialising, Running, Solved};