Digital Thermometer BreadBoard testing

Thermometer V1.0 was built at my very first steps on microcontrollers and generally in electronics about 2008. Then i was still writing embedded software in assembly as a starter. It was a big challenge for me to drive the HD44780 LCD Display and the ADC of the Atmega8 using assembly. I remember, i was writing and testing about a month to make it work. Searching for bugs on both hardware and software. By the way when you develop both sides hardware and software, debugging is the most difficult thing. Υou don't know where to start from, searching for bugs, software or hardware? I also had came across with the problem of making a division and that wasn't that easy. I had to write a whole function to do it (in C you can just write the symbol / and division is done). In assembly if the division is by 2 you can easily shift the value right but if it isn't what you can do?

This project wasn't something admirable but it was much a lesson for me. I learnt a lot of things from this like writing assembly, learning how the LCD  works and how to drive it with the correct timing! Every difficulty you come across is a lesson for you!. Of course when i saw it working (on breadboard) i felt so happy like a kid.

I also remember a classmate of mine sawing him the code and talking about how many hours it took to me to make this thing work and him telling to me "Oh that's what you made? this is very easy… I made the same thing in about half an hour". When i asked him how he did it, he revealed me that he had just copied some C code (about 20 lines) of a book he found when mine was about 600lines and i knew where is each word in the code. Well the answer is yours… You can make things the easy way but you have to know that someone else had worked for you to make these things easy for you and he is the one who has learned the more! If you want to learn don't choose every time the easy way.

Well here i post some photos of the circuit. It was my first homemade double side pcb using short wires for vias and soldering components in both sides which finally didn't work :P. For a reason i don't know i have lost the Eagle Schematic and Board Layout. I have only the code and the photos. So i post what i have.

As i remember i have used ATmega8, LM35 and HD44780 LCD Display. Also LM7805 has been used for power supply.

 

Digital Thermometer Digital Thermometer

Digital Thermometer Digital Thermometer

The Assembly code can be downloaded at the following link

DOWNLOAD HERE

Front    Back-soldered

Introduction:
Autonomous live tracking weather station. It takes (analog/digital) measurements and sends them to a web server over GPRS. Adding a battery and a solar station you can make it fully autonomous. It supports up to 3 Analog or Digital inputs. The main brain is the PIC 16F877A which also drives the SIM900/300 GSM module which is placed in the back of the PCB.
The main purpose of this project is to take wind flow measurements of different locations and store them in a database remotely. By this you know if the locations are appropriate for future installation of wind generators.

The data send from GSM to Web server with GET requests which isn't the safest and best way but its an easy way to make it work. The example code you can find at the github is a very simple example and has no security responsibility.

The GSM module:

For the GSM communication i've used the SIM900/300 which is a very good, easy to use and cheap gsm module. It offers UART communication and can be controlled with AT Commands. It works at 3.6Volt and uses an external gsm antenna. The module also includes a battery charger which is very useful if an external battery is used in combination with a solar panel or a wind generator for autonomous use. On the design there is also a LED indicator LED1 which indicates the gsm status (blinks). The module can be powered on/off by the button [S3]. As a hardware design guide i have used the Sim300 Hardware Design.

Note1.  I began designing the board for SIM300 which finally stopped to be manufactured and replaced with the SIM900. The hardware design manuals deference from each other so you may  find some useless components included in the connection between the simcard and the sim module which was included in the SIM300's manual but not in the SIM900's. The footprints of these two modules are the same.

Note2. The S3 which i used to power on/off the module but can be replaced with a transistor connected to the PIC to power on/off the module from the MCU.

Note3. The module works perfectly with the only disadvantage that it needs a voltage supply >4Volt to Vbat pin.

The main "brain" PIC 16F877A:

