Archive

Archive for the ‘Projects’ Category

Hacking a digital alarm clock

February 22nd, 2009

 

Philips AJ3540

Philips AJ3540

About 6 months ago, I purchased an digital alarm clock/radio from Walmart. The model i purchased was the Philips AJ3540 for about $40. I purchased it for the large display, which I did not see available for other clocks in the same price range.

The clock is not without its flaws, however. The sound of the alarm buzzer is deafening and the backlight on the display is just too bright, even on the lowest settings for both on their respective control knobs. 

This week I finally had enough and decided something needed to be done.

On opening up the alarm clock I saw that the clock was divided into 3 segments – the display, the controls and the “brains”. The brains section had some interesting components. The buzzer was actually a high wattage piezo buzzer, I haven’t ever seen a piezo buzzer that was this loud. Also the circuit used to convert the incoming ac to dc was interesting.

Anyway, down to business.

How do I reduce the sound of a piezo buzzer?

This was suprisingly easy. The incoming AC power is converted to 5v DC, so all I had to do was find the power rails and hook up a potentiometer to it. I then hooked up the wiper on the potentiometer to the buzzer, where it was previously connected straight to 5v. After setting the alarm to go off, I moved the wiper around till I found a volume I found suitable. 

Basicly that is really all you need to do. However I didn’t want to just leave the potentiometer there inside the alarm clock. The first idea I had was to cut a hole into the casing of the alarm clock and use the pot as my new volume control knob. However, I do not have a dremel handy for cutting a clean hole, so this would not do. Also I only have 1 potentiometer currently in my possession (I need to put an order in for parts!), so I didn’t want to give it up, especially since I use them quite regularry for testing.

After some thinking I suddenly remembered that the way I was using the pot was similar to a voltage divider. Which brings us to step 2 of our procedure.

What is the voltage I want to step down to?

This wasn’t as easy as I thought it would be. 

At first I hooked up my Arduino to the clock – share the ground and hook the wiper up to an Analog Pin through a 10K resistor. I then intended on displaying the data on my computer monitor serially. However, this wasn’t simple, as the circuit on the alarm clock was pulsing the buzzer faster (PWM) than the arduino could print values to the screen. At times like these, I wish I had an oscilloscope…

Anyway, there is always a way around difficulties! I calibrated the pot to the volume I wanted it and then removed it from the alarm clock. I then hooked it up to the arduino through the 5V power out. The reading I got out was 4.8V. This part still doesn’t make sense to me, as for a drop of .2V the volume decreased by quite a bit! Guess the buzzer doesn’t follow a linear curve (which would make sense as its based on frequency).

A little voltage divider math showed that my R2 should be equal to around 24 times my R1. Looking through my available resistors I used a 300 ohm resistor for R1 and a 5.1K and a 2K resistor in series for my R2. 

Soldered the resistors on and voila!! Your sound is now exactly how you want it!

I went on and did the same thing for my display backlight.

