Saturday, 17 March 2018

One More Step

Here is a post one of the Raspberry Pi User Group members put together on fixing their stairs. It goes to show what a little industriousness can do!

If you need to increase the size of the webpage you are reading:
Ctrl +
Ctrl -
Revert to the default size:
Ctrl - 0
I decided it was time to redo my 100-year-old (literally) stairs. Replacing them was financially out of the picture. They had many coats of paint on them and removing the carpeting left lots of nail/staple holes, so stripping and refinishing was out. That left painting as the only viable option.

The balusters were finished with a very dark stain, including lots of runs and blobs. There were a lot of squeaks to be silenced, trim to be replaced, and a landing that had to be rebuilt. With the amount of work required, I decided it would be much easier to remove the balusters rather than work around them.

I didn't think to take a "before" picture, so this is a "during" picture, with the balusters and trim removed, handrail cleaned up, squeaks fixed, and some holes patched.

Further on, some painting done, more holes and dings patched.

Painting the balusters was still going to be a hassle, but I thought, "what if I could make something to turn them slowly while I just held the brush?" I decided to aim for 20 RPM, or one revolution in 3 seconds. The whole project had to consist of parts on hand and not be more work than it was worth for a one-off.

I didn't have any motors that I could easily make turn slowly enough. I did have a 24V cordless drill that still "drilled" fine, but its batteries wouldn't take a charge. Of course it would run *way* too fast at 24V. I wondered how it would run at a lower voltage and, if my experiment let the smoke out, it wouldn't really matter.

I only had one adjustable power supply with enough juice to drive the drill but it wouldn't adjust lower than 8 VDC. That was still too fast. Again, not wanting overkill for a one-off job, I played with available power resistors in the DC line until I found a combination that would drop enough voltage without burning up. That got me down to 30 RPM, or one revolution in 2 seconds. Close enough!

This is the end product, power supply not shown:

Of course balusters are all different lengths so the "head" of the unit slides on a piece of T-track to accommodate each baluster. Most of the baluster is painted in the jig, removed, situated to dry, and the top section painted.

Is it a slow lathe or a fast rotisserie? Who knows?

Balusters painted:

And finally:

Saturday, 17 February 2018

Pre-Meeting, February 17, 2018 - Arduino Shift Register Control of R-2R 8-bit DAC to Astable Multi-vibrator (1/2 556 Timer)

Hi Y'all!
We hope to see y'all tomorrow at the RPUG Meeting at the library. I have been working on getting a shift register to control the frequency played by an astable 555 timer. Two shift registers are connected to LEDs at this point so it is pretty close. I am building the astable multi-vibrator right now.
The idea is to test the breadboarded device with one shift register. That will give it 8 bits to work with: 5V / 255 = 19.6 mV per bit.
Once I get that running, I will expand the DAC to more than 8 bits, giving more resolution to the frequency. Blah, blah, blah, until you realize that with more bits, you get greater control over the tones you can play. One of the interesting possibilities of using shift registers to control R-2R DACs is that you control the bit resolution. You can pick and choose how many bits are used to control each device. A web search on R-2R DACs will give you the idea that I am talking about. I can take 4 bits from one shift register to add to the first shift register and then use the remaining 4 bits to control something else.
An Arduino Nano is the brains at the moment but it should work with any other Arduino, even a 3V one, such as an Arduino Due. A 3V signal still registers with 5V logic ICs as a high signal so all that stuff will work. Watch out trying to go the other way, sending 5V signals to a 3V device. Many 3V devices will be damaged by 5V signals.
See you tomorrow!

Look for the next post with schematics and equations for all that technical stuff.

Wednesday, 20 December 2017

Raspberry Pi User Group Meeting - November 19, 2017

We have a few core people who show to our meetings at the New Glasgow Library. This meeting was no different that way.

What was new was the free Stepped Tone Generator / APC kit we have to offer. The Stepped Tone Generator is actually a circuit taken from "Engineer's Mini Notebook, Vol.1 - Timer, Op Amp & Optoelectronic Circuits & Projects," by Forrest Mims III. APC or Atari Punk Console is the name that was given to the circuit by some electronics designer who made it their own. The circuit's sound is pretty lo-fi so imagine something that might come from an old 80's video game, thus the APC name. The circuit's central component is the 555 timer. I am writing another post with this circuit so you can also reference that post as well.

We built one of the kits that I had to make sure all the components worked and they did. I also had another circuit of the same that I had made before and had taken to the meeting. We tried to get it to work but found it did not. Well, ... time to troubleshoot.

Stepped Tone Generator / APC Schematic:


Anytime something does not work in your electronics projects is an opportunity to learn and to practice. Now, it had been sometime since I had to troubleshoot anything past something like a misplaced power supply lead to one of my circuits. It took a little time to figure out what was wrong. Even then, it was only after we had fixed the circuit had I realized what must have been wrong.

We started out checking all the wires to see if any were missing or misplaced. Then we started using the DMM (digital multi-meter). We swapped speakers and even IC's. While using the DMM it was seen that the voltage level on the middle lead one of the pots was not as it should be.

