An awful lot of microcontroller projects use timers to repeat an action every few minutes, hours, or days. While these timers can be as accurate as a cheap digital wrist watch, there are times when you need a microcontroller’s timer to measure exactly, losing no more than a few milliseconds a day. It’s not very hard to get a timer to this level as accuracy, as [Karl] shows us in a tutorial.
The problem with keeping time with a microcontroller has to do with the crystal, clock frequency, and hardware prescalers of your chip of choice. [Karl] started his project with an ATMega168 and a 20 MHz crystal and the prescaler set at 256. This made the 78.125 interrupts per second, but the lack of floating point arithmetic means one second for the microcontroller will be 0.9984 seconds to you and me.
[Karl]’s solution to this problem was to have the ATMega count out 78 interrupts per second for seven seconds, then count out 79 interrupts for one second. It’s not terribly complicated, and now [Karl]’s timers are as accurate as the crystal used for the ‘168’s clock.
Get your feet wet with radio frequency transmitters and receivers by working your way through this pair of tutorials. [Chris] built the hardware around a couple of 555 timers so you don’t need to worry about any microcontroller programming. He started by building the transmitter and finished by constructing a receiver.
Apparently the 27 MHz band is okay to work with in most countries as long as your hardware stays below a certain power threshold. The carrier frequency is generated by the transmitter with the help of a 27.145 MHz crystal. The signal is picked up by the receiver which uses a hand-wrapped inductor made using an AL=25 Toroid Core. We’d say these are the parts that will be the hardest to find without putting in an order from a distributor. But the rest of the build just uses a couple 555 timer chips and passive components, all of which will be easy to find. The video after the break shows the project used to receive a Morse-code-style message entered with a push button. It would be fun to interface this with your microcontroller of choice and implement your own one-way error correction scheme.
Even if you live in a dump this quick build will make your doorbell sound high-class. The new rig uses a crystal goblet to alert you of guests at the door. We suppose the room-silencing sound of flatware on a wine glass does make a great attention getter.
For [Tobias] the hardest part of the build was getting his wife to sign off on it. But he says the 1970’s era original was looking pretty shabby, which kind of made his argument for him. It took just two hours to develop and install the replacement. It uses a servo motor with an articulated striker to ping the glass which is hanging inverted between two pegs. The original AC transformer (which are most often 16V) was used to power the Arduino. He built a simple rectifier along with a big smoothing capacitor to make sure the Arduino doesn’t reset when voltage dips. Although it’s not mentioned in his comments, we’d bet the doorbell wire has been rerouted to connect directly to the Arduino, rather than remain patched into the power loop.
Don’t miss the clip after the break to hear how great this thing really does sound.
Continue reading “Crystal doorbell helps class up the joint”
[Markus Bindhammer] recently made a discovery while conduction chemistry experiments in his home lab. Ascorbic acid can be used to detect the presence of Vanillin. The reaction starts as a color change, from a clear liquid to a dark green. When he continued to heat the mixture he ended up with the surface crystallization seen above.
Vanillin is an organic compound which you will commonly find in vanilla extract, with the synthetic variety being used in imitation extract. Ascorbic acid is a type of vitamin C. When [Markus] first observed the color change he though it could be due to metallic contamination, but running the experiment again without the use of metal tools or probes, produced the same result.
You can see in the clip after the break that it doesn’t take long to turn green. The vanillin must be heated to 130 degrees C before adding the ascorbic acid or the color change will not occur. He believes this can be a reliable way to detect the presence of Vanillin in a substance.
Continue reading “Vitamin C used to detect the presence of Vanillin”
[Mark] from SpikenzieLabs was wrapping up a project using an Arduino the other day and found himself in need of a few more I/O pins. He could have added extra circuitry to the project, but he decided to see if he could gain a few pins by removing a few components instead.
He put together one of his Minuino boards, but rather than installing the crystal and its associated capacitors, he added a couple of pin headers in their place. It’s well known that the internal clock on the chip is not as precise as a crystal, but [Mark’s] project was not that time sensitive, so he had no problem sacrificing the oscillator for a few extra pins.
With his new I/O pins in place, he merely needed to tell the ATmega chip which clock it should be using, and he was well on his way. While this might not be the best solution for all projects out there, if you are building something that values pincount over precision, this hack is for you.
Check out the video below to see [Mark’s] hack in action.
Continue reading “Remove your Arduino’s external oscillator to gain a free pair of IO pins”
Make sure your test equipment is handy, then give this video series about crystal oscillators a spin. [Shahriar] of the Signal Path Blog put together a four-part video blog post totaling about an hour. In the discussion he covers the ins and outs of crystal oscillators and ring oscillators. His focus is on how these parts are used as timekeeping devices for microcontrollers. This isn’t a lecture that skims the surface of the topic, it takes you down the rabbit hole, discussing theory, how the devices are built, how to use them, and the pitfalls of doing so.
Our favorite part is in the fourth segment when [Shahriar] measures the effect that temperature has on crystals by spraying them with an inverted compressed air canister. We always thought we were just screwing around when freezing stuff like that. It didn’t occur to us that we were conducting serious experiments.
We’ve embedded the first segment of the video after the break. Continue reading “Gain wizardly knowledge about crystals”
Radio communications depend on stable oscillator frequencies and with that in mind, [Scott Harden] built a module to regulate temperature of a crystal oscillator. The process is outlined in the video after the break but it goes something like this: A small square of double-sided copper-clad board is used as a base. The body of the crystal oscillator is mounted on one side of this base. On the other side there is a mosfet and a thermister. The resistance of the thermister turns the mosfet on and off in an attempt to maintain a steady temperature.
This is the first iteration of [Scott’s] crystal oven. It’s being designed for use outdoors, as his indoor setup uses a styrofoam box to insulate the oscillator from ambient temperatures. He’s already working on a second version, and mentioned the incorporation of a Wheatstone bridge but we’ll have to wait to get more details.
Continue reading “Building a crystal oven”