Very Long Period Monostable (Using Ripple Counter)

Sometimes you want a monostable that goes for hours or even days when triggered, this is usually when your RC components get unfeasibly large or just unavailable to buy. This is when you need to start looking for other methods of latching for long periods of time.


While dissecting an extractor fan the other day, I came across a strange chip that initially looked out of place. However, upon further pondering I realised this was used to trigger the fan to stay on for minutes to hours of time as appose to the usual seconds of normal monostable circuits.
The chip used is a 'ripple counter', a 'binary up-counter' or a 'divider' circuit; it can have many names. The callsign divider makes the most sense in this context as we are dividing a frequency (or multiplying the time period) of an input.
What I have created in the picture above is a recreation of what I imagine is going on using a 7 bit divider with an astable input running at a low frequency. The ripple counter will count up in binary until the Q7 output is high, which will shunt the astable clock input to ground. The circuit will be frozen until the reset is triggered high, turning Q7 off and re-initialising the binary count from zero.

Q7 controls our digital output, in this example I have used a DC motor as that was what I was working with. Q7 is an active low monostable output so we need to invert it using a simple mosfet inverter circuit, the second mosfet on the right drives the motor at its desired current.

The ripple counter I have used is a 4024B 7bit counter, but to increase the possible time you could choose an IC with more Q outputs. Alternatively you do not need to use Q7 on this chip you could a lower output which will give you a shorter period.

The counter is incremented every time the clock gives a rising edge which means the monostable will be a function of the frequency period of the astable.

The equation to quantify this is (Astable period)  x  2^(Qnumber) = Monostable period.

Simple 555 Variable PWM Astable Oscillator

I came across this circuit the other while trying to make a simple open loop control system for driving DC motors and other non-feedback actuators. Another good use for the 555 chip is a variable PWM circuit that isn't that dissimilar from the regular 555 oscillator.
Familiar right?
See my 'Circuit Help Index' for help on 555 astables.

We can take the normal RC timing circuit and modify how fast the timer rises and falls as the current moves in different directions using diodes which are of course directional. Essentially controlling the 'mark-space ratio' of the oscillator through differing the RC constant in each direction.

We can make the circuit variable by adding a variable resistor in one direction, a good rule of thumb value for this resistor would be twice the size of the fixed resistor as you will be able to get a duty cycle range of around 0 - 70% or more if you increase the size of the variable reistor relative to the fixed resistor.

I hope you find this useful.

Putty Serial Monitor for Arduino

I have found that the serial monitor provided by the arduino SDK is very useful for monitoring what your arduino is doing but can be limited with how it outputs the data essecially if you have very fast streams of serial data using the highest baud rate available. It starts to become a bit much to monitor with the naked eye if you cannot use delay fuctions so why no have some sort of static tabular form for your variables?

Unfortunately the Arduino serial monitor doesn't seem to support this sort of functionality, fortunelty I have a very simple and quick solution to this formatting problem.

Using the popular freeware program putty we can monitor our USB COM ports just as easily as we can with the built in serial monitor. It will take second to download and requires no installation. Best of all it can be used for other application environments such as monitoring networks or remotely accessing computers so it is worth downloading this small but powerfull program.

Using the puTTy program we can set up our serial monitor with a lot more formatting options for monitoring lots of changing data in a managable structure such as tables. Best of all it requires barely any change to the arduino code, apart from telling the terminal how to ouput the data with nothing more than some additions to our Serial.print() functions.

This is what you will see by default when you start the program, in order to monitor your arduino you will need to click the radio button labeled 'Serial' on the right hand side of the window. This will take you to the serial monitor context options.
Now in order to show your Arduino data you need to check two things on the Arduino SDK one is what 'COM' port your arduino comunicates on (it should tell you under Tools/Serial Port) you need to know this anyway in order to upload your code. Simply change this to COM(port number) e.g. COM4 to monitor on the correct port or putty will output an error when you try to run it.

The other think you need to know is what speed your Arduino is outputting at so when you start your serial communication in your code (e.g. Serial.begin(9600)) putty seems to default to 9600 anyway so you may not need to change this number if you have declared it as so in your code.

This next step is simple, upload your code using the Arduino SDK 'upload' button, then once it has done use the 'open' button on the putty window to initialise the serial monitor. You should see something that looks like the MS-DOS prompt recording your arduino outputs.

Seemingly pointless at the moment yes, but if we want to put our outputs in a specific format this is where using this method becomes advantageous...


Now if we want to tabulate our data in a contantly updating format all that needs to be done is to tell the putty serial monitor what we want done, this is where using this method is better than using the defaut Arduino serial monitor.

To give command to putty we just send it messages via the Serial.print() method.
Putty comands ussaly start with sending the ESC key in ascii format to do this we add a line in the arduino code:
Serial.write(27); (27 is the ESC key in ascii)

After the ESC key we then send our putty commnd, in order to constantly update in the same data format we need to return the putty terminal cursor to the top left corner of the window by writing:
Serial.writ("[H"); (returns the cursor to home)

By doing this the cursor will constantly update the data in the window by overwriting what was there originally. This will allow us to use a loop to dynamically probe and output our data in a more static  (non-scrolling) tabular format, making it much easier to read in monitor lots of constantly changing data.

