First thing I thought was measuring current (A) versus voltage (V). But I suppose both are sinus shaped.

The next though I had is that the sensor's purpose was to measure the load (A) on a wire, so maybe the sensor is actually making it a flat line already?

I honestly have no clue, this is just me guessing.

Herewith I have attached a schematic diagram of the setup.

130

For the pyhton codes, I have referred following link https://github.com/OpenLabTools/RPi_ADS1115/blob/master/code/continuous_read_adc.py with some modification. It is mentioned below:

```
from Adafruit_ADS1x15 import ADS1x15
import time
import numpy as np
import matplotlib.pyplot as plt
pga = 1 # Set full-scale range of programable gain amplifier
ADS1015 = 0x00 # Specify that the device being used is ADS1015
adc = ADS1x15(ic=ADS1015) # Create instance of the class ADS1x15 called adc
# Function to print sampled values to the terminal
def logdata():
print "sps value should be one of: 128, 250, 490, 920, 1600, 2400, 3300, otherwise the value will default to 1600"
frequency = 1000 # Data rate in Hz
sps = 3300 # maximum sps value for ADS1015
time1 = 10 # how long to sample in seconds
period = 1.0 / frequency # Calculate sampling period
datapoints = int(time1*frequency) # Datapoints is the total number of samples to take, which must be an integer
dataarray=np.zeros() # Create numpy array to store value and time at which samples are taken
adc.start_adc(0, pga, sps) # Begin continuous conversion on input A0
startTime=time.time() # Time of first sample
t1=startTime # T1 is last sample time
t2=t1 # T2 is current time
V_dd = 3.3 # ADS1015 is powered with 3.3V from RPi
n = 12 # No. of bits in ADS1015
senstivity = 0.022 # Sensitivity of WCS1600 in V/A
for x in range (0,datapoints) : # Loop in which data is recorded
dataarray = time.time()-startTime # Store the sample time in the numpy array
dataarray= ((adc.get_last_result())*(V_dd)/(2**n))/ senstivity # Get the result in Amperes of the last conversion from ADS1015 and store in numpy array
while (t2-t1 < period) : # Check if t2-t1 is less then sample period, if it is then update t2
t2=time.time() # and check again
t1+=period # Update last sample time by the sampling period
return (dataarray)
dataSamples = logdata() # Call function to log data
# Plot time data
TIME = dataarray[:,]
CURRENT = dataarray[:,]
plt.plot(TIME,CURRENT 'r', linewidth=1)
plt.xlabel('Time (s)')
plt.ylabel('Current (A)')
```

The input side the charger reads (110-220 V, 50 Hz, 0.3A).So we can expected a sinusoidal wave for the current time stamp with maximum current restricted to 0.3A.

However, on plotting the time vs current below graph is achieved which is obviously wrong:

131

Can somebody please let me know why am I not getting sinusoidal waveform, I would be very much appreciative

]]>