DS-1302 RTC Clock Module for Arduino

DS-1302 from Maxim (data sheet download) is a cheap RTC chip. Below are some of the salient features. Real-Time Clock Counts Seconds,Minutes, Hours, Date of the Month, Month, Day of the Week, and Year with Leap-Year Compensation Valid Up to 2100 Simple 3-Wire Interface 2.0V to 5.5V Full Operation TTL-Compatible (VCC = 5V) 31 x… Continue reading DS-1302 RTC Clock Module for Arduino

Arduino – Communicate With Server – Part 3 – Web Based Panel

This is the code for the web based panel (web based UI) that will display the data received from arduino or can send some command to the Arduino All communications are done through a server (web server) The frontend code <?php date_default_timezone_set(“Asia/Kolkata”); $conn = mysql_connect(“localhost”,”root”,”xxxxxxxxxx”); if(!$conn) {     echo “Error: failed to connect DB”;   … Continue reading Arduino – Communicate With Server – Part 3 – Web Based Panel

Arduino – Communicate With Server – Part 2 – Server Code for Saving Data

This article shows the server side code for a server which is gathering or sending data by polling method to an Arduino device. This method or code is putting less load on the server (compared to socket) but data transmission is slower than socket. <?php date_default_timezone_set(“Asia/Kolkata”); $conn = mysql_connect(“localhost”,”root”,”**********”); if(!$conn) {     echo “Error: failed… Continue reading Arduino – Communicate With Server – Part 2 – Server Code for Saving Data

Arduino – Communicate With Server – Part 1 – Arduino code

The below code send some data (temperature and pressure here) to a server and reads back some data from server. The send part works every 5 minutes and the read part works every 5 seconds. This code works by polling method. All delays might have room for optimization #include <SFE_BMP180.h> //from sparkfun #include <Wire.h> #include… Continue reading Arduino – Communicate With Server – Part 1 – Arduino code

PHP Socket Client

This is a simple client that is running two different requests. One at every 2 seconds and another every 5 minutes. The 2 second one retrieved data from server and the 5 minute one sends data to server. <?php set_time_limit(0); ob_implicit_flush(); $host    = “xxx.xxx.xxx.xxx”; $port    = 1250; $lastUpdate = time(); while(1) {     if(time() -… Continue reading PHP Socket Client