Hope this helps someone out! I planned on adding pictures but I my SD card on my laptop reader isn’t working :(

Darius Gai Arduino, Projects, personal

Learning Eagle

February 11th, 2009

I have been dabbling a lot with Eagle as of late. And today I started to make some inroads. I created my first part in Eagle and have started a library. The part I created was the AS1106 LED Driver from Austria Microsystems: http://www.austriamicrosystems.com/eng/Products/Lighting-Management/LED-Drivers/AS1106

It is a cheaper alternative of the MAX2219 LED driver from Maxim-IC. I recently embarked on created a game using the Arduino that incorporates tons of LEDs and depending on my final configuration (haven’t decided on this yet), it would require 2-3 of these LED Drivers.

I also plan on using this project to Learn Eagle and since my AS1106 chips came in yesterday I thought I’d start by creating a part for them. It wasn’t as bad as I thought it would be and the Sparkfun tutorials on Eagle are a good starting point.

 Next I want to create a small protoboard with a single piece of each component type. Once I make sure that the footprint of each one is right, I’ll finish up the board and then I am set to go!

Darius Gai Arduino, Projects

Lazy Bartender v0.1

August 31st, 2008

Coop is over I finally have a chance to get back to the bartender project. Now that some progress has been made on the programming end, I feel its fit to start discussing the project on this blog.

The bartender project is the biggest hardware project I’ve undertaken to date. It was inspired by the Virtual Bartender by Digital Beverages. I read an article on the product a few months back on Wired (or maybe it was Popular Science…) and was enthralled by the idea. As a person who loves his alcohol (as evident in my participation as a developer on Urbandrinks.com), I too wanted one of these machines, but was immediately turned off by the price – $2,575!!!

And thus the lazy bartender was born. The goal was to make a simple version of the virtual bartender for under $300. The idea was to take out all the heavy hardware responsible for controlling the robot, and use a multimedia computer to control it instead. Now days everybody seems to have a computer in their living rooms or kitchens. Either as HTPCs (Windows Media Centre, MythTV) or a kitchen PC, these computers are becoming increasingly popular for extensive feature list and cheap price. We decided that we would build software that would run on top of these computers that would be responsible for controlling our lazy bartender.

So here is where we are at currently, out V0.1:

Hardware:
The hardware is currently very simple. A relay board is connected to the parallel port. Having worked with the parallel port before, I decided to use it again for its ease of use and reliability. The relay board has 4 relays on it, that can be turned on or off by the parallel port. Each relay is attached to a gravity based solenoid valve. In an order to save money and decrease the complexity of the project, we used gravity to push the drinks instead of a pump. Both the solenoids and the relay board use 12V.

Software:
Deciding the programming language was a much debated topic. I wanted to choose a language that would allow me to prototype quickly and worked cross platform. Initially I was thinking of using Python with PythonCard as a graphics library. However, I finally decided on Visual Basic 6 (didn’t have .NET on me). I absolutely hate Basic as a programming language, but you can’t argue with its ease of use.

The fact that Visual Basic 6 runs on Windows only pretty much crossed the language off the list during an earlier decision process. However, faced with the fact that I would have to create separate programs for Windows and Linux (Macs don’t even have a parallel port) since the parallel port operates differently in each system anyway, Visual Basic came back in to the foray due to the ease with which one can prototype a functional graphical program.

Hell, if this project really takes off, we’ll look into switching to a more “sophisticated” programming language.

So what can the bartender do now??
I can use my program to turn the solenoids on and off and pour my self a drink!! Pretty cool huh!!

Things to do for v1.0:

Hardware:
I need to design containers to hold the various alcohols and mixers. A lot of questions here since gravity is used. How do I design a container that won’t spill any liquid on to the electronics when opened?? I also need to procure or design a cabinet to house all my hardware.

Right now the user has to use the software provided to calibrate a shot. Essentially when the user clicks a button once the machines starts pouring. When the button is clicked a second time, the machines stops. The user can use this method and a shot glass to calibrate a shot. This technique (Bucket and Stopwatch technique), works but isn’t the most efficient. The user will have to do this for every type of alcohol and mixer because of their different viscosities. A flow meter of sorts would be a better solution. Due to the low cost of the project it might be better to pursue a hardware based design, like an indexer, or a modified toilet bowl float valve.

Software:
Right now the software can turn on and off the solenoid valves. It can also allow the user to calibrate the solenoid valves to pour a shot. For v1.0 a data storage has to be chosen – text files (currently used) or database (probably MySQL)?? There has to be a database of recipes. Once the user has been calibrated the solenoid valves to pour a shot, the software should be able to use this information to pout a drink as outlined by a recipe.

The software shouldn’t take too long. A good weekend should suffice. Its the hardware I am worried about. For some reason I can’t wrap my head around the design of a container. How do I design a container that will be easy to load and unload without any spillage? Right now I am envisioning something with Tupperware…

Anyway, all these developments are quite exciting, and working on this project has been a lot of fun!!

Darius Gai Lazy Bartender

GlobeBot

August 30th, 2008

This was our high school computer engineering project. The goal of the project was to create a robot that could be controller from anywhere in the world.

The frame of the robot was made of aluminum extrusion. Attached to the frame were 2 DC motor wheels and a swivel wheel. Here is a list of components that we had inside the frame:

  • Computer – We didn’t have the resources to buy a smaller computer. This beast was an old Pentium 2 that we insalled Debian on.
  • 9 volt car battery – used to power the computer and the H bridge and the PIC. It powered the motherboard through a picoPSU
  • H-Bridge – Since we didn’t have the time to research making an H bridge, we used the L298 Kit
  • PIC16F84A – This microprocessor wasn’t necessary, but we were planning on using it when we added new features. Two features we wanted to add in the future was the ability to move the web cam through servo motors, and an LCD display to display text sent to the robot. It was powered by the 9 volt battery through a voltage regulator to feed the correct voltage
  • Webcam – attached to the computer via USB. Used to provide a live feed of the surroundings

Essentially one could log into a website being served by the web server inside the robot. On the PHP page the user would see a live feed of the surrounding through the robots eyes (updated at the rate of 10 frames per second), and a list of buttons to control the robot. Depending on the button clicked the robot would send a signal to the PIC through the parallel port. To send the signal we created a C script that took command line inputs to send data through the parallel port. When the used clicked a button, it ran a PHP script that would run the C script with the correct parameters.

Once the Pic microprocessor received the data from the parallel port it outputted the correct data to the H bridge which in turn would move the motors. The PIC was programmed in assembly.

All in all the project was a great success. It won the highest mark that year and is still shown at the school fair as a method to attract more students towards technology classes.

Here are some pictures of the robot:

Robot Side ViewFront view of RobotThe H-Bridge

Darius Gai Globe Bot

World Racer

August 11th, 2008

In September 2005, the Computer Department at Grimsby Secondary School decided to create an arcade machine to raise funds for the department. The Computer Engineering class was to design and construct the machine, while the Computer Science class was to design games for the machine. As member of the science class our addition to the arcade machine was a port of the old ExciteBike for NES. On release the game was originally called Continental Racer, but the title was changed to World Racer when “Continental Racer” was deemed an awkward title.
Team:
- Darius Gai
- Christoper Rintjema
- Kevin Zabel
- Alex Lowell

Features:
* Written entirely in Java
* 2 player capability
* Time based scoring system (need to meet a certain time to move on)
* Variety of jumps, hazards and powerups
* Custom Maps
* Arcade Scoring System

features not included in original game

 Here is a video of the game that was created for the final presentation:

Darius Gai World Racer