Embedded - 276: Playing a Song on a Potato
Episode Date: January 31, 2019Jesse Rutherford (@BentTronics) gave us an in-depth look at the 555 timer IC (wiki). Jesse runs Bent-tronics.com and wrote The Ultimate Beginner's Guide to the 555 Timer (Amazon). Some great 555 proje...cts: 555 Decimal Adding Machine 555 found in a drill trigger speed controller as seen on the Ben Heck Show 555 found inside a solar charger controller, video by Julian Ilett Somehow, despite it being in the plan, we didn’t mention the Evil Mad Scientist The Three Fives Kit: A Discrete 555 Timer which builds a 555 Timer out of discrete parts. If only the creator would come on to talk about it and his other cool projects. Note that EMS also has a great description of how the 555 timer works. The giveaway is Jesse’s book and the components to build the projects in his book.
Transcript
Discussion (0)
Hello and welcome to Embedded. I am Alicia White here with Christopher White and today we're going
to talk about the most popular IC of all time, Carmen Flow! And we're going to talk with Jesse
Rutherford of Bentronics about this most popular IC of all time, Karma Flow.
Hey, Jesse, how are you doing?
I'm doing pretty good. How about you guys?
We're giddy, apparently.
Jesse, could you tell us a bit about yourself and your background?
Yeah, so I run Bentronics.com and I started that website
in 2005. Originally as a parts store on electronic components, there wasn't much
in existence back then, at least that was affordable to the hobbyist. And over the years, it's kind of morphed and changed.
And now I just kind of focus on hobby electronics.
And I have written a book about said most popular IC, the 555 timer.
And so I guess, you know, that's another thing among the many other occupations I've had over the years.
Well, we're going to talk a lot about this 555 timer, um, starting with, you know, it's not really a timer, but before we do that, lightning round.
Uh, are you ready?
Sure.
If you're stranded on an Island, would you rather have 555 timers or duct tape?
Duct tape.
You can have as many 555 timers as you want.
You could build a raft.
Right, right.
Maybe some kind of sun reflective signal or something.
A bridge, perhaps.
Yeah, there you go.
You have a project that can be done with N555 timers.
What is the largest value of N that you would build?
Oh, possibly for optimization, N minus one.
I don't know.
Let's ask a different question.
What is the largest number you've seen in a project?
Oh, yeah.
We can talk about this a little bit later,
but there's a really good one that was part of the 555 timer contest a few years ago,
and I think it used 102, 110, somewhere around that number.
So that's the most I've ever seen incorporated to anything.
That's a lot.
What's the most bizarre 555 timer project you've ever seen?
Oh, let's see.
I've seen it incorporated into maybe bizarre art displays but as far as uh the actual use of it
there's some really interesting things with radio frequency people building transmitters um things
like that that are really i don't want to say misusing it, but finding very creative ways to use it.
And I think that's a very good thing, kind of exploiting what little resources you have available.
What's your favorite vendor of 555 timer hashes?
I am going to have to go with Texas Instruments, mainly because I think they have the best data sheets, both as far as the specs they list, but they usually have practical applications for any of their chips.
So you can actually get project ideas just by reading TI's data sheets.
Cool.
And do you have a tip everyone should know?
Yeah, I really struggled.
I came up with probably quite a few dozen.
So, and my favorite was given a few months ago with the arrow that points to which side
the gas tank door was on.
So I guess I'll have to go with another one of,
and I'm just kind of randomly picking this at a stuff,
but I guess when I was taught in school
how many weeks are in a month,
for some strange reason,
it was always taught that there's four weeks in a month.
And that can really end up screwing you up later,
especially when you're doing things
like calculating salaries or monthly incomes.
And so it's a lot better to go with 4.3 weeks in a month as a better average to figure that out.
It's funny.
Most project managers seem to figure there are five weeks in every month given the amount of work.
Right.
Okay. weeks and every month given the amount of work right okay i think i think by this time people know that we're going to talk about the 555 timer um the thing is i'm we're both software people
and so there's like this thing called the 555 timer but it's not a microcontroller so
why why do i care What's cool about it? how certain people have used it, it could possibly free up
possibly some resources
on, say, a microcontroller
because one of the functions can be
as kind of a crude ADC.
So if you don't want to tie up
maybe some pins on your micro
for that function,
you could definitely implement
a 555 timer.
Also, if you needed maybe an extra source for some pulse width modulation
or detecting strange, you know, how far has this trigger on this electric drill been pulled,
believe it or not, there's 555 timers in a lot
of those types of circuits that are probably interfacing with more complex systems. So those
are a couple of ways that, say, a programmer or software engineer might be interested
in the 555 timer. Okay. One of the first things i read about it was that it is not in
fact a timer as i know it correct um as far as i'm concerned a timer is something you say
count to a million and let me know when you're done right Right. But we call it a five, five, five timer. And why, why, why,
why are you confusing me this way? So I think, uh, I mean, it has a fairly long history that
is well-documented in many places. I briefly mentioned it in the book just because I didn't
want to spend too much time on it, um it because there is so much information out there about its invention and how and why. But I think
because that is one of the first purposes that it was invented was to work as either an oscillator
or a one-shot pulse generator, that people just go ahead and assume that's what it is.
But it's really just a collection of a few basic building blocks.
Obviously, at the transistor level on the actual IC, it's much more complex.
But as far as the building blocks, it's a couple of comparators, an RS flip-flop circuit with a reset,
and that's really
about it.
So the timer part
comes into how you hook up external
components to it,
such as resistors and capacitors.
But you don't
even necessarily have to hook those up.
Now the
555 will behave in different ways that aren't timer or oscillator functions at that point.
More like a latch or a bistable flip-flop type operation.
But it was definitely, I think, intended to be an IC that could help out with timing and oscillator circuits.
Because it can act as an oscillator.
And because it can be turned on and off,
you can have it act like an oscillator for a limited amount of time.
Yeah.
Now that would require usually two 555 timers,
or there's even a package called the 556,
which is basically two 555 timers crammed into the same IC with more pins.
So, yeah, you're correct. You can use one to set the length of time that the other one is going to be on.
So I don't know if that quite answered your question.
We're getting there and we'll get back to that because that's going to have some interesting
effects. So let's talk about the pins. That's a little hard because we're voice only and you
can't see this diagram, but you mentioned there are two comparators.
Yes.
And they go into a flip-flop and then all of that goes out and there's a reset line in there as well.
But the comparators, there's one that goes against VCC?
Yeah. VCC? Yeah, so there's an upper comparator and a lower comparator
and
that is, the
inputs for those are placed
within a resistor divider network
so there
are three resistors
that
go from the positive
rail down to the ground rail
and that in basic electronics creates a
resistor divider so say you were using nine volts as your positive rail the uh in between points of
of the resistors are going to be about one third and and two thirds so say 3.3 volts and 6.6 volts approximately so that's where the inputs to the comparators are
so they're they're comparing things against the upper voltage and they're comparing things against
the lower voltage and that resistor network is inside the chip. It's inside the IC. Correct.
Yeah, that's built in.
One person, as we were talking about doing a show about the 555, said that they knew that the name of it, 555, was pretty just a number.
It didn't mean anything when they built it but he uses it to remember the one-third and two-thirds because
there's five five five and then in between those is you know when he explained it it made a lot
more sense but he liked he liked that there were three fives and that you had to remember the one
third and the two-thirds right well some people think that uh so in a lot of the Silicon,
uh, circuits of a five,
five,
five,
they rely on three five K,
uh,
resistors in that network that we talked about.
Um,
so some people,
uh,
attribute that to the name,
uh,
the inventor,
uh,
uh,
Hans,
uh,
Kamenz and,
uh,
he in, in multiple interviews has denied that that's why the timer, Hans Kamenzend he
in multiple interviews has denied
that that's why the timer
or the IC was called that
that he said that that was just the
product manager's
next available number
in their product catalog
I always thought of it because
5 on
in binary is 010101.
In the scope, you put that on there.
It looks like a square wave.
There you go.
Which is completely wrong.
Using ASCII to explain ICs.
That's my fake explanation of why that is.
Well, I kind of like that one.
It's a little deep, you know.
Okay, so we have a resistor network network which means we have vcc and we
have ground and now we're going to compare uh what is it trigger to the lower one um we're going to
compare a trigger signal that comes in on a pin to one third of vcc. Is that right? Okay. Yes.
And that means that this chip, whatever it's going to do after that, will trigger that comparator.
And there's two here.
Trigger that comparator as long as the trigger is above the voltage, the one third voltage.
Is that right so on that one it's going to hold it uh low so that is going into the negative input of that comparator so that's
where it gets a little tricky is that's inverted so um anything lower so if we go back to our 9-volt example, anything lower than 3.3 volts is going to trigger that because that pin 2 trigger is going into the negative side of the lower comparator.
Electronics is hard because you guys have these little circles I'm supposed to notice that mean not.
Okay, so it's triggered when the trigger signal is low
correct okay um i i can get that i wish they'd said it was not triggered but that's okay
trigger is love right and then there's which which outputs a high so
to make things more confusing you should be used to this by now this is an active low
active love that's the threshold trigger is active love okay and then we have this thing called
threshold and it's another pin into the chip and and don't worry there will be a quiz later on what
all the pins are called um what does threshold do so in theory very close to the same thing as
as pin 2 but now it is comparing uh on the positive input of the comparator so anything above
if we go back to our example of the upper voltage say that's 6.6 volts, so anything above the 6.6 is now going to set
that upper comparator's output to reverse the flip-flop if needed.
Okay, so the threshold, if it's above, will turn on its comparator.
Correct.
And now these two comparators are in parallel.
You can have it be triggered, which would be trigger low,
and thresholded, which would be threshold high.
And now they're both outputting once to this other little component,
which is a flip-flop.
I remember flip-flops.
I knew you can build all kinds of things from flip-flops.
I used to have games about building ICs from flip-flops. I knew you can build all kinds of things from flip-flops. I used to have games about building ICs from flip-flops.
And they were super cool.
And I remember nothing about flip-flops.
Other than that's my preferred shoe because now I live at the beach.
There you go.
What's a flip-flop?
Well, in this case, it's going to be, some people would call it possibly like a memory, maybe like a one-bit memory.
So it's going to either be set at a certain output, either high or low, and then it will remain there until it gets reset. So it basically flips and flops between high and low
depending on the input to it,
whether it's triggered high, triggered low,
and then that's going to change the output status.
But I guess the thing to remember is
it stays in that state until change.
So like I said, it's kind of like a rudimentary memory. Okay. So if I, if I have just a flip-flop
and it's got three pins, it's got a reset pin and an R and an S. If I have both R and S on what happens? What is its output? All right. So now, uh, I don't know how deep on
an audio program we want to go into this cause we're going to get into truth tables and, um,
that usually requires, uh, I guess, whiteboard visual visual visual table well we can gloss over it and say that for some combination
of rss rns right you get certain outputs right yeah so you're either going to get uh highs or
lows or uh there's also not uh in functions or functions things like that. So, and I don't have a table in front of me,
so I don't want to misquote anything of the logic on it.
But yeah, so that's,
you can get into all kinds of circuit building,
meaning building more complex circuits
based on the fact that you have this flip-flop chip inside.
And as I kind of alluded
to earlier, you can build some pretty complex systems. The project I mentioned that was on the
555 contest, it ended up being a very rudimentary computer, actually. It was called an adding
machine. And in fact,
it was called five,
five,
five decimal adding machine.
If you look that up on YouTube,
it's a pretty amazing,
uh,
work of logic,
uh,
gates you using five,
five,
five timers.
Okay.
So that's one of the really cool things is that this,
these flip-flops,
they do,
they're the basis for like,
and, and and or and and
and those those components are the basis for everything i mean like that's that's how it all
works um and i like the idea that the 555 has a flip-flop in it, and there is a mode with the 555 that basically it acts like a flip-flop.
Is that bistable mode?
Yeah.
And so what's interesting about that is you could call that, in a way, it could act as a comparator or a switch of its own, but it's a very special type of one called a Schmidt trigger.
And the difference between, say, a regular comparator is, let's say we have a reference voltage of 5 volts.
On a regular comparator, it's going to be like, well, okay, everything above 5 volts, this happens.
Everything below 5 volts, this other thing happens.
To where the Schmitt trigger is laid out how the 555 is with the upper and lower comparators.
So it has to cross an upper threshold, and then it's not going to reverse until it crosses a lower threshold, which is different than the upper.
So there's this kind of no man's land in between and then that gets into uh theories of
hysteresis and so basically what that means is that input voltage can vary between those two
levels before something gets gets triggered and you elicia might be interested in a little bit of that because uh
the fellow who invented that auto schmidt was actually doing research on squid nerves when he
came up with that electric circuit and so that's that's how it came about excuse me i need to go
google some stuff okay so one of the nice things about the smith's trigger as you
described it is that if i'm running on a battery and my input voltage decreases i can have a lower
trigger because my overall circuit vCC has gone down.
Right.
And that's really nice for if you have buttons sometimes
and you need to connect them to other things.
And if you're doing it cheap like you do for small toys,
you don't necessarily do all of the resistors for the LEDs
because, hey, that's just
cost. And so the battery voltage and whether or not you're high or low can be kind of dirty,
like remarkably dirty, and the Schmidt trigger cleans it up.
Yeah. And another good advantage to it when it comes to, say, the 555 timer is your timing cycles are much more independent of your voltage, as you mentioned.
So if you have a battery-operated oscillating circuit thing, the frequency at which it's oscillating shouldn't change too much.
There are some other variables that can be included in that, but for the most part, as your battery drains from 9 volts to
8 volts, the timing period shouldn't change because they're independent of that voltage.
It's still just taking the overall one-third and two-thirds of whatever the voltage is coming in.
And then depending on the mode, there is another timing aspect to it.
If there's a capacitor, you can debounce a button so that you push it once,
the signal actually goes brrrring and goes up and down a whole bunch and then this this triggering will just take
it down to one up or down yeah correct so with with the same logic of it's it's going to stay
high or low uh until it receives um an actual trigger above a certain voltage, so if you're talking about contact bounce, things like that,
it's going to nullify that out.
And now there's all kinds of formulas you can use for the RC timing on that
of how long you want the switch to, for lack of a better term,
time out before it's triggered again.
But overall, it's pretty easy to implement,
and there's lots of calculators online to figure that
out. Should we go back and explain hysteresis?
I think we kind of
covered it enough. People can Google things.
It's an important concept. Look it up.
Okay, so now we've talked about bi-stable mode and it being a flip-flop,
and we've talked about a couple of the input pins.
And we didn't really talk about reset, but that's one of the pins.
We talked about that as part of the flip-flop.
And there's an output, of course, because that makes sense.
And then there's a couple more pins
what is this um uh continuous pin oh yeah so the uh control voltage the control voltage that's what
it is right now what that is going to uh affect is the upper comparator when we're talking about the two comparators, the one at the two thirds of the voltage. And there's a few different ways to implement that. And getting into that concept, I thought might be going a little bit into the more intermediate stages.
And there's just hundreds, if not thousands, of articles on the Internet and different books on how to implement the control voltage pin.
But what it does is it changes the reference voltage so once again to go back to if the upper comparator was sitting at
say 6.6 volts the upper two-thirds of your nine volts you can actually apply a voltage to the
pin 5 the control voltage pin that is going to change that reference voltage it's not going to be
the two-thirds anymore and so there's different
interesting things you can do with that so first of all that's going to change uh your thresholds
just overall that's going to change your timing uh your your timing of the the chip and as far as
high time and low time your marks and spaces and then another thing that you can do with that is vary
the output so you know as a reference voltage you usually think of that as a stable thing like say
five volts but you can actually put in some type of alternating waveform, whether it's a sine wave or whatever.
And now it's going to start varying the output timing based on the input wave that you put into the pin 5.
Okay, that's a lot more explanation
than I was ready to put in at that point.
Let's go to the simplest. I mean, the simplest possible use of control voltage. I have this
flip-flop and I'm using it like a Schmidt trigger, and so if something comes in and it's noisy, I'm going to wait until it's clean, and I'm going to put it on the output.
But if I have a control voltage that is not the same as my two-thirds of VCC, how will that change my Schmidt trigger example?
Is it, will it make it so that.
If you could think of the Schmidt trigger as let's say the, the, in a normal operation,
the upper two thirds and the lower two thirds, if you could think of that almost as a window,
right?
So, so we have, that's our window of opportunity.
Everything above that gets triggered to a point, and everything below that, it's going to either open that window wider or narrow that window and make it smaller. voltages or a wider range of voltages, I should say, to initiate the Schmitt trigger, then
you can put in a larger voltage.
If you want to narrow that window, you can drop the voltage.
So I think that's probably the best way.
That's how I picture it in my mind, anyway, is kind of opening and narrowing the window of the hysteresis for the Schmitt trigger.
Oh, okay.
So I am going to explain hysteresis because I'm going to have to put this in a different framing for me.
Gotcha.
The way it was described initially for me really made sense with thermostats in our house.
If you set your thermostat to 70,
then your heater will go,
or I'm going to go with heater since it's winter here,
your heater will go up to 70 and then stop.
But it won't turn on when it gets to 69 or 68.
Usually there's some space where it has to get down to 65 before it turns on again
otherwise it would be going on and off constantly and this hysteresis allows it to go on when it is
needed to be effective and not go on when it's just a little off. Yeah, correct. Because with just a regular voltage comparator or
comparative of any sort, if you're comparing temperatures or whatever the case may be,
that single point, as you mentioned, the second you get over, if it's set at 70,
the second you get over 70, it's going to turn off. And man, the second it just drops below 70, it's going to turn on.
So I think the thermostat example is a good one.
That's usually how I try to explain it to people also.
So yes, the window that the control voltage pin gives you opens or closes that range.
So maybe the heater shuts off once it gets way up to, you know, I say way up, but, you know, maybe just all the way to 71 or higher and then it won't kick on again until below 69.
So 68.9, something like that.
So you can adjust the window that that operating range is in. Okay. So do we have to talk about the discharge pin?
Because I didn't understand that at all.
Well, I mean, we don't have to talk about it much,
but basically, so in the timing circuit,
the capacitor needs to do something
with the voltage that's built up on it.
And so once the flip-flop is reset,
that opens up a transistor inside that then, for lack of a better term,
shunts that capacitor to ground to discharge it.
Could you say that again in other words?
What can I use that for? actually chris is right um what what do i use the i see i totally
ignored the discharge pin i was like ah it discharges things right so if we go to say a
simple oscillator circuit uh i have a few waveform pictures from an oscilloscope in the book.
And so there's going to be a timing cycle that's started either because we just turn the device on
and it's in the oscillator mode, or even if it's in monostable mode, that it's going to start
because we somehow trigger the trigger pin uh low so what
happens is current ends up coming in uh from the voltage rail through uh either one or two resistors
depending on on which kind of mode you have it in and then that charges up a capacitor and the
comparator is is for lack of a better term monitoring the voltage across that
other than that capacitor so then once it hits that two-thirds voltage as it's charging up
that's what triggers the flip-flop to switch and when that switches that opens up the discharge pin that is also connected
to the capacitor to allow it to discharge now it starts discharging down to the one-third voltage
that triggers the comparator and the flip-flop and then the cycle starts over again so
without the discharge pin that capacitor would just charge up and stay charged.
That seems pretty important then.
Yeah, actually. I shouldn't have skipped that.
And there are other ways to implement it that are way more advanced,
but since it's normally used as either an oscillator or a timer, that's kind of where it comes into play is to discharge that capacitor.
Okay.
So now we've met all of the pins.
And we're going to get more complicated with how we put the pins together.
Because part of me is like, okay, this is a trigger-like thing.
It's a flip-flop-like thing.
It creates PWMs somehow.
And yet what was really cool about the whole 555 is that you can put any kind of signal into any one of these pins except for VCC and ground.
And you get all kinds of things out. And when you start building two and three
and 10 of these together, it builds from something simple to something quite complicated.
So as we're getting on that path, let's do monostable. There's a mode called monostable that involves a resistor,
this discharge capacitor, the trigger, the threshold.
I don't think we can do that.
I don't think we can describe the schematic in audio.
But let's just say there is a mode called monostable mode
that requires a few components
and talk about what monostable mode is supposed to do.
Right. At the most basic level, this is going to be the timer function.
So when people refer to it as a timer, this is that mode.
And so just anything that you may need a timer for i mean there's all kinds of circuits uh on
on the internet of like we build your own egg timer or something for gaming you know maybe you
have one minute to to make a decision on a board game or something like that so so that is at its
most basic what the monostable mode is. It creates one shot.
So that's another name for that mode is one shot mode.
It constructs a pulse and you can have that hooked up to a relay.
It could be hooked up to an LED.
It could be hooked up to a lot of different things to basically turn something on for a predetermined amount of time
and then turn it off.
That's kind of the whole gist of monostable mode.
And so if I hook it up to an LED and a button for my trigger,
I activate the trigger and then the LED goes on
for an amount of time that is proportional to my capacitor value.
Capacitor and resistor, yes.
So RC circuit land and timer, and that's where the timer comes in. It's because it's the
length of time it is high or is outputting a signal.
Yeah, correct.
Now then, it can even, in both the monostable and astable modes,
it can get a little more tricky too,
because that pin 3, the output, that goes high,
and that's usually referred to as sourcing current,
so the source of your current for your LED that's on is to as sourcing current so you're you're the source of your current
for your led that's on is coming out while it's high but the whole time that that uh pin is low
and this is also where a discharge uh pin comes in is it creates also a path from vcc down to ground through the transistor on the discharge bin that can also be utilized,
and that's called sinking current. And so you could have two LEDs, actually. So one is on,
let's say there's an LED that's red, and it just sits there being red, and when you press your
button, it turns another LED
green to let you know, hey, this thing is on.
It'll stay green for however
long you've calculated
the resistor and capacitor to be
and then when that timing period is
over, the red LED
is going to come back on.
Okay, so we have red, we push the button
the red goes off, the green goes on
times out, the green goes off, the green goes on.
Time's out, the green goes off, the red goes on.
Correct.
Cool.
And so that's monostable mode.
Yes.
That one's pretty easy to understand.
Unlike astable mode, which is just bonkers.
Could you?
Yeah, I mean, I guess some people might think that only bonkers people think that um it's more of an oscillator in this mode but it's not an
oscillator like i'm used to seeing it's not a crystal that goes up and down on a sine wave
it it's square wave and it's a duty cycle that is dependent on hardware components.
And I hate reading schematics with actual hardware components.
Can't we just all have digital?
Well, technically the output of this is digital.
But the input isn't.
Right. That is correct right that is correct that is correct so um yeah so it can be
used uh as an oscillator like you mentioned because maybe we don't want the button to
trigger the green led maybe we just want to turn it on and it just starts uh flashing the green led
for a certain amount of time and then the red led for a certain amount of time, and then the red LED for a certain amount of time.
And once again, all that can be hooked up at once
because of the sourcing and syncing current abilities of the IC on Pent 3.
So it could be thought of as a very crude automation.
There's projects, I think a popular one that was in a lot of the hobby magazines, say, back in the 80s was, oh, hook this up to a relay to a lamp and then have a really long time period. an hour long and it's going to turn your lamp on while you're not home. And, and so people will
see the lamp turn on inside and maybe think someone is home, some, something like that.
So, so there's, there's some very crude automation type things that could happen with it,
or it could be for timing clocks. There's a lot of very early computers, um, once again,
seventies, eighties, um, that while they might not be using the 555 for the actual master clock,
they are using it for certain oscillators on the boards.
One of the things that was brought up in the Slack channel,
as I was mentioning the show is going to be about the 555 timer,
was opening up fake CCD or security cameras that are just boxes with fake lenses
and a little light inside that blinks using a 5.555 timer because it will just blink forever
on, off, on, off.
And you can, it doesn't have to be 50%, depending on this, these,
this resistors on the outside and capacitor on the outside. It can be on for 10 seconds and then
off for one. You can essentially make your duty cycle be whatever you want it to be.
And that's kind of how we get into the pulse width modulation.
Because by changing this resistors or capacitors,
you can change how long you're up versus how long you're down.
Yes, correct.
So you could replace one of the resistors with a potentiometer,
and then you're going to be able to vary the output stage,
the high and the low, depending on that.
Or another one would be an LDR, like a photo resistor, basically.
And so you could wave your hand over it,
and that's going to change the duty cycle of your wave.
Okay, so the first one was sort of dimming an LED,
because as you turn the potentiometer,
the output will have more high time or more low time,
and you'll get a brighter LED versus a dimmer LED.
The second one, the second one that you mentioned, a photodiode.
And depending on how much you cover it, you get a different stream.
And that's where we start looking at light theremins, right?
Where you move your hands around and it makes different sounds.
Yeah. And so that's a pretty popular project. Once again, that was in a lot of magazines or on certain websites and it's basically any kind of change in resistance at that point is going
to start changing the frequency on the the output and if you have a speaker
hooked up and it's in the the audio range then yeah that's going to change the tone so there's
lots of things that call themselves light theremins you know that's a pretty crude term
if if you understand how real theremins work but yes it really I mean, those have been Instagram.
I ended up using a potato and playing some silly song on a potato by just inserting a wire into
one end of it and then moving the other wire closer and further away in the potato.
Christopher is now marking down playing the potato as a possible show title. I can just tell.
Okay, so we've gone over the three main modes, which is monostable, like push a button and it goes on for a limited time.
Bistable, which is where it acts like a flip-flop and flip-flops are the basis for everything. And a stable, which is this continuous stream of pulses, and you can change the
width of the pulses as well as the period. When we talk about pulse width modulation
in microcontroller world, you have a main period. You go up at a certain time, let's say 20 hertz.
And so every 20 hertz, you have an up-going edge.
But where is the down-going edge?
That usually requires another timer in a microcontroller because you have to split up that time that it's on into a period that's off.
I don't know that I'm doing a good job of this.
Chris, do you want to jump in here?
You've been really quiet.
You have this whole agenda.
You're just moving through it.
It's been fine, yeah.
You weren't listening at all, were you?
I was listening.
You were talking about timers and microcontrollers
and how to do PWM.
All right.
But you're saying it's the implementation of a PWM
output on a microcontroller is more complicated because you need to use up different resources.
Yeah, and you need to calculate different resources.
You need to calculate both the period and the duty cycle, and they both are affected by timers.
Right.
And with the 555... it's all in hardware. It's all in hardware and you still
have, and you can spend more time just thinking about it. I mean, it's all in hardware in the
microcontroller too, but it's logic hardware versus... I don't have to write software for this.
In the 555, the duty cycle is really the duty cycle. It isn't a second timer you have to worry about.
Jesse's like, whatever. up some extra resources by putting a 555 as either a timing circuit or an ADC or other ways we've mentioned to offload some of those resources.
If, say, you're using a very small microcontroller with eight pins and you obviously are super
limited to what you can do, you might be able to squeeze out a few extra, you know, whatever features by using something like a 555 timer.
And, I mean, microcontrollers are cheap, but the 555 timer now probably has plenty of applications, but the most fun application you have in your book, which is, it is the
basis of many synth sounds.
Yeah, the Atari Punk Console, as it's often referred to.
It was, yeah, it's kind of a strange moniker. So there's this group of, I guess, musicians or electronics tinkerers, caustic machines,
and they took a design from Forrest Mims in one of his books.
I think it was originally the Steptone Generator, and they made a few tweaks and and because it outputs a very kind of eight
chip tune type sound um and it's a little unwieldy uh they they branded their little
tweaks to the design as as the atari punk uh console so what kinds of so from a synth point
of view you have oscillators and those get pushed through envelopes and filters and things to make different stuff.
But we're just talking about the oscillator portion with the 555.
Correct.
So what kinds of signals can you actually produce from it?
Is it just a square wave, and then you have to massage it to do something else?
In its most basic form, form yeah it's going to be
it's going to be a square wave um there are ways of rounding off uh the squares um sometimes by
using capacitors to obviously that's going to delay your square wave so it's going to make the
upper edge and the lower edge uh delayed and that in that eventually can, if you do it right, turn into
a triangle wave fairly easily.
Um, and with a few more components, uh, that, uh, that I don't, uh, you know, didn't have
time to go into in my book, you can generate a sine waves and things like that.
So I think it depends on the complexity, um, that you're willing to spend and all these
circuits are, are, are out there and have been in lots of different books
or magazines or websites.
And so, yeah, so at its basic level,
it's just kind of a raucous noise-making circuit.
And square waves have a lot of overtones, obviously.
And so it's kind of one of those things you
might listen to for a few minutes by yourself. But if you have a companion in the house,
they're probably going to come knocking at the door asking what you're doing. And
maybe if you could please stop, you know. But it's the pair of 555 timers is where it starts getting interesting.
Because you have one that generates an oscillation, which is sort of a tone, a frequency with, as you say, overtones.
And then you have another thing that turns that on for a period. So you have one in A-stable mode and one in mono-stable mode.
And you can push a button and it plays a tone for a given period of time.
Yes, that can happen.
Now, the Atari Punk console is a slightly bit different functionality.
There's a master oscillator and that is triggering and so that's in the
a-stable mode and then that's triggering a monostable 555 so it gets kind of complex
even though this is you know a simple circuit circuit that a lot of beginners start with because they're interested in it.
Once you get into the math of what it's actually doing, it's a bit more complex.
So it turns into a frequency divider. It is kind of the ultimate building block as far as,
so the A-stable is the master, and then it's triggering the monostable,
which, because the monostable timing is longer than the master oscillator,
that means that it has divided that frequency.
So if you, let's's say have something running at
you know a thousand hertz and the timing is correct on the monostable to divide that in half
now that's obviously running at 500 hertz and so the output of what you're hearing through if you have it hooked up to a speaker is actually the frequency
of the monostable uh 555 circuit which is a little different than usual right we think of
monostable as just being one shot one time but it's the fact that that astable oscillator is
re-triggering the the monostable one and so that's the output we're actually hearing in that circuit.
And then, as you see in a lot of them, including the ones in the book,
there's variable resistors to start changing the timing periods.
And then that gets really interesting because you're starting to not only vary,
say, the master frequency on the A-stable 555,
but then you're also starting to get into strange pulse divisions
as far as pulse widths in relationship to the monostable.
So it ends up creating very complex waveforms,
and now they're all square waves, but very complex pulse width modulation type waveforms and pitch too, that are a lot more complex than you would think that just these two little square wave oscillators might make.
And one of the really great things about these circuits is that it gives you insight into the
power of resistors and capacitors. I mean, to me, a resistor, seriously, I don't even look at them
on schematics except the dividers for my ADCs. And capacitors, I don't know. There's just these
things. But with building something with a 555 timer, especially things like the
music and stacking them together, you end up getting a far different view of the power of
what you're doing with the resistors and the capacitors and how they work in a functional
circuit as opposed to a resistor is sort of like a sponge and a capacitor
is sort of like a bucket. And when you're a plumber, it all goes together. That sort of
thing just doesn't make sense. Right. Well, and, you know, I don't know exactly what my original
goal was of writing the book. You know, it wasn't to teach electronics
per se, but it definitely was too short. Right, right, right. But I mean, my original goal was
because I had many resources on the 555 spanning almost 40 years old, some books, and, you know,
they're out of print and hard to find. Maybe they were written well,
and maybe they weren't, and maybe they had good diagrams, and maybe they didn't.
And I had to cross-reference about seven different books to really gather the information,
or at least the way my brain could understand it. So writing the book, I was trying to write the book. I wish I could,
could turn to myself as a, as a reference. So, you know, almost as an instruction manual per se.
And, and in doing so it, you're exactly right. It gives you a better comprehension of how these parts are interacting. And so in that sense, even though
I'm not aiming to teach electronics, I think I've written it in a form where someone with either no
or very little electronics knowledge could come in and not only recreate the circuits, because I mean, frankly, almost any kit can,
can provide that, but I really strived to, to build a relationship between the schematic,
the breadboard layout, and then the overall functionality in, in language, hopefully that
wasn't too technical, um, that, that people can understand, um, how, how all these parts are working together.
Okay, so yeah, I want to talk more about your book now.
You have a series of projects of increasing complexity,
and you used Fritzing, the schematic capture that also provides a way to show
how to build a schematic on the breadboard.
That was intentional.
You wanted to be able to
show them not only here's how you draw a resistor and here's how you draw all of the electronic
components in schematic framework, but also the here's how you actually shove it all onto a little
solderless breadboard. Yeah. And I spent a lot of time coming up with ways that I thought might or hopefully make sense to other people on how to lay that out on the breadboard.
And I ran into issues of, you know, I'm not obviously trained, you know, I'm not in a four year degree electronics engineering type person.
You know, this is all hobby based and just many years of tinkering around.
And so even myself, I would look at schematics and especially when they're
functional block schematics of, yeah, triangles for certain components.
And you're just like, well, that doesn't look anything like this chip I'm holding in my hand.
And, you know, sure, I get that, okay, this gets hooked up to this, but it was hard to just imagine in my mind, how do I go about this?
And so I used the Fritzing program to lay out the breadboard layouts.
Now, obviously, there's virtually unlimited ways you could lay
those out too, but I really tried to spend a lot of time of keeping flows the same, meaning, okay,
we're going to kind of how schematics are. They usually start with a positive voltage on the top
and the ground is on the bottom. And I tried to mimic the schematics as much as possible
while still providing a clear layout.
And in fritzing, even I see a lot of what I, I don't know,
I might be referencing a lot of people here,
but I guess lazy designs that I see on the breadboard layouts
in fritzing online and different places,
just straight lines and stuff that just goes all
over the place and lots of diagonal wires and that obviously that's not going to be how it looks in
the real world and so i spent a lot of time like doing silly little stuff like making the wires
curve and and trying to give it kind of a 3d uh aspect to the diagrams. It made me feel like I could actually build these. Um, I didn't,
I didn't actually build them. Sorry. Uh, I did read the book,
which I liked. Um, but it, it made me, sometimes when I read schematics,
I'm like, ah, okay. I understand all the pieces you're telling me,
but how am I going to put that together?
With your book, I didn't have that. It was clear how I was going to put it together
and what things I could probably modify based on what I had already.
Yeah. And that's what I was going for on that. And even things, so originally, and I mean,
we can get more into like how I actually wrote the book and things, but originally it was just going to be a Kindle book. That was my original premise. And then I don't know what came over me, but I think it was of, of 2016. And at the last minute I was like, you know
what? I, I just really need a paperback version of this. Like I, I just, I don't know. It's just
this crazy feeling. I just had to get that out too. So I spent the next like three weeks working,
oh my God, 12, 18 hours a day coming up with a layout um for the paperback version and i made
and the reason i'm mentioning this is i took very intentional efforts to keep the schematic and
breadboard layout on the same page and in fact the you'll notice it's on the left hand page with the
parts list on the right just so everything is right there for that project you can literally
just you know prop the book open and your breadboard layout is there, the schematic layout is there, and the list of parts is all there.
And that was very intentional on how I did that.
And it's a color book.
Yeah, I decided to go with color.
It obviously, on the print version um makes the uh price a tiny bit
higher um but once again going back to the books that i had to reference none of them were in color
and one is even called uh like 101 solderless breadboard projects well they don't even show
any pictures of breadboards it's just oh ps you can build this on a breadboard, I guess. I don't know what the thought process on naming the book that was, because all it shows is schematics.
And so I wanted it to be as clear as possible what was going on. And I just figured with the fritzing diagrams, if all the wires were just gray, that that might add to some of the confusion
or possible confusion. So, so I decided to, to go with color on that.
I, yeah, I, and it, it worked. Um, I haven't, I had a physical copy, which is weird for me
because I almost always do electronic, but, uh, but you were nice enough to send me one.
And, uh, it was nice to see the color.
I don't know how you would have made a non-color version and do Fritzing and feel like you could build it.
Right.
And obviously, some people that are going to have the Kindle version are going to be on black and white Kindles. And, you know, the, there's a whole crazy method to writing Kindle books and the
Kindle previewer and it allows you to look at what it's supposed to look like on certain versions of
the Kindle. And at the last minute I realized, oh yeah, there are still, you know, people might be
using black and white Kindles to look at this. And here I don't have any reference to the positive
and negative. So then I went all the way back through, redid every single diagram in the book,
and if you look really closely next to the battery input, there's a tiny little plus and minus
because I just figured, well, that should be enough for anyone that might be reading a black and white or grayscale version of this.
It's good for people who are colorblind, too.
Well, that's true. Yeah.
And you wrote this book primarily because you had so many resources that were out of print.
Do you have, did you have any other inspirations to actually do it?
Well, I had, I don't know exactly when I came up with the idea. It was sometime around 2015.
And then I just started, I don't know, just started writing one day and was like, okay, I'm going to start documenting this.
And I don't really know what my goal was at the time.
I don't know if it was really a book or maybe just some kind of online thing.
You know, I was like, I'm going to once I'm going to once again, write the references that I need to, to work with this. And, um, as I mentioned, I originally just thought,
well, maybe I'll just do a Kindle version. And so even that was interesting because as I was
researching, well, how do you do that? And, uh, really a Kindle document, a Kindle book is just a really long HTML file that, you know, that's a simplified explanation. It's slightly more complex, but not much. And so talking about the aesthetics, like so many Kindle books I've either read or at least read reviews of include diagrams or pictures are horribly formatted and i don't
and and you know that usually is nothing on the author that's that's going to be you know the
publishers or whoever that takes care of taking a paper book and converting it to a kindle you
know because there's all kinds of forums like oh yeah just write it in word and then just hit save
as html it'll all be good and And I just, I was like, no.
So believe it or not, I actually wrote the book in HTML.
I actually opened up a text file editor and wrote the book in HTML.
And the reason I did that is because then I just opened up the file in a Chrome browser
and just kept hitting F5 every once in a while,
literally to make sure everything was looking as intended as I wrote,
rather than write the whole book and then have to go back and format it.
Wow. Although I guess I wrote mine in XML, so I understand.
Right. Well, and what's interesting is, I don't know,
I'm a glutton for punishment, I guess. And so I decided rather than just do, oh, I'm just going to save as and save a few copies and save a few to the cloud. I actually installed a version of Git on my computer and actually version controlled it since it was just one big HTML file. So I got to learn a little bit about Git while I was doing all that too.
Good.
I do recommend anybody who is thinking about writing a book to version control it.
You'll thank me, I promise.
And then how did you get into electronics?
Oh, man.
I'll try and keep this as short as possible possible i know we've already kind of been going
but you know i i grew up in a kid in in the early 80s and and the closest thing to a computer i'd
ever really seen was our atari 2600 and then uh my uncle brought over a commodore 64 computer one
day and man i just was fascinated and I was like 1982 and I was like
six years old and I just thought that was the most amazing thing I'd ever seen. So for the next like
year or two years, I started saving up all my birthday money and Christmas money. And I bought
a Tandy color computer too. And, uh, you know, with a whopping 60, 16 K of, of memory and, uh,
all I could afford beyond the keyboard itself was a tape drive. And so I,
I started, um, writing my own games because I couldn't afford any, I'd spent, spent all my money
on the computer and couldn't afford the cartridges. And so it was the tedious process of,
you know, uh, typing line for line, basic code out of magazines and books to come out of these, you know,
ridiculous games. And, you know, it was around also 83 war games came out and I was like, man,
a talking computer. That's awesome. I'm going to build one on my color computer. And so, you know,
I obviously didn't have a talking computer, but I programmed things, you know, you would
ask the computer certain things
and obviously had very limited canned responses or input your password and, you know, sorry,
that's the wrong password, things like that. And so that's originally what got me started.
And then shortly after that, you know, I had one of those 201 type electronic kits with the little
spring connectors. But, you know, my biggest complaint with those types of things,
and even the basic computer programs in those books is, you know,
the basic programs had virtually no commenting on what any of the lines of code did.
Those 201 electronic kits, I almost feel like they explain things a little too in depth as far as
for a kid to understand exactly what's going on. Um, but I did mess around with those.
And, um, so that was kind of, kind of where it started. So I always had an interest in,
in things like that. Um, I grew up in the middle of Kansas, uh, like I said, way before the
internet was really a thing.
So unfortunately, I didn't have the resources to really pursue the programming thing per se.
But eventually, as an adult, right out of high school, I got into television.
I started working at the local TV station.
And obviously, there's all kinds of gadgets to play with there,
you know, half-million-dollar gadgets and things like that.
And one of the engineers needed a video switcher, a small one,
not one for an actual news broadcast,
but he just needed to switch between two sources of video.
And he literally built it.
He had a PCB and he etched it and you know i don't
know exactly where he got the design but most of it was himself and i'm sure with some references
and i just remember being amazed that wow this guy literally just made this piece of electronics that
does something you know switches between two video sources um it sync too. It's not like it's just some kind of, you know,
AB switch for switching cables.
No, this was, you know, kept the sync generation going
and I just was fascinated.
And so I had him teach me how to solder
and how to get into, you know, making PCBs.
And so then that led into, uh, finally in the two thousands, um, I was modifying some guitar pedals and I had this electro harmonics, uh, baseballs pedal. And so what it is is a you play and you play harder on the bass guitar, the filter tracks your playing style and adjusts the cutoff frequency of the filter.
And it makes for, some people call it like an auto-wah type sound.
And the thing was, though, it was just fixed.
It was like, okay, well, you turn it on and you plug it in and it just does that and i
just knew there had to be a way to change where those filter cutoff frequencies were and so i
opened it up sure enough there's two little trim pots in there and i was like wow what if i put
those trim pots on regular potentiometers with knobs on the outside and I can control those. And I did. And eventually that led into circuit bending.
And, um, you know, that's kind of a whole other, other realm of the electronics world,
but then that's what led me to start the website because I was looking for cheap components.
And obviously RadioShack was, was one of the main go-to places, you know, and they charge you $4
for some knob or something, you know,
ridiculous. And I was like, there's gotta be a better way. So I started my own online component
store, um, just out of my garage and bedroom. And believe it or not, like I was actually making
probably $1,500, $2,000 a month selling these 25 cent, you know, pots and, and LEDs and things like that.
Uh, so I was pretty busy shipping out boxes. Um, but then that there was some things in my
personal life that kind of detracted me for a little while and I got away from it. Um,
and I was literally at the point where I probably either had to quit my job or hire employees to
keep up with the orders. Uh, so I ended up just kind of putting that on hold.
And then eventually just was like, kept building kits, kept screwing around with electronics, found these 555 timer circuits online, changed the website from a web store to a hobbyist resource, I guess you would call it. And that's kind of, you know, the, I'm sure it felt like a really long story.
That's kind of the short, yeah, the short, you know,
the shortest way I can kind of navigate my path to kind of how I ended up here.
Well, I do think we should probably close it up soon.
But I also, not only did you send me your book, you sent me a box. And the box you guys want to keep one of the kits yourself, you can.
Or if you want to participate, I think we're going to maybe be doing a little bit of a giveaway thing with those.
But yeah, so there's a parts kit that goes with the book.
So, I wrote the book, was getting near the end of getting ready to publish it. And along with, Oh, I think I need
a paperback copy. I was like, you know, what would be really great is if there was a kit to go along
with this. Uh, but once again, kind of referring back to my old, uh, selling electronic components
online type of thing, I just knew I didn't want to go down that road again of just filling boxes all
day, shipping stuff out.
So I contacted Janeco and worked out a deal with them of they would supply all
the parts and market it as my little kit and for the book and then you know i make it extremely extremely
small um fee or you know amount of money on everyone sold but uh yeah you can use everything
that's in the kit to build all of the projects in the book. See, and this is the point where I should be like,
oh, and this is what I built.
Here, listen to it.
But yeah, I already admitted that I didn't build the things.
Gotcha.
So yeah, I do want to give one of these away.
And I guess we're going to do a guess the number.
Do you want to give any hints about the number you're going to choose, Jesse?
Oh, okay.
Sorry, I didn't realize I got to choose.
Oh, yeah.
Oh, I wasn't prepared for that.
Well, I think we'll say it's not going to be the number 555 uh or 556 or even 558 you know maybe maybe just the whole 500 range
will take out uh i'm not sure um geez i i don't know if i have any hints i'm sorry i wasn't uh
wasn't thinking along those lines we have negative hints it's not 555 or 556 right right yeah
rational or irrational oh well Oh, well, we'll
keep it in, even though I'm
a fairly irrational person, we'll keep
it in the rational range. Integer
or
floating point?
I guess, once again, for simplicity
we'll do integer.
Positive or?
Yeah, we'll stay positive.
We'll stay positive.
And you have a maximum?
Ooh.
A million, just to put some kind of limit on it.
Okay, so those are your parameters.
You can email us at show at embedded.fm, or you can hit the contact link on embedded.fm in order to enter the contest.
The contest will be over on February 14th, Valentine's Day.
I will be sending somebody a present, and international is fine with me.
I will send you a box.
Well, Jesse, do you have any thoughts you'd like to leave us with before we get back to our respective weekends?
A couple of quick things.
I guess that I would say if you are thinking about doing some type of project, whether it's writing a book in this case, or coming up with, with some
kind of idea that you want to do. Um, don't let the fact that you don't have maybe the on paper
credentials, uh, to do it, stop you from doing it. Um, you know, I'm not an electronics engineer, and it really delayed the process of me releasing the book because I kept doubting myself.
And eventually I was just like, you know what?
Some of the other most prolific electronics writers of our time also don't have electronic engineering degrees.
They're just very big, passionate, obvious. So that's kind of, uh, what,
what prompted me to go ahead and release it. And I know a lot of people probably get tripped up on
things like that. And, and so I would just say, um, go, go ahead and, and do the thing that,
that you're thinking about doing, um, because it's probably going to turn out better than what you think.
I like that. Do the things. Do all the things.
All right.
Our guest has been Jesse Rutherford, author of The Ultimate Beginner's Guide to the 555 Timer.
You can find it on his website and on Amazon. We'll have links in the show notes. Jesse's website is benttronics.com.
That's bentt-tronics.com. And there's lots of interesting stuff there. Go check it out.
Thanks for being with us, Jesse. Thank you very much for having me.
Thank you to embedded Patreon Slack folks for their questions, even the ones I didn't ask and the ones I didn't
understand. Thank you to Christopher for producing and co-hosting. And of course,
thank you for listening. You can always contact us or enter the contest at show at embedded.fm
or hit the contact link on embedded.fm. And now a quote to leave you with from Neuromancer by William Gibson.
The thing was a computer terminal, he said. It could talk and not in a synth voice,
but with a beautiful arrangement of gears and miniature organ pipes. It was a Baroque thing
for anyone to have constructed, a perverse thing, because synth chips cost next to nothing.
Embedded is an independently produced radio show that focuses on the many aspects of engineering.
It is a production of Logical Elegance, an embedded software consulting company in California.
If there are advertisements in the show, we did not put them there and do not receive money from them.
At this time, our sponsors are Logical Elegance and listeners like you.