Science Technology Engineering and Mathematics (STEM):

STEM Land:

STEM Land  is a place for ‘Learning’ which we are creating in Udavi school. The vision behind the STEM is learning based on Concepts, practical observation & abstraction. In short “Mediocrity to Excellence“.

It has large variety of materials ( Robot, Physics based materials & kits, Demonstration models, Electronic components & tools, variety of Measurement Equipments, Montessori & Jodo Gyan materials, Strategy games, Puzzles and Books). So we can engage all the students based on their capacity level without letting them feel overburdened  or bored. Most of the students get enthusiastic and become active learners when they get into a new environment ( where the usual text books are absent). So it is added advantage of STEM.

IMG_20150806_103441573-1IMG_20150806_103552028

 

 

 

 

 

This three students (7th Grade) have assembled the Robot parts (nearly 300 small pieces). They also programmed the Robot for a challenge I set for them (with guidance). Here they learnt how to be systematic (while assembling the parts of Robot). And became programmers when they started to  program the Robot.

IMG_20150918_163222

IMG_20150912_120227949

 

 

 

 

 

This student is an example of perseverance. Many people gave up when they were trying to solve this square puzzle (including me).  One of the reasons was, we got bored. But he pursued  till he reach it. Our curriculum needs this type of activities to empower students to use their creativity to solve problems, ask questions and continually learn.

IMG_20150912_115205909

Students  need to be challenged. At the same time not  be bored. I hope strategy games are one of them which satisfy this condition.  And this made them think and observe keenly without supervision.

Calling C function from Python using thread

ThreadTest:

Lets loot at a sample program for better understanding of threads. It was written in python extension C( calling C function from python). This is an example for parallel processing. So I made a program to print string ( some words or sentence) after every 4 seconds. But the goal is to modify the default time of printing( delay_time) & string to be printed ( command) without stopping the process (while the program is running). There arise a concept of thread. I used two mechanisms in the code.

1. Global Interpreter Lock (GIL)

2. Mutual Exclusion Lock(MUTEX Lock)

Global Interpreter Lock (GIL) is a mechanism used in computer language interpreters to synchronize the execution of threads so that only one thread can execute at a time. An interpreter which uses GIL will always allow exactly one thread to execute at a time, even if run on a multi-core processor.

The Python interpreter is not fully thread-safe. In order to support multi-threaded Python programs, there’s a global lock, called the global interpreter lock or GIL. Therefore, the rule exists that only the thread that has acquired the GIL may operate on Python objects or call Python/C API functions.

This is so common that a pair of macros exists to simplify it:

Py_BEGIN_ALLOW_THREADS

… Do some blocking I/O operation …

Py_END_ALLOW_THREADS

Mutual Exclusion Lock(MUTEX Lock):

Probably the most commonly used synchronization option to accessing the shared data. Simply, it used to synchronize threads so that only one thread can make modifications to shared data at any given time.

This process is done by two operations,

m.acquire() # Acquire the lock

m.release() # Release the lock

Only one thread can successfully acquire the lock at any given time . If another thread tries to acquire the lock when its already in use, it gets blocked until the lock is released. So it avoids race condition.

Explanation:

Here, I am calling c function from python. To pass the variable to the process , i need to run the process(main) as thread. So i can pass the variable to the main without affecting the program execution. In order to do that i need to create three more python objects to set the value of delay_time, command & quit command.

Program Code:

#include <Python.h>
#include <windows.h>
#include <time.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
// Global Variables
int delay_time = 4;
char command_py[10000] = {};
int i;
pthread_mutex_t    command_py_mutex            = PTHREAD_MUTEX_INITIALIZER;
int quit = 0;
// Creating Python Object
static PyObject* ThreadTest_print(PyObject* self)

See More

Python Object:

In the function ThreadTest_set_st(), I declared a character pointer instead of character array is to avoid the the clash between the c and the python while while allocating the  memory  for the local variable (command_local). So i created the pointer for that local variable in which python allocates the memory space.

