# Creating Schematics in Inkscape

## How to make interactive schematics for the Android App.

Brief Summary
Circuit diagrams can be boring sometimes, and ExpEYES has tried to make them more appealing by making them dynamic and interactive. As can be seen from the cover image, this means that voltmeters in the schematic show values in real-time, the function generators can be dynamically adjusted , and derived parameters such as currents are also calculated and updated continuously.
June 23, 2019
Jithin B.P.

## Introduction

Interactive schematics can be created by instructors/users of the app using any vector graphics editor such as Inkscape. The android app is designed to interpret the generated SVG file, and automatically insert dynamic content.

## The procedure

• Simply create a schematic diagram using the various vector tools
• Insert text elements at the various control and measurement locations in the schematic
• Set the text of each of these elements to what they represent. e.g , for A1 voltmeter. If you wish to use some other text, the ID of this element (Ctrl-Shift-O) should be set to A1
• These are the various Text IDs supported.
• A1,A2,A3,SEN - All are voltmeters
• WG - Waveform Generator. You can also add parameters in the description field as shown in the animation below.
• SQ1, SQ2 - Square wave generators
• PV1, PV2 - Voltage sources
• SR04 - Echo based Distance measurement module
• BMP280:0 - Temperature read from a connected BMP280 sensor
• BMP280:1 - PRESSURE read from a connected BMP280 sensor
• BMP280:2 - HUMIDITY read from a connected BME280 sensor
• Many more sensors in the above format. eg. MPU6050:5
• Check out the animation below on how to insert a WG waveform generator element. The ID is being set to WG, but simply writing WG will also do the job.

## Adding configuration options to these parameters

You may want to further configure these parameters , such as setting the minimum and maximum ranges of the gauges for the outputs, and their default values. A graph to monitor the inputs as a function of time may also come in handy. The following examples show how to do this:

• Add a text element called WG to the drawing
• Right Click on it and open object properties . You can also select the text and press Ctrl-Shft-o
• In the description field of WG, add the following contents to set the minimum, maximum, and initial value of the sine wave output
min=10
max=2000
value=1000


Simple enough? Here’s how to add a graph that records as a function of time.

• Add a text element called SR04 for measuring distance
• Enter the following in its description field
w=150
h=150

logging=true
duration=20
ymax=200


w, h are width and height. They are 100 by default, so we have made the block bigger logging=true will result in a graph where xaxis will be 0-20 Seconds. y axis will plot readings from the SR04 sensor. Tapping on the sensor block will reset the graph and make it start from the beginning.

For further details, check out the post on the SR04 sensor here

• Certain values may be needed to be calculated from a combination of measured values.
• Such as current across a load resistance equals the voltage across it divided by the resistance.
• These elements can be added by inserting text of the form EQ:x where x is the equation
• In the animation below, an equation to calculate load current is inserted into the file. Instead of the ID, setting the text directly will now work

Certain experiments might require an output parameter to vary from one point to another in equal steps, and an input be recorded along with it.

In order to do that, select the output, e.g. PV1 , and add the following to its description field. The following example is from the Ohm’s law experiment

min=-5
max=5
stepsize=0.1

#Configure Automatic Sweep

sweep=PV1
title=V(A1) vs I ( A1/1000)
start=-5
stop=5
stepsize=0.01
delay=1
settling=2

xaxis=A1
xmin=-5
xmax=5

yaxis=A1/1000
ymin=-.005
ymax=.005


PV1 is instructed to vary from -5 to 5 in 0.01 steps. A1 (Voltage across the resistor) is plotted against the current (A1/resistance).

• Certain experiments might require the use of an oscilloscope
• You can tap on any analog input( A1, A2, A3, MIC ..) to open up a single channel popup oscilloscope
• For multi-channel scopes with flexible parameter configuration options, add an element with text GRAPH:x . x can be any number.
• Follow the animation below on how to add a 3 channel scope for the full-wave generator experiment

## Results from the Android App

### Screenshot of the above from the App

• Notice how the values and plots are dynamically generated. Watch animation here
• The (INSTRUCTIONS) tab contents can also be set by adding text matter in .md format to the description field in the SVG file’s metadata. This procedure is shown in the next section

## Adding instructions to the experiment

• Open the document properties, and paste the instructions in .md format into the description field.
• If you wish to insert images, you must first generate an img tag in html containing the image data in base64 format. This can be achieved by using online resources such as https://codebeautify.org/image-to-base64-converter . All you need to do is to upload your image, copy the html<img> code , and paste it verbatim into your description of the experiment.

• The app will load the description into the INSTRUCTIONS tab
• It will then convert the .md format text into appropriate html
• It will render any html tags including ones into images
• Result below

• The above INSTRUCTIONS were generated using the markdown source below
• This includes one image in base64 format.
Fullwave rectifier using PN junctions
=====================================

A half wave rectifier output depends on the filter capacitor for a long duration to provide DC output. This
results in larger ripple and not suitable for higher current. A fullwave rectifier solves this by providing
output for both negative and positive halfcycles. However it requires two out of phase AC inputs, generally
provided by a transformer with a center tap.

Objective
---------

Make a full wave rectifier, using two diodes. Two AC waveforms,
differing by 180 degree in phase, are provided by the WG and \bar{WG} outputs.

Procedure
---------

-  Make connections on a breadboard
-  Enable A1, A2 and A3
-  Set WG to 1000Hz and adjust timebase to view 4 to 5 cycles

Discussion
----------

Adding capacitors to reduce the ripple is left as an exercise to the
user. This experiment is only to demonstrate the working of a full wave
rectifier, it cannot provide more than few milli amperes of current.

Why full-wave rectifier is superior to half-wave rectifier ?