… that is the question.
Should you solder connections between your Arduino and external boards?
Soldering is a method of making electrical and (usually) minor structural connections. It can be a permanent and reliable connection that lasts for decades. Sometimes, however, that can be a drawback since soldered connections make it harder to replace or upgrade external boards when they fail. It’s also not a panacea: while a properly constructed soldered joint can be very strong, the point where the solder ends tends to be brittle and can lead to failures if that section of the wire moves. The typical remedy for this is a strain relief — secure the wire so it can’t move or vibrated.
Pin and socket connections are a popular alternative to soldering, especially in the Arduino world where many newcomers don’t have soldering experience. They too can be very reliable: a snug fit between pin and socket can be gas-tight and resist corrosion for a very long time. It has a similar drawback to soldered connections when the item is in an area subject to vibration: the wires can come loose. Typical solutions for this are to use cable connectors with ramps, clips, or other locking mechanisms. For the popular Arduino wire jumpers, they can be bundled in groups and secured with wire ties. By tying them together, they behave more like a single connector with a group of wires and it takes more force to dislodge them. Also, the wire bundle can be secured to a fixed point, so it won’t move.
Some single-wire terminations such as Faston terminals actually dislodge a small amount of metal when the connection is made. They fit so tightly that no additional wire restraint is needed.
So solder, or pins for wire to board connection? In the end they’re both quite useful and reliable, but my preference is generally for pin and socket. Their versatility far outstrips the few drawbacks.
I made a post over at the popular Arduino forum on a topic where someone was inquiring about available enclosures. The community tends to respond “just 3D print one” but that’s a mistake in my opinion.
3D printing, while useful, seems pointless to me unless you’re looking for something not available off the shelf. Even then, the 3D print falls short if you need a transparent cover, or a NEMA4X /IP66 (washdown-proof) rating, or any number of other structural properties. That off the shelf $20 polycarbonate case has a lot of engineering time put into it and provides a huge amount of convenience.
As far as laser cut enclosures are concerned, I’ve yet to find one that doesn’t look completely ugly like something a 6 year-old put together for a craft class.
Seriously, burnt wood edges is not a professional look! I have seen professional enclosures for large machines made out of wood and particle board and you’d never know what the material was. When designed by an engineer who knows what he’s doing, wood can be a fantastic material.
The amateurish laser-cut “snap together jigsaw cases” all look like crap in my opinion. And that’s a pity, because you can do some great stuff with a laser cutter. It’s just that the community has apparently decided to embrace the lowest common denominator design quality.
My gotos for great cases are Polycase & Bud for plastic wall and desk mount enclosures. Hammond for metal enclosures (although Bud has some nice aluminum cast boxes). Serpac or OPC for handheld/belt mount types. Altech for industrial enclosures with electrical knockouts (although Polycase is now carrying those also).
I’ll probably update this list over time.
One interesting application for our PRT232 pulse counter is reading bill acceptors and coin acceptors from a desktop computer.
A coin acceptor is used to pay for a product or service. You’re probably quite familiar with them from using commercial laundry machines or video game arcades. In these situations, they are built into the equipment. However we are seeing an increase in cases where someone is adding a payment facility via a bill acceptor or a coin acceptor to equipment that was not designed for it. An example would be a kiosk that dispenses water. There are many of these in grocery stores where you can fill up your bottle with pure water and then pay for it at the counter. But many entrepreneurs are taking water dispensers and making it possible for the customer to pay directly at the point of sale.
These acceptors work by sending a number of pulses corresponding to the coin or bill that is entered. e.g., a quarter may provide a single pulse while a dollar bill gives four pulses. Our pulse counting devices are obviously a natural fit for the application. They will accept the pulse output from the coin acceptor, count the pulses and provide a serial RS232 interface to the PC making it simple to tally the dollar amount entered.
By using a counter to RS232 device like our PRT232 or PRT232F (6 count inputs), now the PC computer can be used to track usage, make automated daily reports, provide the customer enhanced user interface and so improve your sales performance.
We provide a sample of software that uses the PRT232 as a dispense controller. It can be easily modified for your own use. We also offer custom software and hardware development in this area.
One example of what we have done is the situation when the bill acceptor must be connected to a machine that doesn’t correspond exactly with its operation. For example, perhaps you are building a vacuum cleaner that the operator pays to use (as often found at a car wash). The vacuum may have been designed to start with a contact closure, but in order to use your coin acceptor, you must translate the four pulses from four quarters being deposited into a single output. We have designed electronics to solve exactly this situation. If you need something similar, contact us.
Time is probably the most commonly controlled process variable. Timers are all over the place in industrial control. Odds are, if you need some type of timer, no matter how strange, you can find it off the shelf.
Now, many of these timers used a chip usually referred to as the “555.” The LM555 originally made by (I think; someone will correct me) National Semiconductor was a very versatile device, but it was at the heart of many time-delay relays, short timing circuits, etc.
So once upon a time, if you wanted to build a basic timer, odds are you would wire up a 555 into a circuit. To build a handful, or just one, you’d use a perf board,
maybe you might use wire wrap or even dead-bug construction (my favorite!)
It would be time consuming,but maybe you had no choice because the timer had some weird requirement that no off the shelf timer had, or needed to fit into an oddly shaped space.
What does this have to do with Arduinos? Well, you can program any timing sequence into an Arduino. Say you want the heater on a commercial ironing board to come on for five seconds when the operator lowers it, a 555 does it easily. If you want the heater to come on for five seconds and when the board is raised again, a fan to blow for 10 seconds to cool the clothing, the 555 can still be used. Maybe you need two of them. But now, the Arduino becomes an easier solution. Whether you need one time sequence, or dozens, a single Arduino can be programmed to do it. When you factor in the labor of wiring a circuit board with the 555, the low off the shelf price of the Arduino makes it even more attractive.
This is the wonder of the time we live in: an off the shelf microprocessor board is now inexpensive enough to be used for logic replacement.
Arduinos are popular small microcontroller boards that have many applications. However, they’re not designed to switch loads above a few milliamps: say a couple LEDs or so. While power-driver shields do provide this capability, they also can consume more resources than you may be able to give up.
We developed a high current driver to make it easy to control a solenoid valves with Arduino. It will also control pumps and motors. With an adapter cable, it can easily connect to your Arduino, BeagleBone, Raspberry Pi or other digital controller without soldering or crimping any connections. Doesn’t get any easier than that.
The power driver board was born out of a need for controlling a 1 amp solenoid valve using an Arduino. The solenoid valve was being used to control the water flow to fill a tank automatically. Now there’s a simple way to use your Arduino or compatible to switch up to 3A at 24VDC. Two output connections (the white wires shown above) connect directly the load (your solenoid, relay, motor, etc) and the power (red, black) go to the power supply (5 -24 volts). The orange lead is used to switch on and off. This is a low-voltage (5V) control that can connect directly to a microcontroller, or development board. An onboard LED indicates when the load is switched on.
Here’s some sample code that implements a timer with an Arduino. When the pushbutton is pressed, it turns on water flow for 3 seconds
// This sketch demonstrates a simple timer
// A load (motor, solenoid, relay, solenoid valve is on Pin 1
// A pushbutton to trigger the timer start is on pin 2
// When the pushbutton is held down for more than 0.1 second
// then released, the timer starts
// and times out after 3 seconds
// Timer is retriggerable: if pushbutton pressed
// during the timeout period, timer restarts
// Constant definitions
#define LOOP_INTERVAL 10
#define TIMEOUT 300 * LOOP_INTERVAL
#define TRIGGER_INTERVALS 10
#define TIMER_INACTIVE -1
#define TRIGGER_PIN 0
#define OUTPUT_PIN 1
static int count = 0;
static int timer = TIMER_INACTIVE;
// Process loop periodically
// Check trigger input
if (digitalRead(TRIGGER_PIN) == LOW)
// Must hold down pushbutton for the entire interval and
// then release to trigger
// push button released. Check if we should start timing
if (count >= TRIGGER_INTERVALS)
// Turn output ON (timeout is retriggerable)
timer = TIMEOUT;
count = 0;
// If timer active, count down
if (timer != TIMER_INACTIVE)
timer -= LOOP_INTERVAL;
if (timer == 0)
// Turn output OFF
timer = TIMER_INACTIVE;
Let’s find out what new applications you can come up with.
Power Driver ($11.95 shipping included)
This was a response to an online request for help with code. A single pushbutton cycles through three hydraulic damper valve settings. The code was too long to post on the site, so I’m showing it here.
As of today, I don’t know if it will work, but it explains the concept. I will get it working as time permits
// Digital output definitions
#define RED_OUTPUT 0
#define BLUE_OUTPUT 1
#define GREEN_OUTPUT 2
// Digital input definitions
#define SWITCH_INPUT 3
// Define states
#define RED 800
#define BLUE 801
#define GREEN 802
// Define message types
#define NONE 901
#define CLICK 902
#define PRESS 903
// Global state
int _state = GREEN;
// One-time call to initialize system
// Enable GREEN state
// Continuously called by Arduino runtime
// Read pushbutton
int message = readSwitch();
// Update LEDs and hydraulic valve if state changed
// Read pushbutton and return the result
const int CLICK_UPPER_LIMIT = 200;
const int CLICK_LOWER_LIMIT = 25;
const int PRESS_LOWER_LIMIT = 1000;
const int PRESS_UPPER_LIMIT = 2000;
int switchMessage = NONE;
unsigned long start = micros();
while (digitalRead(SWITCH_INPUT) == LOW);
unsigned long duration = micros() - start;
if (duration < CLICK_UPPER_LIMIT && duration > CLICK_LOWER_LIMIT)
switchMessage = CLICK;
else if (duration > PRESS_LOWER_LIMIT && duration < PRESS_UPPER_LIMIT)
switchMessage = PRESS;
bool processState(int message)
static int lastState = GREEN;
int retVal = 0;
// PRESS overrides CLICK in all states
if (message == PRESS)
_state = GREEN;
// Process states
if (message == CLICK)
_state = BLUE;
if (message == CLICK)
_state = RED;
if (message == CLICK)
_state = RED;
// Did state change?
retVal = (lastState == _state);
// Remember this state
lastState = _state;
// Return state changed information
void activateOutput(int thisState)
// Since this is only called on state change, OK to turn everything off first
// Turn on only the output corresponding to the state