I also created ThreadTest_set_dt function to prove,  simply getting the user input directly to the variable ‘delay_time‘ could not work at all So one need to be more careful when creating this sort of functions.

Compilation:

First, i need to run main function as thread. Then, i can pass the string to the main function using following procedures in python terminal.

import Threadtest    //  this used to import the module

import thread         //   this used to import the thread

thread.start_new_thread(ThreadTest.pr, (),)     //  to start the main as thread

ThreadTest.set_st(‘ Hello’)     // to pass the string

ThreadTest.set_st(‘ q’)    // to quit the program

Since, there i made mistake in the ThreadTest_set_dt function i could not call that one. When we modify the ThreadTest_set_dt function according to latter, then this code will print the both function’s arguements .

ThreadTest

Amplifier – Simulation and Results

First started with constructing constant current source using PNP transistor with 9V supply voltage.

CONSTANT CURRENT SOURCE:
1

 

 

 

 

 

 

voltage reading:    3.32V                                               current reading:332mA

43

AMPLIFIER:
Added one more transistor on NPN in the circuit with the same supply voltage of 9V and input signal of 0.2V.

Schematic diagram:
6

Simulation Result:

b

 

 

Red –> Amplified Output Voltage

Green –> Input Voltage

 

 

 

Schematic diagram:

In order to increase the gain of the Amplifier, added one capacitor C1 parallel with R6 resistor.

5

Simulation Result:
c

Red –> Amplified Output Voltage

Green –> Input Voltage

 

 

 

SpeeDe V_03

SpeeDe V_03:
The aim of the third version of the SpeeDe is to improve the sensitivity to capture the speed of even smaller object. In this regard, I have done some modification in the program ( using the concept of interrupts in Arduino).

ARDUINO PROGRAM:                                                                                                                       // include the library code:
#include <LiquidCrystal.h>
// constants won’t change. They’re used here to
// set pin numbers:
// variables will change:
volatile int State = 0;         // variable for reading the pushbutton status
// Start and stop times
volatile unsigned long start_time_us = 0;
volatile unsigned long stop_time_us = 0;
float delta_time;
float speed_var;

See More

Reference:                                                                                                                             http://www.auraauro.com/uncategorized/speede-v-01-2/
http://arduino.cc/en/Reference/attachInterrupt

 

Sampling Theorem

SAMPLING:   A continuous time signal can be represented in its samples and can be recovered back when sampling frequency fs is greater than or equal to the twice the highest frequency (fm) component of message signal. i. e  fs 2fm.

Consider a continuous time signal x(t). The spectrum of x(t) is a band limited to fm Hz. Sampling of input signal x(t) can be obtained by multiplying x(t) with an impulse train δ(t) of period Ts. The output of multiplier is a discrete signal called sampled signal which is represented with y(t) in the following diagrams:

Samplling

ALIASING:

Different signals to become indistinguishable (or aliases of one another) when sampled is called Aliasing. Aliasing occurs when a system is measured at an insufficient sampling rate.

aliasing

 Reference:

http://www.tutorialspoint.com/signals_and_systems/signals_sampling_theorem.htm

Demonstration of Division

Many  teachers struggle with teaching division to children and I have been thinking about this recently. I think there are a number of factors contributing to this. Firstly,  there is a huge range of level of understanding of the concept of division and secondly the concept itself can be thought of as building on children’s understandings of addition, subtraction and multiplication. The spread of different levels of understanding is likely to make any class “mixed ability” for this topic. There are also difficulties with the written algorithm. Altogether, it is a complicated picture. So I Started to create the division program in Scratch to give demonstration.

Division2

See more : https://scratch.mit.edu/projects/56911106/

 

 

CIRCUIT ANALYSIS

CIRCUIT ANALYSIS:
Lets analysis the following circuit.

111

This circuit consist of two nodes named as v1 & v2
Consider the input voltage is vin .
Lets say the current ‘i’ is passing through the node v2 .
Then the voltage at the node v2 is given by
23
Voltage at the node V1 is given by
43
Then the input voltage vin is given by
98
Substituting the value of V1 in equation 3 we get,
56
09    (Equation 4)

