One More RadioShack Closes

Our local Waimea RadioShack shop is closing.

RadioShack Pile
A pile of RadioShack components purchased at the local closing sale.
Our local RadioShack has survived several rounds of store closures as the chain has moved in and out of bankruptcy court. Time has finally run out for the store and it is liquidating the stock and will close by the end of the month.

I have commented on my view on RadioShack before. As an electronic hobbyist I have mixed feelings about RadioShack. In my younger years it was a decent place to buy electronic components. Some of the early computers I learned on were RadioShack products like the TRS-80 and Tandy 1000. I even worked as a RadioShack sales clerk one summer during high school.

Continue reading “One More RadioShack Closes”

A 6V Lead-Acid Battery Charger Using the LM555

How do you power a device that must stay on through an event that may cause a power outage? Battery backup of course. But that answer leads to whole new level of complications. There must be a circuit in place to allow power to be drawn from the battery or the power supply. The proper battery technology should be chosen. You need a another circuit to care for the battery, allowing for very long term reliability. Long term? Years.

6V Lead-Acid Battery Charger
A 6V lead-acid battery charger based on the venerable LM555.
A good answer for the battery technology is sealed lead-acid. A properly used lead-acid battery should last a decade or more while providing power to operate for over a day. Lead-acid may not be a good choice for a portable device where weight and size are the primary considerations. But for a stationary application this venerable technology is a good choice.

What about the charge circuit? A simple charger that can fully charge the battery, but not overcharge the battery is needed. In the case of lead-acid charging is usually accomplished by charging to a chosen voltage before shutting off or lower the voltage to a safe lower value called a “float charge”.

Continue reading “A 6V Lead-Acid Battery Charger Using the LM555”

Bang-Bang

I took a break from working with a “big” microcontroller to work with a little one. The PIC12C671 is definitely little when compared with the PIC18F66K80 I am using in the GenPIC utility PCB. With less than 2k of program space and a mere 128 bytes of RAM it is definitely limited. Consider that the chip only has eight pins, two of which are power and ground, leaving six I/O pins to get the job done. No problem, I only need two I/O pins for this task and that few bytes of RAM is more than enough!

A simple heater using a bang-bang controller.
A simple heater using a bang-bang controller.
This project is pretty basic… A bang-bang heater controller. This simple form of controller simply turns on and off as the temperature (or some other controlled parameter) goes up and down, there is no attempt to vary the output, all or nothing. Bang on, bang off, or simply a bang-bang controller as it is known in the trade.

A bang-bang controller is inherently reliable and stable because it uses two different control setpoints, a high and a low. Because these control points are separated by a large margin, called hysteresis, the controller will not oscillate or rapidly turn on and off. In this case the heater will not turn on until the temperature falls below 10°C and will not turn back off until the temperature rises above 15°C. That five degree margin is called hysteresis, and ensures a good period of time between on and off.

Continue reading “Bang-Bang”

Circuitry Gallery

GenPIC First Code Release

I have had hardware for a while now, it is about time I release some firmware that actually runs it.

GenPIC Development Setup
The development setup in use generating the first software release for the GenPIC utility PCB
Here it is!

The first GenPIC code revision is a test and demonstration release. It contains support for one serial port, an LCD character display, user input including the encoder and pushbuttons, the indicator LED’s, timer generation, analog input including onboard temperature readout.

Also included is a serial command interpreter implementing a serial interface usable with any serial terminal. There is also a user interface system with a state setup that provides multiple input screens. This should handle a wide array of basic control capabilities, either using the serial port or through using the LCD screen and the encoder.

The code allows you to exercise many of the basic functions of the hardware and provide a framework on which a real application can be built.

It works, it runs, it looks fairly good. Now time to make something useful with it…

First code release
11Feb2017
Code Rev0.1

There will be additional code releases as this project continues, as always check the GenPIC main post for the latest!

Taming a Rotary Encoder

The rotary encoder is a popular input device for many microcontroller devices. A knob that can be used to increase or decrease a setting with a nice tactile click for each increment. You can even get an integral pushbutton, just rotate for the setting then press the same knob to enter. With some clever programming you can create a one device user interface using only the encoder.

GenPIC Development Setup
The development setup in use generating the first software release for the GenPIC utility PCB

I have integrated a rotary encoder in the GenPIC utility board. With the combination of an LCD display and the rotary encoder you have all the ingredients for a functional user interface arranged neatly for a panel mount unit.

In the past I have simply set an interrupt to fire on the edge of one channel, then sampled the opposite channel to detect the direction. With the addition of a small delay to debounce the result. This worked well in previous devices, but this time I encountered trouble, the direction sampling was erratic, the value going up when it should have gone down and vice-versa.

Breaking out my logic analyser I found out why, this particular encoder proved to be somewhat noisier than I had seen in the past, with notable periods of bouncing signals.

Continue reading “Taming a Rotary Encoder”

GenPIC, A Microcontroller Utility PCB

Over the years I have hand wired so many microcontroller PCB’s. Along with my own projects for myself there are more than a dozen of my little microcontroller devices at work about the observatory. The OSIRIS IR calibration source, the Keck 2 dome inclinometers, a precipitation sensor interface, the Keck 1 AO electronic vault temperature sensors, the weather mast fan and shelter controller, the list goes on. Anyplace a bit of electronic intelligence is needed for the task.

GenPIC
A PCB assembly in layout
Of course the challenge is that each of these controllers has been hand wired and built for a specific task. This takes a few hours of running little wires on a perfboard. And while I enjoy such wiring, it does make the task take notably longer.

While a couple of my microcontroller designs have been laid out on proper circuit cards, like the SciMeasure camera exposure controllers, I have never laid out a general purpose microcontroller PCB. This is not for lack of thinking about it, so many times I have considered this could be so much easier if I could only invest a little time in a layout.

Continue reading “GenPIC, A Microcontroller Utility PCB”

An Old Project

I have been messing about with electronic circuitry for almost four decades. I recently came across an early example of my work. The device is a digital event counter built around classic 74xx series logic. A chain of 74190 decade counters feed a set of 7447 decoder drivers and seven segment LED displays. A plastic project case with switches and connectors reminds me I have been building little devices for a very long time.

A Digital Event Counter
A digital event counter built when I was fifteen years old.
In some ways the unit is very similar to one of my more recent builds. Perfboard and point-to-point wiring are still standard construction techniques. The technology may have changed across the years, becoming far more complex, but some parts have remained the same.

Continue reading “An Old Project”

The Most Complex of Puzzles

I am currently putting the finishing touches on another printed circuit board.

GenPIC
A PCB assembly in layout
Layout of a printed circuit board, or PCB, is one of the most complex puzzles I know. Creating a complex PCB takes a great deal of knowledge, a lot of patience, and a robust set of puzzle solving skills. These are the same sort of puzzle skills that might be used to solve a Sudoku or a tough crossword puzzle. Seeing patterns, spotting errors, trial and error, planning ahead, all skills used to their utmost in laying out a PCB.

A PCB is laid out with specialized software, drawn on the computer screen. The software can then generate CAM files that are sent to a board house, a manufacturer who can take these files and create a physical PCB. The PCB is thin layers of copper etched to create the patterns of traces laminated onto a fiberglass substrate. When designing the PCB each component, each copper conductor, each trace, is carefully positioned by the designer on the screen, dragging objects colored lines about to create a solution.

Continue reading “The Most Complex of Puzzles”