Allgemein
Basierend auf den Arbeiten von Ulrich habe ich mir den ATMega32 basierten Webserver zusammengebaut.
Ulrich bietet hierzu in seinem Shop auch die notwendige Platine und die Spezialbauteile dazu an.
Das Ding ist wirklich preiswert. Ich habe für alle Bauteile inkl. Versandkosten 40EUR dafür bezahlt.
Der Webserver besteht aus einen ATMega32/644, einem 10MBit Ethernet-Interface, einer echten RS232-Schnittstelle und diversen freien Ports des AVRs.
Auf der Platine sind alle Bauteile inkl. der Spannungsregelung enthalten. Versorgt wird die Platine mit einer unstabilisierten Gleichspannung von ca. 9V
Ein paar Bilder
Settings für die Programmierung des Controllers
As you can see on Filderwetter.de the weather related data (outside temp, rain, wind, etc.) is handled by the ELV hardware and the corresponding 434MHz data-receiver.
My old ELV hardware does not support a light meter, so i decided to build one by myself. The hardware is based on a very simple ATMEGA 8 board by Olimex.
The device is capable of taking measurements in a defined interval and storing the data in its internal buffer. As an additional feature the device support a lightning detector device and a real-time clock.
The device is connected to the weather server via a simple serial link (RS232). The power supply is a simple wall-mount type.
For a quick status info a text LCD is mounted on the front of the device.
Hardware
Base hardware
front view rear view
mainboard
Lightning detector
I build the flash detector that was developed by Peter during his weather station project. Details can be found here.
Software
Communication
The communication with the server is handled via a simple serial RS232 link. The weather controller is a passive device, it will never send data over its serial link without an request from the server. The communication is a simple ASCII protocoll, which is easy to implement and to test on both sides.
Protocol
The protocol is completely based on ASCII characters. A data block sent to the device by the host or vice versa is always started with the $ (dollar) character and terminated with the # (number) character.
The following commands are supported by the weather controller:
| t |
Return the current time of the internal real time clock. The devices answers with t and the actual time in seconds since 1.1.1970 00:00:00 as ASCII string.
|
| T |
The time is set in the unit. The host has to provide the number of seconds since 1.1.1970 00:00:00 in ASCII format. The device responds with the new time in the device in seconds since 1.1.1970 00:00:00.
|
| i |
Return the number of seconds between to measurements taken by the device. The device answers with i and the number of seconds in ASCIII format.
|
| I |
Sets the new measurement interval in the device. The host has to provide the interval in ASCII format. The devices responds with i and the number of seconds set in the device.
|
| v |
Returns the version string of the software in the device.
|
| n |
Retrieves the next stored record from the internal data store. The parameters returned are:
|
| s |
Returns the general device state. The parameters returned are:
|
Links
Allgemeines
Ich wollte mir mal wieder ein völlig sinnloses Zubehör für meinen Shack bauen. Es sollte auf einem Microcontroller-Board mit einem ATMEL ATMEGA-32 basieren und irgendetwas mit GPS zu tun haben. Ausgehend vom letzten 2m Contest fand ich es danz interessant, ein Gerät zu bauen, welches mit die aktuelle QTH-Locator Position sowie eine genaue Uhrzeit anzeigt.
Ich habe mir bei eBay (Verkäufer LIMAL) einen aufgearbeiteten GPS-Empfänger vom Typ "Haicom GPS-Maus HI-204S SIRF II PS/2 " des Herstellers HaiCom gekauft. Dieser wurde von ihm in größeren Stückzahlen angeboten. Der Empfänger wurde in einem tadellosen Zustand geliefert. Für EUR15,00 kann man da nicht meckern. Handbücher etc. findet man auf der Webseite des Hersteller. Das Microcontrollerboard habe ich mir schon vor längerem bei eBay gekauft.
Hardware
Die Hardware besteht aus einer einfachen Microcontroller-Platine. Diese enthält:
- Microcontroller ATMEGA32 getaktet mit dem internen 8MHz RC-Oszillator
- RS232-Schnittstellenwandler im MAX232
- Hintergrundbeleuchtetes 2-zeiliges LC-Display
- Drehgeber für die Menuauswahl
- Taster für den Start der Bootloaders
Eingebaut ist alles in ein einfaches ALU-Gehäuse.
Der Drehgeber ist über 2 Portleitungen mit dem ATMEGA32 verbunden.
Die serielle Schnittstelle für den Anschluss des GPS-Empfängers verwendet die eingebaute UART des ATMEGA32.
Der GPS-Empfänger wird über eine 6-polige Mini-DIN-Buchse angeschlossen und über diese auch mit +5Volt versorgt.
Das Gerät muss über eine externe Gleichspannung im Bereich von 8V bis ca. 18V versorgt werden. Die interne Betriebsspannung von +5Volt wird mit Hilfe eines gekühlten Spannungsreglers vom Typ 7805 sichergestellt. Der Anschluss der Versorgungsspannung erfolgt über einen Hohllochstecker mit nachgeschalteter Siebung und Verpolungsschutz.
Das Bild zeigt den Testaufbau mit gebrauchten Frontplatten, etc. …
Software
Die Software wurde mit Hilfe des WINAVR Compilers in der Sprache C erstellt.
Die Software setzt sich aus eigen erstellten Modulen sowie Modulen der Autoren Peter Fleury, Martin Thomas und Peter Dannegger zusammen.
Der ATMEGA32 enthält einen Urlader, mit welchem es möglich ist, über die serielle Schnittstelle neuen Programmcode einzuspielen.
Was kann man alles mit ATMEL AVR Mikrocontrollern machen.
Wie bekommt man WinAVR unter Microsoft Windows VISTA 64-bit ans Laufen.





