This is the example code and circuit for gas sensor connect with the arduino.
//Arduino Sample Code
Serial.begin(9600); //Set serial baud rate to 9600 bps
val=analogRead(0);Read Gas value from analog 0
Serial.println(val,DEC);//Print the value to serial port
Had troubles setting up my Bluesmirf but finally it’s working. If you’re on Mac OS X (Snow Leopard) and have troubles setting it with Arduino, you might find this tutorial useful. Setting up Bluesmirf:
1. Wiring the Bluesmirf to Arduino: GND to GND, VCC to 3V3, TX to RX, RX to TX
2. Make sure your Arduino sketch is set to the same Baud rate as the BT module. 9600 is the safest.
3. Once the Buesmirf is plugged and the Arduino is powered externally, the red LED should blink.
4.Set up Bluesmirf in the Bluetooth Assistant (it should appear as Firefly). The passkey to pair is 1234.
5. Download and install ZTerm and go to Settings->Modem preferences ,choose the modem (“Firefly” or something).
5.Go to Settings->Connection and set the Baud-rate to 9600.
6.Restart both Zterm and the Bluesmirf. Make sure you restart Zterm within 60 seconds after Bluesmirf restarted! The green LED should be on.
7. Command+K (keyboard buffer) allows you to enter commands (within 60 seconds after Bluesmirf restart!!!!!!!!). Enter $$$ first. That switches the modem to command mode. The terminal should return CMD? Next enter SU,96 to set the Baud rate of Bluesmirf to 9600. The terminal should return AOK. Then enter — (minus three times) and press return. The command mode exits.
8. Exit Zterm. Red LED on, green LED off. By now your computer recognized the Buesmirf, the Baud rate is set to 9600.
The billporter website have release the library ps2 controller for arduino. And the current version is version 1.6. You have refer to the example file in the library to see how to use it.
Download : Arduino PS2 controller library v1.6
DomoticHome is a simple and lowcost way to bring some smartness in the house. What you need is only An Arduino with Ethernet shield, an Android device and some electronic skills.
It can do what with Web application ?
- automatically generate the code for arduino
- automatically store data on web app by using API KEY, don’t need to write a line of code
- show graphs about data stored
- support for Chibi Arduino Continue reading
Now on to finding the set point, place your bot on the dead center of the line. The position or the third column of the readings above will give you your ‘set point’. Note it down separately.
If you have time,verify the set point before your final run, more on this will come up in the tuning section.
Now we’ll build the complete PID algorithm. Continue reading
The algorithm is the one thing that determines the performance of a line following robot more than anything else. The most basic algorithm , is the one which uses only one sensor. The sensor is placed in a position that is a little off centered to one of the sides, say right. When the sensor detects no line the robot moves to the left and when the sensor detects the line the robot moves to the right. A robot with this algorithm would follow the line like shown in the picture below
The PID algorithm uses three constants, Kp, Ki and Kd to function. They are shorthand notations for proportionality, integral and differential constants respectively. These three constants have to be set by you after testing, and define how good your control works.
Now let’s look at how to develop a simple PID control algorithm.
Use the Arduino function analogRead() to retrieve sensor values. You’ll need an array to store these variables. Use Serial.print() to display these sensor values and observe them through the serial monitor in the Arduino IDE. If you’re using five sensors connected at analog pins 0-4, your code would look somewhat like this; Continue reading