Ideas for the code

Here are a couple of ideas for the code for this project:


Integrating a temperature sensor to log weather in my room. This means that I can turn on  a heater using a relay before I wake up to go for a ride in the morning. I’ve already experimented with the LM35 temperature sensor tutorial code by Ladyada. Here’s an example of what I’ll probably use to integrate temperature readings:

void loop()                     // run over and over again
//getting the voltage reading from the temperature sensor
int reading = analogRead(sensorPin);// converting that reading to voltage, for 3.3v arduino use 3.3
float voltage = reading * 5.0;
voltage /= 1024.0;

// now print out the temperature
float temperatureC = (voltage – 0.5) * 100 ;  //converting from 10 mv per degree wit 500 mV offset// DO stuff with the temperature here
delay(1000);                                     //waiting a second

Ok so I eliminated the serial.println elements because I don’t need them. I also eliminated the Fahrenheit bit because I’m not American. It’s pretty easy to print out variables using ethernet so I don’t really need to cover that here.

The Main Server code framework

So here is what I’m going to be using as a basic starting point for the server client request and provide code.

This guys stuff is pretty legendary because it’s easy to modify. I didn’t quite get how to use the GET and POST functions in his code because I think that they were a bit messed up. But I like this as a starting system as it is very easy to expand the code and add new pages (and functionality). The cool bit about this code is that it uses the PROGMEM code to put the webpages on the Flash memory. I may well go with something else that has the code on the SD card as this will give me a shitload of space and it will allow me to do easy references to images and files. But this is a good start and is what I’ll mess around with at first. My ultimate goal would be to build a system where you can modify the code remotely so you don’t have to be there plugged in with a USB cable to enhance and modify the system.

Of course in the good spirit of Arduino I will be making all my changes and the end product open source and will probably make a cool youtube vid at the end. Let the coding begin!


3 thoughts on “Ideas for the code

  1. This is one of the best weblogs i have ever seen and read. Thanks for sharing this usefull information. I will come back in a few days to see you have post some new articles.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s