Search code examples
javaandroidserveravrlan

AVR Microcontroller temp sensor communication over LAN


Hello infinitely more skilled people than me ;-),

I have a question for my Brothers School project and I want to help him. He has a micro-controller board with a LAN port and wants to attach a temperature Reader to it. Has anyone a Suggestion on How to communicate this data let's say for example to an Android app that can Display the temperature graph or just the temp at the current Moment? If not Android he wants to Display it via a Java app on a desktop that displays a temp graph and average temps. I tried to Google it but I haven't found anything that describes this case. Maybe I don't know how to formulate it. I know it super vague to describe it but maybe some nice guy can send me code example how it would look like, since I am a total beginner. Here is the AVR board (it has a LAN port)

http://www.pollin.de/shop/dt/MTQ5OTgxOTk-/Bausaetze_Module/Bausaetze/Bausatz_AVR_NET_IO.html

Thank you :)

Thanks and have a nice day :)


Solution

  • As far as I can see, the board features an ATmega32 controller and an ENC28J60 Ethernet controller (with SPI!).
    It seems they provide some sort of server application that communicates with the board (via Ethernet/LAN). The app is not trivial, as I see it also has firmware update feature (so the AVR chip has also a bootloader in its flash).
    Anyway, an interesting approach would be to connect your temperature sensor on one analog input, then start the board and the net-server app (connected to LAN). You'll see the related measurements on some ADCx (in Volts).
    After that, using Wire-Shark or similar tool, you could spy the communication messages between the board and the server (knowing their IPs, to filter out all other crap lurking on the LAN).
    Next step would be to find out the specific message server sends to request the ADCx, and also the related answer from the board. Not trivial, yet doable I guess :)
    Finally, knowing what messages are exchanged (I here assume you don't have the specs for the protocol or the source code), you should replicate/implement something similar in your Windows/Android application (further conversion from voltage to °C temperature to be displayed is yet another thing to be done by your app - the easiest part, I suppose :).
    With the data you provided, I think this is the best suggestion I can make.

    Best luck with your project!

    BTW: Best place where you can find help (and source code examples, compilers and related stuff) for AVR is: www.avrfreaks.net