Saturday, February 27, 2010

Code for the thermometer

I have just uploaded it to the crappy rapidshare.
http://rapidshare.com/files/356755556/Thermometer4_-_LCD.zip.html
MD5: 116890802238A5B89919CDB1B1972BD5

"Your file has been saved and can now be downloaded 10 times. It will be deleted after 60 days without download. If you would like to enable more people to download your file, please transfer it to a free Collector's Account or a Premium Account."

 And the mirror on google:
http://sites.google.com/site/species0x2118/hive/Thermometer4_-_LCD.zip?attredirects=0&d=1

Two small circuits

The first diagram shows how to interface an µC with an 7 segment display through an MC14513B. This little IC is an binary to BCD decoder and driver, that simplifies the interaction between digital circuits and 7 segment displays. Sure - it is a waste of parts and money, because the Atmega could deal with such a display without such an driver, but it was one of my first µC handicraft works.
Interestingly the driver IC was almost as expensive as the µC itself. ^.^°












The second diagram shows a voltage doubler circuit with AC input and 5V DC output.
I own an crosstrainer that need to be connected via a wall power supply to power the electronics (eddy current brake, LCD display, board computer, pulse measurement, etc).
I found it somehow annoying, that i was driving the piece of sports equipment with muscle power, "wasting" several hundred watts of power to get fit and loose weight and nevertheless needed to power the build in electronics with an external power source...
I wanted to use an old bicycle dynamo.
Unfortunately i found no way to mount the bike dynamo on the cross trainer. So i never used the circuit outside of my workbench.

Some interesting links:
http://en.wikipedia.org/wiki/Voltage_multiplier
http://www.coolcircuit.com/circuit/voltage/

Thursday, February 25, 2010

Additional adaptors for the ISP


Because i'm lazy dog, i made some adapters for my self made ISP to save the in-circuit programming connector. This would save some wires, parts, space on the board and a lot of time.
Now - with those adapters - i only need to connect the right adapter to the ISP and mount the adapter onto the µC.
Programming the µC is done as usually.

The only drawback is, when the adapter is mounted on top of an µC, it is not very stable. So better don't touch the whole thing while flashing the controller.

I made one adapter for the Atmega8 (in the background) and one for the Attiny84 (in the foreground).

The big one for the Atmega8 looks a bit strange, because i had to add another DIL socket to the existing one who had to unflexible pins.
My collection of DIL sockets is very limited.
It is better to use the cheap low quality DIL sockets, because their pins can bend well.
The more expensive ones have rigid pins, so they can not be bend over the µC pins.

Since i made the adapters, i have never soldered an ISP connector into an circuit again.
And because i don't want to take the credits for this invention: i have seen such an adapter in the internet, before i made mine. Thanks to you stranger for this fabulous handiwork! ^.^

Atmel ISP

Today i want to show you my ISP adapter for Atmega and Attiny µControllers from Atmel.
I found a circuit diagram in the internet, but unfortunately it was using an 74HC244 but i had only 74HC245 laying around.
That's why i redesigned the programmer a bit, to make it work with the slightly different 245.

The adapter is compatible with PonyProg2000 and AVRDude.

Now some pictures and the final circuit diagram:






























































PonyProg2000: http://www.lancos.com/prog.html
AVRDude: http://www.nongnu.org/avrdude/
A GUI for AVRDude: http://avr8-burn-o-mat.aaabbb.de (german)

Tuesday, February 23, 2010

Clock - some hints and thoughts

I have reprogrammed the clock-thermometer the first time after soldering it to the breadboard.

In the circuit diagram you can throw away jmp3 and jmp4 and replace them with a common jumper on the mass of D2 and R7.

Because my wall power supply not only outputs 9 V DC but also ~13 V AC, i decided to power the circuit with rechargeable batteries (4*1,2 V).

I thought it could help to change the following line:
degree = (degree * VREF) >> ADC_BITS;
to:
degree = ((degree * 1024) + (degree * 64) + (degree * 8) + (degree * 4)) >> ADC_BITS;

Where ADC_BITS is defined as 10 and VREF as 1100 (mV).
Indeed the code size shrinked from 3132 bytes to 3060 bytes, but the temperature was calculated wrong. The thermometer displayed a negative temperature, although my room was warm.

When i changed the code to:
degree = ((degree * 1024L) + (degree * 64L) + (degree * 8L) + (degree * 4L)) >> ADC_BITS;

The filesize was 3132 bytes again.

As you can see: the AVR GCC port isn't as stupid as you (or me) think. ;)

Happy soldering!

Monday, February 22, 2010

Clock-Thermometer with Attiny and LM35

Today i want to present you my last project i've made.
It's a more modern version of my first big µC project: a thermometer. (yeah!)
I finished it last sunday - at least the most parts of the project.

My first version i made months ago, was equiped with an Atmega8, four multiplexed 7 segment displays, "software" based USB and a batterie backup if no USB connection was in the near.
So far so good.

The negative points were:
It consumed a lot of power, it used tons of parts, it had some bugs i never killed and it only displayed the actual temperature.
I paused the project for a while.

By the time my µC skills increased and so on one day i decided to make a better version.
The requirements:
  • no batterie
  • no usb
  • no 7 segment display
  • should display something more than just temperature...
  • lesser parts
  • KISS!

That was the hour of birth for the thermometer version 4a:

The whole circuit is build around an Attiny84V and an LM35C.
The output is done on an LC Display from Displaytech.
1x16 Chars - or more precise: 2x8 Chars in one line.
Sadly without backlight.

After making some plans for the hard- and software parts i build up the circuit on an pinboard and then i made the software.
(Usually i never make plans for the software part.)
Last step was soldering the stuff onto a bredboard as you can see in the pictures below.
Because i made a lot of plans and "brain work" in the forefront, it was a very easy and straight forward implementation. No bigger problem appeared till now.

The circuit is using a wall power supply.
It is specified with 6 V DC, 300 mA and it is from an old wirless mouse charging station.
In idle time it delivers around 9 V and because the whole circuit consumes under 15 mA it will work in idle even when the circuit is connected. ^.^

As special feature i implemented a clock (wohoo!).
With three switches on the back you can set the hour, minute and the display mode.
Display mode means the appearance of the time and temperature on the LCD:
  • Mode 1: HH:MM:SS +/-TT,T°C
  • Mode 2: HH:MM +/-TT,T°C
  • Mode 3: HH:MM +/-TT°C
The thermometer should be able to display positive and negative temperatures in the range of -40 to +70°C.
But because it is getting warmer here outside i need some fridge to test the posibility of displaying negative values.
The build in clock is synced by an 16 MHz Quartz (CHKDIV8 is on - resulting in a clock speed of 2 MHz!).
The clock is not calibrated yet - but on the pinboard it was exact enough. Further testing with the breadboard circuit is needed.

The hardware version i soldered is a bit older than the plan.
As well as the software version.

The software is written in C with AVRStudio and WinAVR.
The main program consists of under 300 lines of code.
It uses 3132 bytes in the flash for code.
So there is plenty of room in the 8 kb flash for further extensions.
For the LCD i used the routines from Mikrocontroller.net.
(A big thanks to this side! It is just a paradise for µC users... at least when you can read german)
As soon as i figured out how to post software here i will upload it. ;)















Hey folks...

... here i am!
Electronic parts, source code, soldering iron, 1's and 0's, wires - that's my world.
Electronic is my hobby and it's beautiful.
In the following weeks, months (years?) i want to present you some of my work.
Perhaps it might be useful or at least entertaining for you. ; )
So lean back and enjoy.

puts("Hello World!");