We are using the square blue trimpots for the kits because they are 1) more convenient to use in solderless breadboards and 2) they cost a lot less per item. To use a metal potentiometer would require at least leads soldered on to the lugs and then, if it were not mounted on something, it would hang free, useable but subject to disconnecting easily. Below are some examples of trimpots. Note that one is on its side and how that relates to the problem I found as described below.

The point is that little blue trimpots can look like they are correctly inserted into a solderless breadboard when they are not. Without really realizing what was wrong with the pot, it was removed, reinserted into an unused portion of the solderless breadboard and leads inserted into appropriate holes to allow DMM leads to take measurements. The pot was fine. It was reinserted into the circuit and presto, the circuit worked.

After the meeting, I realized that yes, the problem was with the potentiometer. It must have been inserted sideways so that two of the leads were connected and the third lead connected to the rest of the circuit to follow. However, the lead that was supposed to be connected to the power rail was not. So no power was supplied to the variable voltage divider found on the left side of the schematic.

Wednesday, 13 December 2017

A Beginner's Journey into DIY Synthesis

Hi. If you have found this blog, surprise! You have stumbled upon a pretty new blog on DIY synthesis, for music, not for another field of electronics such as Ham Radio.

My name is Bruce and I have been building occasional projects in electronics for a number of years. Lately, I would like to have a general focus on music. Music is another hobby of mine. I play guitars and have a Casio XW-G1 synthesizer. Patchblocks are another type of synthesizer that I have recently started exploring. The room to move with this platform is so great and not a bad way to learn about how synthesis modules are put together. Patchblocks software is free to try out. Just stick with learning the tutorials found in the IDE and you will make some interesting sounds. There are also a number of ready-to-go patches before you even learn how to program. Really cool stuff.

One thing I have found over the years is that after playing a musical instrument, I began appreciating other genres of music. Originally, I like rock, classic rock and alternative. Learning how to play harmonica (my first choice in musical instruments) and then guitar, really opened up my horizons. I started to listen to more country and folk music. I appreciate some electronic music, some bluegrass, a little more metal, more classical and some that I find hard to pin down.

To bring this rambling back to DIY synthesis, I will purport that one type or area of electronic synthesis is superior over another, at least not yet. I know that some synthesizers sound better than others and there are many that are classics. What is comes down to some of the time is that you buy, use, and make what you can afford. Budget it whatever way you like so if you really want to stick with only exploring analog circuits, save for a bit and buy what you need. I like to explore a lot of different areas of electronics so I have Arduino's, PIC IC's, Basic Stamp II's, LM324's, 555 and 556 Timer IC's, as well as a number of other components.

Books tend to be a great resource for me. I have some electronic engineering technician textbooks, some hobby electronics books that cover a wide range of topics and lots of other books. Programming languages are also great. I have experimented with C, Arduino C, C++, BASIC, and Python. Processing is another environment that I have dabbled in and think has great potential for me. Just look at the Processing Exhibition page and you see lots of different project ranging from physical interaction to data collection and representation.

In the blog entries to come, do not be surprised to see one area covered such as oscillators made from analog circuits and then others made from digital IC's. I hope to have some interested readers so drop a line if you like. Let me know what you think.

Sunday, 22 October 2017

Raspberry Pi User Group Meeting (RPUG) - October 15, 2017

Our last meeting at the New Glasgow Library was pretty low key. We are looking at putting together some workshops on basic and some not-so-basic topics.

I really want to make a simple project - a Four Op Amp Function Generator. Forrest Mims provides a schematic in his first Engineer's notebook. You can find all kinds of examples of schematics online. One of the nice things is that it can fit on a single solderless breadboard. There are even IC's that come in packages containing 4 op amps although any op amp should work. I plan on using an LM324. They are on order.

I have some other IC's of op amps, actually some NTE947's for which I used the pinout to redraw the schematic. One of the nice things of drawing schematics using IC's is that you can often just use the old schematic and change the pin numbers specified by the new IC. If you have ever tried to draw a schematic using the pinout of an IC, you will quickly realize that there is an art to the whole thing.

Look for a workshop coming soon.

... by the way, I am also taking a ham radio course with the local amateur radio club, Pictou County Amateur Radio Club.

Here is their link:
Pictou County Amateur Radio Club,

Saturday, 21 October 2017

ESP8266 / nodeMCU and DHT11

October 21, 2017

This will be a short post. This will have a date on it, I am sure. But, I am posting material that will likely become dated soon, so I want that in the text of the post as well.

The ESP8266 IC is a great boon to the electronics hobbyist. I have been using a nodeMCU version lately and have had some good amount of success although there has been a lot of digging to get things to work correctly.

While using information found on the Web is usually free, I still like books. So, I bought a book: "Internet of Things with ESP8266," by Marco Schwartz - in PDF.

After spending several hours on the small project of getting a DHT11 sensor to work with my nodeMCU, I finally figured out that my DHT libaries were out-of-date. The simple solution was to install Adafruit's DHT library and their Adafruit_Sensor library.

