December 8, 2014, 10:28 pm
I couldn’t find any dimension data on the Casio F91W (or module 593 which is used in it) online, and I’ve been wanting to use it for a project (replace the electronics with an MSP430 and my own display). Anyway, took some photos for my reference and am sticking them here in case they’re of use to anyone else!


December 8, 2014, 4:13 pm

After making a simple oscillator using a relay yesterday. I decided to move on to transistors today. This mirrors the technological development of oscillators. The original oscillators used in radio transmission were based on spark caps. A capacitor would charge for a DC supply until it built up enough potential to jump a spark gap allowing the current to discharge and the whole process to start again:

While I’ve seen referencing say they could reach MHz speeds with spark gaps (which surprises me!) it seems unlikely that they were particularly reliable, the resulting signal was obviously far from a clean sine wave. For this reason radio transmission oscillators migrated briefly to a more typical electromechanical approach, alternators!

The wikipedia page is hugely informative, and describes alternators producing frequencies up to a 100Khz! Some of which were still in operation in the 1950s.
However, their useful life was rather brief, as these oscillators were quickly replaced by active valve and transistors designs.
So today I decided to look at the Astable multivariator, a 2 transistor oscillator. Wikipedia provides the schematic below:

Which I put together using a 2N3904. I used a 100uF capacitor and 200Ohm and 1.2K resistors. This resulted in a frequency of ~6Hz. Which given the frequency determining equation derived on the wikipedia page of f=0.72/RC is approximately correct.

My basic understanding of the circuit is as follows. You can basically ignore R1 and R4, they simply limit the current going through the transistor, and into the capacitors (see note [1]). They are relatively small values (as compared with R2 and R3). When power is applied, one of Q1 or Q2 will be conducting more than the other. When the transistor conducts, it allows the capacitor on it’s base to charge up very quickly though that small resistor. This makes the other side of the capacitor negative with respect to ground (e.g. -5V if you’re using a 5V supply). This strong negative potential forces the other transistor open. The negative charge on the capacitor slowly discharges through the larger resistor (R2/R3), equalizing the charge on both sides of the capacitor. As this negative potential discharges, it rises above the transistors transition voltage and allows the other transistor to start conducting. It’s transistor now charges up very quickly, forcing a negative potential onto it’s other side, making the other transistor an open circuit and starting the process all over again.
Hopefully the following iCircuit spice simulation also makes things clear (you can download the iCircuit file here).
I also liked this video, it helped me a lot:
[1] This is probably a wrong interpretation, see my EEstackexchange question.
Category:
Uncategorized |
Comments Off on Astable multivibrator oscillator and a little oscillator history
December 7, 2014, 3:30 pm

One of the problems with basic electronics courses is that before you start learning about active components (transistors, diodes etc) there isn’t much fun you can have. Passive components are… well passive and we’ve grown accustomed to using active components whenever we need to generate non-DC signals.
So I was sitting in the bath, wondering if it was possible to make a passive component oscillator. A little googling, found some early oscillator designs that used delay lines. But I didn’t have the required components. But I did have some relays…
Now, I’m not sure if I’d classify a relay as a passive component but they are at least simple electromechanical devices, which can be easily understood. But they are suprisingly powerful, in fact some of the earliest computer designs were based solely on relays.
I thought that using a DC supply, I could charge a capacitor until it builds up enough voltage to switch a relay, which cuts the supply, allowing the capacitor to discharge, flipping the relay back to the on position, which would start the process all over again. Hopefully the following schematic makes things clear:

I used a 9V supply, a 5V relay, 1000uF capacitor and a 200Ohm resistor. I also put a 1K resistor in parallel with the 200Ohm so I could play with the frequency. It circuit works reasonably well, though only up to around 15Hz! The output produces reasonable looking sawtooth patterns:

Category:
Uncategorized |
Comments Off on Electromechanical Oscillator
December 7, 2014, 3:19 am
One of the majority deficiencies in C++ has always been the lack of a simple standard method to convert to and from strings to numeric types. The C language extensions atoi and itoa are often available, but obviously only deal with integer types, and are non-standard. Cx11 appears to introduce these features in stoi and to_string methods.
However, adapted from the C++ FAQ this is the stringify.h header I’ve always used. It conveniently templatises the conversion (at least one example of templates not causing pain and suffering!). So you can convert a string to a double as:
double d = convertTo<double>(mystring);
Or convert a double to a string with:
string s = stringify(d);
#include <sstream>
#include <iostream>
#include <string>
#include <stdexcept>
#ifndef STRINGIFY_H
#define STRINGIFY_H
class BadConversion : public std::runtime_error {
public:
BadConversion(const std::string& s)
: std::runtime_error(s) {}
};
template<class _type>
inline std::string stringify(_type x)
{
std::ostringstream o;
if (!(o << std::fixed << x))
throw BadConversion("stringify()");
return o.str();
}
template<class _type>
inline _type convertTo(const std::string& s)
{
std::istringstream i(s);
_type x;
if (!(i >> x))
throw BadConversion("convertTo(\"" + s + "\")");
return x;
}
#endif
Category:
Uncategorized |
Comments Off on C++ convert to/from string