2009-02-22

Manual clock input for a digital circuit

I wanted to test some more advanced programming (i.e. sequential circuits) of the CPLD, sequential circuits need their inputs to have stable transitions, i.e they need to be debounced.
Sequential circuits (synchronous and asynchronous) need debounced inputs, here is a good guide on how and why should one debouce an manual input.

I used the RS Latch method in Figure 1 of the document above, but since I used standard TTL 74 series, inputs floating are considered as "ONE", so I can do without the input resistors. I also tried out the RC filter approach the circuit is depicted on top.


This is a picture of CPLD, the clock circuit (with 2 inputs) and the 4 push button inputs and 4 LED outputs.

2009-02-18

Munny DIY - Valentine's gift

Me and Ana always exchange "things we've done" for Valentine's, this year I got a knitted cap and a scarf. Since my ability to do anything "pretty" is quite limited, I thought about buying something and modifying it.

I saw a mini-Munny from Kidrobot in a local arts shop (Artifac), and I thought of the possibility of making it a bit more "interactive". The mini-Munny is a small DIY toy (you can paint it anyway you like) and made of transparent Vinyl and is available on various colors. I thought of placing a RGB LED that would sense the environment temperature and would change color accordingly. I though of using a Atmel AVR ATtiny15L driving directly a RGB LED from Sparkfun and using a LM35CZ to read the temperature. The ATtiny15L appeared the best option, I had some in my parts boxes, works from 2.7 Volts up, is programmable in circuit and has a ADC converter, useful when the only temperature sensors I have are analog output.
At this time I decided to use a color code for the temperature, blueish tones to cold temperatures (less than 19C), from 19C to 21C greenish, and from above 21C reddish. I placed 100Ohm resistors in each output to the LED so that programming in circuit was still possible, a better selection of resistors could save power but for now it was just enough. The supply of the temperature sensor is connected directly to an micro output, just turning it on when a measure is in progress, I also placed a RC filter on the output of the temperature. The LM35 was what determined the supply voltage and the number of batteries, its minimum operating voltage is about 4V, so I had to use 3 coin cells (4.5V).


The I built a small circuit board, with a SMD version of the Atmel, the LED, the temperature sensor and the ISP connector. I added a small blob of transparent FIMO to mix the output of the LED.

I was luck, the batteries "just fit" Munny's neck and the circuit also "just fits" the Munny's head.

Finally, the circuit is inserted inside the Munny's head and gives a colorful indication of the temperature every 3 minutes... or about...
Here is cold... blueish...

If you want to see more colors and other pictures, Ana has posted some more photos with other colors.
The original idea was an electronic Valentine's card... but I could not find any suitable carrier for it... you can't just give a breadboard to your Valentine's can you!! It was a ATtiny26L and a Nokia3310 display.

2009-02-02

Serralves... Meia de Leite (almost a Cappucino)

I never miss a chance to visit Serralves, the Portuguese Museum of Modern Art in Porto. If don't like the art, or find it too difficult to digest... This was the floor in one of the rooms... I found it disturbing, I could look at it for hours...

But the best seat in the room was taken...


You can always go to any of the three cafeterias in the compound, good coffee, quality savories... Fantastic...
The top restaurant has a reasonable buffet and a great view over the park, the lower floor level cafeteria has a great window facing the grass, very Zen... but probably the top is the Tee House, so 1920's-1930's a Tee house in front of the gravel Tennis court... The perfect place to read the newspaper weekend edition, if you're watching the rain from the inside... very peaceful... Love it!

In Portugal you can have a "meia de leite", litteraly "half milk" the equivalent in the Netherlands would be half of a "Koffie Verkeerd", I've had some Latte's and Machiattos in my day, but there's nothing like a Meia-de-leite. If you want to try it is a long expresso with the same amount of vapor heated milk, it should look like this..

Humidifier Reloaded (Hacked)

Pedro had a problem with his Venta Humidifier, although it has a nice "discrete" design it lacks one important feature: an external water level indicator. Pedro drafted a small specification of what he wanted, two indicators, one for "almost empty" and another for "empty", if possible when empty stop the motor i.e. cut the power.
I checked the price of a new one (just in case I ruined it beyond recognition) and after taking note of the 114€ price (and they weren't able to add a simple level indicator... shame on you product designers), I went to work.
My first idea was to use a buoy and a lever to externally indicate the level, but it appeared to be too fragile to store and to align the top of the Humidifier, then I though of building a buoy with a magnet and placing Reed switches on the outside of the case.
Having a small tube glued inside was very easy, I had to use hot glue as special PVC glue (in the picture) did not work with the case (clearly not PVC!!).


My original magnet was too heavy, it weighted about 7g and for that I needed about 7cm² of foam supporting it, too much!Then I tried 3 and 4 smaller magnets, about 1g each. Here is a picture of the magnet with the floater and the REED switch on top.

After having the level system I went out to design the electrical system. Initially I planed on using a normally closed reed switch for the power but a switch capable of cutting 230V 0.35A inductive load is impossible to find.
So I had to resort to an additional battery and a relay to invert the signal, the use of the battery made me use an extra power switch to turn off the detection circuit when the Humidifier is stored away.
Two normally open switches, one lighting a green LED when the level is almost at the bottom and a red LED lighting when the level of water is at the bottom and cutting the motor when this happens. The Relay contact is normally closed so that if the battery runs out or Pedro doesn't want it to operate just remove the battery and let it work as previous.

Here's is the finished "product", with the boxed closed and the LED visible.

Here's another picture, just to show the chaos during the creative process... :-)