Then the current ‘i’ passing through the node V1 is,
76    (Equation 5)

The transfer function (by substituting the value of ‘i’ in equations 1 & 2)
54

Stewardship for New Emergence

To me, workshop simply means learning new technologies and technical tools (as I only attended technical workshops) . Stewardship for a New Emergence (by Monica Sharma) was totally new for me & gave different experience.

Sometimes, I failed to listen others due to some background conversations in my head. These conversations created misunderstandings in communication. But, I never thought of how I can let it go. I didn’t even noticed this. But this workshop gave a link to think about that. Yes, the primary steps to solve the problem is to start noticing them and making a conscious choice of let it go. 

Before attending the workshop, I thought someone will come & give lectures. But what I experienced was something higher . They taught the tools as well as created the environment to practice them with a peer(co participant).

Most case, I used to avoid pin pointing the mistakes in one’s work though it is helpful for them to grow. Because I believed in that i am not good enough to give feedback.  This workshop gave some procedure to give feedback for others to grow. It also helped me to see commitments behind the complaints of others and I learnt that the growth happens beyond the comfort zone.

World is extraordinary and filled with many opportunities. Its all about our perspective of seeing the world. So stand up & open your window to get there where you wished to reach in spite of difficulties that may surround you. And remember, confusion & mistakes are birth  place for knowledge & perfection. In the world no one has the power to make me to feel bad without my permission. If I bounded with emotion, it will reduce my energy and can not allow me to further action.” These are the few things I absorbed intensely at workshop & planning to practice in my life.

Most of the things which I learnt in the workshop are not completely new to me or to anyone. But the thing is it stimulates me to think about it consciously which I never did in my past.

 

Speede V.2

SpeeDe V.1 -pdf

upgraded features ;

– 12 v battery

– improved LDR sensitivity

changes made ;

– 12 v battery

On Speede v.1 we used 2x 9v batteries, one for driving the arduino board and another for powering the laser. This did not suit the device as it kept on draining up the batteries. Which made us upgraded the battery source to a 12 v rechargeable battery, but the laser and the arduino kit could only handle 9v supply. This made us connect an IC 7809 from the battery source and then supply the components ( ic 7809 simply burns the excess voltage i.e.3 v and provides a supply of 9v as an output)

DSC_0490 DSC_0443 DSC_0444

– improved LDR sensitivity

The LDR’s sensing the laser were affected by external light sources, this compromised Speede’s ability to work in a brighter environment. In order to eliminate this factor, two pvc tubes were fitted around each LDR.

DSC_0447 DSC_0450

Demonstration of Fourier Series using Python Code

FOURIER SERIES:

In mathematics, a Fourier series is a way to represent a wave-like function as the sum of simple sine waves. More formally, it decomposes any periodic function or periodic signal into the sum of a set of simple oscillating functions, namely sine and cosine with the harmonics of periods. So, Fourier series are used in the analysis of periodic functions.

Fourier Series:
begin{displaymath}A_0 + sum_{n = 1}^{infty} (A_ncos(nx) + B_nsin(nx)).end{displaymath}
where,

begin{displaymath}left{begin{array}{lclr}<br /><br /> a_0 &=& displaystyle frac{1}{2p...<br /><br /> ..._{-pi}^{pi} f(x) sin(nx)dx,& 1 leq n.<br /><br /> end{array}right.end{displaymath}
Here i used python programming tool instead of manual calculation to represent the Fourier
Series with some examples
.
paste

PYTHON CODE:
import numpy as np
import matplotlib.pyplot as plt
resolution = 0.0001
x = np.arange(-np.pi,np.pi,resolution)
square =  np.array(x) ……
See more

OUTPUT WAVEFORM:

1111

Python Output:
Output:
>>> a0
0.99998642294279794 (~1)
>>> b1
-0.63661977194539721 (-2/ π)
>>> b3
-0.21220658952264121 (-2/ 3 π)

111