Wednesday, 9 November 2016

Connect Arduino and Python

Hi All,

The steps are simple. Here I am connecting my IOT Device Arduino with Python

Connect Python and Arduino


At First Run Arduino and select COM3 as port
with LDR Program
------------------------------------------------------------------------------
const int ldr = 0;    //A0 assigned as LDR pin.
int value = 0;        //Store values from LDR.

void setup()
{
  Serial.begin(9600);   //Fix serial baud rate at 9600bps
}

void loop()
{
  value = analogRead(ldr);    //Read the analog values from LDR. or simply use value=999
  Serial.println(value);      //Print to serial monitor.
  delay(250);                 //Delay of 250 milliseconds (1/4th of a second).
}

------------------------------------------------------------------------------
Then in the Python
install serial first.
then type this command

------------------------------------------------------------------------------
import time;
ser = serial.Serial('COM3', 9600, timeout=0,parity=serial.PARITY_EVEN, rtscts=1)
while True:
s=ser.read();
print(s);
time.sleep(3);
------------------------------------------------------------------------------

Sunday, 6 November 2016

Running the First ARDUINO Program

Hi All,
Ready for the first program.
See the code to blink LED in Pin 13 of Arduino with a delay 2000 (2 seconds).



How to compile and Run is given in the images.


Good luck.
Bye

Running Arduino and change the setting

Hi,
You will be curious to run your first program.

Follow these steps.
Double click the file 'arduino.exe' from the installation folder  and press OK button .


see the screen flashing showing the application launching.



See the Application GUI for programming and running.


Make sure the device (Arduino UNO) is selected. If you are using NANO board then the settings should change.

See also the port (COM3 for windows) is correctly selected .
This port will change for Ubundu.





Downloading and Configuring Arduino

HI All,

Follow the steps below to download and configure Arduino

Download the software from the site : https://www.arduino.cc/en/Main/Donate


Extract the software and go to that folder
Go to the drivers folder and see the contents.


 Choose dpinst-x86 and run for installing drivers for the hardware. Double click that and install.


Now we can see the hardware recognized by your system. Go to my computer and right click 'My Computer' and take properties.


Select the Device manager option and click it
See the device 'Arduino Uno' and Port 'COM3'


Wht do you know about Internet of Things

Hi All,

From the title itself, you could easily infer this concept. What would be that? Anyway Internet will have a great role to play, right?
Ok, let me come to the topic.
Consider a simple example. You missed your shoes which was kept outside a hall. You suddenly google the same, "where is my shoes",  funny right?
Yes you can..and you will...
The 'thing' inside the shoes will keep you connected to the internet, and so to your google account too. So that would be easy for a GPS service to locate the position if it is static or the direction if in motion.
Now I hope you got what would be this "Internet of Things".
The entire things you handle can be connected to Internet through this terminology, with a nice handset.
For this purpose we must have some skills  to program and connect.
I propose a combination of Python (help exchange information to and from a micro controller) , Arduino (micro controller in which sensors are connected), PHP (the user end, which interact with Python module and Database Server), Android ( the user end, which interact with Python module and Database Server), Mysql (to keep the data in a structured form and can be used for data mining).

You may use my blogs

http://phpissimple.blogspot.in/   - for PHP and MySQL

http://pyissimple.blogspot.in/ - for Python Programming

http://android-is-simple.blogspot.in/    - for Android programming

On the go I shall add more topics into this list. Example programs and pictures.
See you soon.
Bye