Explore latest trends in technology, internet, and more on Sarab Tech Blog!

Temperature-based Relay Control using ATTiny13a

Wednesday, September 25, 2019 12:14 AM

Click Here to View the Video on YouTube

 

Simple circuit is powered by 9V Battery which serves to detect temperature, i.e. whether same is within the prescribed range or not using LM35 Temperature Sensor connected to ATTiny13a MCU. MCU then controls a Relay Switch to turn on or off any electrical appliance. 9V supply is converted into 5V using the step-down board as shown.

DIY mini-computer using Raspberry Pi

Tuesday, September 24, 2019 11:59 PM


 Click Here to View the Video on YouTube

Raspberry Pi is a great little development board which can be very useful in acting as an Edge device for your IoT Projects as shown in the video it can run Linux-based operating system, one can write C++ programs onto it and even have a small web-server running using its powerful hardware and software support.

Implementing Outcome Based Education (OBE)

Wednesday, July 24, 2019 9:04 PM

Hello,

            I have previously talked about reforms required in the current education system highlighting few flaws of the education system as we know it. One of the ways in which change can happen is via certain kinds of transformations one of which is the subject of today’s post.

 

             Outcome based education (OBE) is a Bloom’s Taxonomy-driven (via usage of action-verbs) student-centered instruction model that focuses on measuring student performance through Program (PO/PSOs) and Course Outcomes (COs). In the OBE model, the required knowledge and skill sets for a particular degree programme are predetermined and students are exposed in accordance to the best practices in curriculum preparation, teaching pedagogical strategies, and evaluation methodology for the duration of a respective program.

 

                OBE-based Attainment in a degree program is measured via direct and indirect measures wherein direct measures such as PO/PSO or CO Attainments require students to demonstrate their knowledge and skills thereby providing tangible, visible, and self-explanatory evidence of what a student have and have not learned as a result of a course, program, or activity, i.e. actual student work is measured or assessed. On the other hand, the indirect measures consider feedbacks, opinions, thoughts, or perceptions from students' or alumni's own knowledge, skills, attitudes, learning experiences, or academic services received during the program. Indirect measures supplement direct measures of learning by providing information about how and why learning occurred.

 

 Thank you for reading and I hope you’ll find this post useful and in case if you wish to add any additional point to the post, then please leave a comment below.

USB Communication with IoT Devices

Tuesday, June 18, 2019 11:14 AM

Hello,

        IoT devices are taking over the world by being always connected and extremely functional to serve as a solution for variety of technical requirements. I’ve been experimenting with them for a couple of months and found them technically intriguing and worth great value. However, if you’re experimenting with an IoT device or wish to communicate with the same using a regular desktop-pc or laptop running any modern OS, there will be a need to communicate with the device after deployment to debug issues or collect sensors data.

This communication with the IoT Device usually happens through the famous and extremely versatile Universal Serial Bus (USB) communication protocol found in modern electronics hardware. In order to use an IoT device to communicate with a pc, one can simply connect the same via regular UART/USB interface cable and use following code (written in C#) to communicate with the device:

Code Snippet:

[DllImport("user32.dll")]    //Required for the Serial Communication

static void Main(string[] args)

{

 Initialize();

}


private static void Initialize()

{

SerialPort mySerialPort = new SerialPort("COM3"); //Port Selection

           mySerialPort.BaudRate = 115200; //Set as per setting on Device

           mySerialPort.Parity = Parity.None;

           mySerialPort.StopBits = StopBits.One;

           mySerialPort.DataBits = 8;

           mySerialPort.Handshake = Handshake.None;

           mySerialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);

           mySerialPort.Open();

           Console.WriteLine("Awaiting for the data...");

           Console.ReadKey();

           mySerialPort.Close();

}

private static void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)

        {

            try

            {

              SerialPort sp = (SerialPort)sender;

              string indata = sp.ReadLine();

              Console.WriteLine(indata); //Print received information

            }

            catch (Exception ex)

            {

                Console.WriteLine(ex.Message.ToString());

            }

}



Business Rule Engine (BRE) in C#

Monday, June 17, 2019 11:03 AM

Hello,

            I’ve been doing quite some research for an apt technical solution (in C#) for implementing automated business rules on large datasets, whether stored locally or in the cloud, which allows dynamic loading of rules, facts, and target datasets. So I came across various implementations, concepts, ideas, and models boasting this functionality with certain pros and cons of each implementation; however I couldn’t find anything simple enough until I decided to build one myself.

 First task was to understand the architectural requirements for such a solution and then proceed towards building the structural dynamism using code. For such a system to be built, I resorted towards creating a foundational database structure which allows CRUD operations for creating / storing business rules, then moving towards loading rules in-memory and on-demand within the context of supplied datasets; and ultimately executing those rules on the supplied dataset for results. Results produced predictively enough had a requirement to further notify or take an action if a rule was passed or failed during execution. Here one important concept to implement at this stage was to ensure the principle of recursion commonly used in coding. Recursion principle ensures firing of rule engine again when a condition is matched regardless of the program flow. This ends up creating a very dynamic rules execution plan / engine / workflow which works quite magically ‘as-and-when or if’ the data becomes available for an in-memory object. I see some application of this in real-time systems such as IoT devices or services. Using C# language’s latest features allowed me to have above code implementation as neat and readable as possible for any future modifications.

 

Truly interesting stuff!

Insufficient Disk-space in MS SQL Database!

Sunday, March 3, 2019 2:21 AM

Hello,

 One needs to be always cautious about the physical size of the back-end database to prevent certain scenarios which can cause the front-end application to malfunction due to age old problem of running out of storage space!

 Recently I had used an IoT Device to stream data collected from few deployed sensors and save all that into a back-end MS SQL Database which over a period of time ran out of the storage space on the server. Yeah! Imagine how many rows were dumped into the database system to cause this scenario. Anyways, to remedy the  situation following SQL Script  was extremely useful:

 

use "YourDatabaseName"

exec sp_spaceused;

 

USE YourDatabaseName

GO

 

SELECT

  t.Name                                       AS TableName,

  s.Name                                       AS SchemaName,

  p.Rows                                       AS RowCounts,

  SUM(a.total_pages) * 8                       AS TotalSpaceKB,

  SUM(a.used_pages) * 8                        AS UsedSpaceKB,

  (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB

FROM

  sys.tables t

  INNER JOIN sys.indexes i ON t.object_id = i.object_id

  INNER JOIN sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id

  INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id

  LEFT OUTER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE

  t.Name NOT LIKE 'dt%'

  AND t.is_ms_shipped = 0

  AND i.object_id > 255

GROUP BY

  t.Name, s.Name, p.Rows

ORDER BY

  t.Name;

GO

Expert training seminars, faculty mentoring, and Q&A sessions