Here is the link to using a DHTXX sensor on Adafruit:

My setup is seen below:

The thing to realize, when you use an ESP8266 module of some sort. is that you need to know what pins are being used in the Arduino code. Here is a typical image of a nodeMCU layout:
A little hint: when you go to write your code in the Arduino IDE, make sure you use the correct pin. Looking at the layout above, D1 is GPIO5. In a typical DHT11 example program you will see digital pin 2 used to get data from the sensor. I changed that to 5, as was in the code in the book. The point is that nodeMCU pins will often not work with with Arduino board code and changes will be needed. Then you also have to make sure you are getting the correct numbers for whatever ESP8266 module you are using.

I will not bother posting the code as you can find it online in different places. Hopefully, it will be enough assistance to those with similar problems in keeping their libraries up-to-date. I guess that is my own lesson as well. If I come across more problems that I are worth posting, I will.

Friday, 6 October 2017

Raspberry Pi User Group Meeting, September 24, 2017

RPUG had its first meeting of the season Sunday, September 24, 2017, 2-5pm.

Where?       New Glasgow Library
                   182 Dalhousie Street
                   New Glasgow, NS

We will be meeting the 3rd Sunday of the month for the rest of the season. Easy to remember but here is the list of the dates:

October 15, 2 - 4:30pm
November 19, 2 - 4:30pm
December 17, 2 - 4:30pm
January 21, 2 - 4:30pm
February 18, 2 - 4:30pm
March 18, 2 - 4:30pm
April 15, 2 - 4:30pm

Once the library closes on Sundays for the season we will be considering whether or not to continue for a couple of months on Saturdays and then stop for the summer.

As I needed the photocells for another project this summer, I took the mounted ones from the robot. During the RPUG meeting we decided to figure out how the line sensor works. Here is a picture of the underside of the robot with the line sensor on the right:
We connected the line sensor to the Boarduino, wrote a quick sketch to test it, and started figuring it out. The nice thing about sensors connected to Arduinos is that many of them have three connections: power usually at 5V, a common or GND, and a signal. The signal tends to be an analog voltage. However, because Arduino often uses the PWM pins to simulate an analogue voltage, I will be checking the output signal of this line sensor with an oscilloscope. If it is truly an analogue output signal, the reading on the oscilloscope will be a steady level voltage. If uses PWM to simulate an analogue voltage, the output will be a rectangle wave with high side, the duty cycle varies with the higher the voltage.

What the ADC sees on the Arduino is that the voltage from the sensor signal actually takes time to fall to zero. If not, the ADC would have to provide numbers that reflected both high and low values of the signal. This topic can be searched on the Web if more is needed.

Here is a simple sketch to test the line sensor:
/* program: robot_line_follow_2_blog.ino
 * This program is used to test the line sensor only.
int line_sensor = 0;  // variable to hold data from reading infrared sensor on A3

int analogPin3 = 3; // the line sensor is connected to this ADC

void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);

void loop() {
  int drive_type;
  Serial.println("Inside loop");
  line_sensor = analogRead(analogPin3);
  Serial.print("line_sensor = ");


When the sensor is first tested, it could be that it is not adjusted properly. We figured that out without too much experimenting and without looking up a tutorial online. In the picture there is a trim pot with a white top that allows for a Phillips head screwdriver. With the sensor powered, turn the pot until the red LED turns on.

At that point, when the program runs, the red LED should shine and placing something black under the sensor will turn the red LED off and the readings will change from a low number (around 8 to 12 with no dark object) to a high number (around 800 to 920 with a dark object). When this happens, you know the line sensor works properly.

It might happen that your line sensor goes from on to off when you set the robot (or whatever your project is) down. Readjust the trim pot and set it down again. Keep adjusting the trim pot until the red LED stays lit. Test again.

What happened to us when we first tested it were ADC readings that varied from  800 (no black object under the sensor) to approximately 920 (with a black object under the sensor). You could operate your line sensor that way and write your program accordingly. This might even be useful if your line to follow might be some other colour than dark black. The red LED was not lit when the line sensor was used in this manner.

We also took some time to test the motors by using some arbitrary programming. The idea was to get the robot to turn one direction and then the other. It only turned left and periodically more sharply left than others, even when it was told to go right. Looking back it is, what was happening was the use of PWM on geared motors needs the motors to be signalled to completely stop or changed direction for a long enough period of time so the momentum does not carry the robot through its last turn.

Look for some general electronics tutorials in the future, especially to be provided at the RPUG Meetings. I am currently working on one involving 555 and 556 timers - Forrest Mims' Stepped Tone Generator (on the Web aka APC or Atari Punk Console). Another planned tutorial for the near future is a commonly found Four Op Amp Function Generator. However, my addition will be control of frequency using an Arduino to provide high resolution control with an R-2R Ladder Network DAC. It would be in the neighbourhood of 16-bit resolution with two 74HC595 shift registers. Of course, some of these will also look on putting an RPi spin on the topic.