Ingress Protection (IP) Ratings

Here we see an old windows 98 computer motherboard that I was stripping down for the power supply module and other parts.
I opened up the lid of the box to find a very grubby and lint covered motherboard, I imagine that this has accumulated over about 15 years in a workshop environment. I thought this would be a good example of where ingress can be damaging to your electronics, especially in this magnitude, as this could be considered a fire hazard around the heat sinks.

This is a good example of bad ingress protection as the protective box has gaping holes in it for ventilation but lets in a lot of environmental matter and water which is essentially what the IP ratings of electronic products are quantifying.

The IP rating or Ingress Protection rating is categorised by two numbers.

The first being the solid object protection rating and goes from 0 to 6 for example:
  • 0 is no protection i.e. exposed circuit boards etc. 
  • 4 is for protection against objects bigger than 1mm 
  • 5 is protection against most dust
  • 6 total solid object protection (no dust).

The second number is the liquid protection and is categorised by number between 0 and 8.
  • 0 is no protective shield i.e. exposed circuits etc.
  • 1 is protection from vertically falling water.
  • 5 is protection against low pressure water jets from any direction.
  • Up to 8 which is long periods of pressurised immersion underwater.

The format of the number is given like: IP65 which wold be a product that is protected against all dust and low pressure jets of water. A lot of retailers or manufacturers like to boast good ingress so you may see this number explicitly listed on the product specification.

So keep your eyes peeled as it may affect the performance and reliability of some of the projects you work on, especially in dirty or exposed environments.

Easy, Simple Voltage Controlled Oscillator (VCO) or Frequency Modulator (FM)

So as an extension to my post on easy amplitude modulator circuits, we can use the same method in order to make a very simple voltage controlled oscillator. There are a few oscillator circuits that could be used but for now I will use a simple schmitt trigger relaxation oscillator.

See my 'Circuit Help Index' page for further help on these circuits.


Easy, Simple Voltage Controlled Amplifier (VCA) or Amplitude Modulator (AM)

It has taken ages, literally years of occasional pondering, for me to realize that there is a way to make a very simple voltage controlled amplifier that doesn't use complex non-linear circuits but rather uses simple resistors.
The advantages of doing it this way is that you can amplify both polarities of a carrier waveform with just one amplifier rather than using something like a push pull amplifier and complex transistor circuits. This also means you can add DC bias to your carrier wave as an alternative to using dual supplies because the circuit will not amplify it.
Fixed gain amplifiers or potentiometer controlled amplifiers have been my limit when creating analogue circuits but despite my knowledge about oscillators, filters and amplifiers in signal processing circuitry it seems silly that this has never occurred to me to try to do it this way.

In concept it is essentially voltage controlled resistance which is a brilliant concept when it comes to analogue electronics and there is probably more than one way to do it. For the method I will use it uses two components:
  1. An LDR (light dependent resistor).
  2. An LED or generic light bulb.
It requires no dual supply or any bipolar circuits such as a push pull amplifier.
Voltage Controlled Amplifier

Cheap, Alternative, High Power, Bench Power Supply (Fixed or Variable PWM Switch Mode)


So if you are adverse to spending money like me and don’t want to fork out for a flexible DC bench power-supply then I may have a decent alternative for you.

A lot of people will have an old desktop computer lying about at work or in their homes that usually get thrown out or horded in the attic.

Well you can put it to good use if you take the power supply out of the back, it is a nice stable fan cooled voltage regulator with potentials of 12v, 5v for CMOS logic applications and 3.3v for those TTL hipsters.

If you don’t have an old desktop you can get a tidy 450W module for around £10 ≈ $15.

You 12v supply is used for various applications including vehicle electronics, a lot of industrial electronics and a lot of COTS actuators such as motors and pumps. (The power output will be more than enough to drive any home automation projects).

Your 5v Supply can be used to charge your phone if you’re willing to cut up an old micro USB cable (make sure you use the correct wires though) and because computer supplies usually have lots of ports you can run multiple devices such as an Arduino or Raspberry Pi at the same time.

If you are feeling adventurous then you could implement you own PWM switch mode supply controlling the output voltage with a potentiometer.




The circuit duagram above shows a simple PWM circuit. The duty cycle of the outputted square wave is controlled by the potentiometer. Because of the DC offset of the 555 timer you will need to compensate by adding resistors to the potential divider circuit to keep the potentiometer output voltage within the limits of the triangle wave output voltage of the 555 timer.

The duty cycle of the PWM wave is the percentage time spend at the 'high' voltage over the overall period of the wave and as such if you control the duty cycle of the wave you can map that to what percentage of your input voltage will be the average output. (12v input, at 50% duty cycle will give you 6v on average).

I have used a P-channel MOSFET as a power buffer for the PWM signal coming out of the operational amplifier. It is P-channel because it will be using the power supply as a reference which means that current will be flowing when the op-amp output is low (keep this in mind).

Then after the PWM output you will need to connect a smoothing circuit, I am using a second order LC circuit to cut the AC components of the PWM signal to give a smoothed average DC voltage from the 12v supply. You could use a first order LR circuit which would have no resonance frequency but less filtering effect.