The main "brain" is the PIC 16F877A working at 16Mhz. The MCU is supplied by the Vbat as the gsm module. RA0,1,2 are used for analog inputs (analog measurements). The input voltages are converted to digital internally (ADC) with Vref=3.1V which is stabilized by a 3.1Zener diode. At the analog's inputs pinout is also included a Vbat and GND pin for possible external's measurement tool power supply. The Q3 (BC547) is used to Pulse (PWM) the LCD's backlight in order to reduce the power consumption and adjust the backlight's brightness. S4 switch is used to reset the mcu and R1 is there as a pull up resistor to keep the voltage high on running mode. D1 is there to stop the 12Volt to "charge" the battery and burn the SIM900 (Vbat). R2 limits the programming current flow to MCLR. In this design there is also included a PIC-ICSP header which lets the developer to program the pic in system without the need of unplugging anything.

The 16×2 Char LCD HD44780 :

A 16×2 LCD HD44780 has been used to display some status information and make the device user friendly. There is a backlight jumper (POWER-LCD) at the led's anode which gives the user the option to turn off the backlight for power consumption. There you can see that this net is connected to PIC's INT (LCD-INT) which is used to make the PIC know when the LCD is powered on to run the LCD initialization routines (The LCD at it's first power on needs to be sent some commands to initialize and make it ready to display the data that will receive). By this you can remove the LCD while the MCU is running, plug it back reset the jumper and the LCD will start working again.

More photos:

The pcb under light  Front

Back  Homemade PCB of GSM Back

Homemade PCB of GSM Front

Breadboard prototype:

GSM bread board testing    GSM bread board testing

Testing Video:

You can download the PCB design the Firmware the datasheets and the data storing web site from the github.

DOWNLOAD HERE

This was build as a project of Microprocessors lab for Technical Institute of Piraeus department of Electronic Computer Systems Engineering.

Two years ago i modified a scanner replacing its mechanism and all the internal electronics with UV lamps converting it to an UV exposure box for PCB prototyping. By the need of making my life easier and not waiting for the pcb to be exposured i designed an AVR timer to automatic switch off the lamps after 1 minute of exposure which was much enough for the PCBs. Here is the circuit

The circuit

This was one of my first completed projects from design to production. As you can see the scheme isn't that good and there have been by passed some capacitors at the power supply. But the circuit works with no problem.

B1 is an AC voltage rectifier which in compination with the C1 (filtering AC) converts the AC to DC voltage. The LM7805 comes to regulate the voltage at 5Volt for ATMEGA8 power suppling. The AVR drives two 7-segments D1 and D2 for timer digits displaying, a buzzer SG1 to beep when lamps are switched off and a relay K1 driven by a NPN transistor Q1 to switch on and off the UV lamps. Also there is a diode D3 connected in parallel with the relay's inductor to prevent reverse voltages burning the transistor. Switch S1 is used for AVR restart and switch S2 is used for timer reset.

Testing on breadboard

Timer-bread board testing

The finally PCB printed with the UV exposure box

Timer-PCB

The timer

The timer

 

 

The code is written in C and the delay is produced by a delay routine and not by a timer. This because when i had designed the timer i didn't have enough experience with timers so it was much easier and familiar for me to use a delay routine. The device is accurate enough for uses like the one i designed it for. The code is small, very simple and understandable.

DOWNLOAD HERE

The IV-12/11 vfd tubes need 1.2Volt for the filament about 100mA each. In my clock project i'm going to use 6 tubes so the total draw current will be about 600mA which is to much for a linear regulator like LM317. The LM317 can be used, but it will be need a big heat sink to keep it cool. So i designed a step-down converter based on MC34063A, a pulsed regulator, which is also power efficient.

I could have been used a resistor in series with the filament but if any tube filament get burned then the other 5 will draw more current and get burned too. Also i could have been used the AVR to regulate this voltage than using the MC34063A but there wasn't more free space on the chip.

MC34063A Step Down Converter design.

The design is based on the MC34063A's datasheet. In this design i regulate the voltage to 2.5Volt because the tubes want to have a negative voltage about -1volt to get fully powered off. So i have put two diodes in series (with ones kathode connecting to others anode) connecting the negative filament pin to GND. By this, each diode works as a supply voltage providing 0.6V x 2 = 1.2Volt.   2.4V-1.2V =  1.2Volt which is the supply voltage needed for powering the filament.

 

Protoboard testing

MC34063A ProtoBoard