Introduction to Embedded Systems (Project Report)

Group Members
Imtiaz Ahmed (033-20-0001)
Ali Nawaz (033-20-0018)

Digital Multimeter

<

p>
Project Overview

Literature Review

We are following Electronoobs for this project.This device has two versions so we briefley reviewed both versions. First version has different probes for each mode and buttons for selecting scales.



Usually commercial digital multimeter has only two probes for all modes and a switch to change modes. Second version was modified version of first and it has only two probes for all modes and a switch to change modes.so, we decided to make device which is modified version of both devices and has two probes for all modes and a SPDT switch for current mode and a rotary switch to change modes.We also excluded charging circuit of the devie to reduce the size of our device and give it power using a USB cable.



Introduction to Project

Digital Multimeter is a device that measures the value of electrical components like resistor,capacitor,inductor,voltage and current. Multimeter is largely used in electrical engineering programs and the purpose of choosing this project is that it is related to our field and we wanted to know how multimeter works in backend.



The Problem

Eletrical devices are composed of different electrical components. Mainly the components that are used are resistors,capacitors and inductors. So for designing of electrical devices we need to know exact value of the electrical components for there proper working. As for measuring values of each components we have different meters like for resistance we need "ohm meter", etc. This is costly as well as difficult for the usage.

Solution of the Problem

A multimeter is composed of Ohm meter, Volt meter, Ampere meter, etc. Since we use this device so often it was a very exciting idea for us to make our very own.


Design Requirements

We have to design a device which is portable, accurate upto 90 or 95%. We recognize that making a more accurate device will intern require highly accurate discrete components (which are again costly and hard to locate in local market), Also we wanted the device to operate on 5V supply as this is easily available in lab environment. .

Sample image of final design

For our product, initially, we thought of a simple design keeping in mind display of the input and out entities as well as sockets for input, output.


Project Execution Plan

This was our semester design project so we had to decompose our project into smaller task. The list is enumerated below:

1- Literature Review
2- Understanding the working principle of components
3- deveolping a PCB
4- Fabrication of PCB
5- First soldering the componets
6- After succesfully testing the Atmega328 and ADS1115, soldering the rest of the components
7- Energizing the circuit and troubleshooting all the errors
8- After getting desireable results, Designing the case for the PCB
9- Preparing the product for the final Product


We learned how to work as a team, we learned to helped each other. Sometimes I helped my teammate if he gets stuck in some problem and sometimes my teammate helped me when i get stuck in some problems.We also learned project managemnet and how to complete a task and manage.

Deligation of Tasks


Bill Of Material

S.No: Device Description Unit Price
1. Atmega328pu microcontroller 340/-
2. ADS1115 Voltage Sensor 800/-
3. OLED 0.96" Display 450/-
4. Other Matrials PCB, wire, board ,connectors etc 300/-

Brief Description of Major Components

1. Atmega328:

ATmega328 is an 8-bit, 28-Pin AVR Microcontroller, manufactured by Microchip, follows RISC Architecture and has a flash-type program memory of 32KB. Atmega328 is the microcontroller, used in basic Arduino boards i.e Arduino UNO, Arduino Pro Mini and Arduino Nano.


Paris


Paris

Atmega328 Datasheet


2. I2C-OLED 1.3inch display OLED:

This 1.3 inch display makes this one of our smaller versions; perfect for small projects, wearables, and other portables. You can view its White and black graphics from a wide, 160-degree angle range.Basically it is a monochrome display which has two colors, Black and white. It has a low, low 0.06W power consumption in regular working conditions. Extreme temperatures are even no match for this module which can operate in -30 to 70 degree C temperatures.
=> Display Size: 1.3 inch
=> Dimension: 26.3x26.1 mm
=> Display area: 21.7x10.9 mm
=> Display Driver IC: SH1106
=> Resolution: 128x64
=> Port: IIC
=> Operating Voltage: 3.3-5V
=> Display color: Black, White



OLED 1.3inch LCD Datasheet


3. 16 Bit Analog to Ditial Converter (ADS1115):

ADS1115 is an ultra-small, low-power, 16-bit precision AD converter (Analog to Digital Converter) with an internal reference voltage. Mainly used in high-precision instrumentation, automotive electronics, battery voltage collection and other high-precision collection occasions. Its general function is to amplify and convert analog waveforms to digital signal for data analysis. ADS1115 has an onboard reference and oscillator. ADS1115 works in two modes SingleEnded and DifferentialMode. Data is transmitted through an I2C compatible serial interface; 4 I2C slave addresses can be selected. ADS1115 uses a single working power supply ranging from 2.0V to 5.5V.



ADS1115 voltage Sensor


4. Rotary Switch :

Rotary Switch is the key component in our project as it is used for changing modes, because our project contains five different circuits and to change the mode we are using Rotary switch (03x04) which has 3 inputs and 12 outputs, means 1 input is connected to 4 ouputs so by changing the mode all inputs will change its state from one output to another.




From the inner circuit diagram of Rotary switch (3 to 4) we can see that it has three inputs(A,B,C) and 12 outputs which means each input has 4outputs.so, A is connected with (1-4) and B with(5-8) and C with(9-12) pins. So, the rotary switch has 4states and by changing the states it means A,B and C gets connected to different pins.that's how we changing modes of our device.

4. ACS712 Current Module :

ACS712 is a current module which is used to measure current and it uses Hall-Effect in internal circuit to measure the current. It comes in different ranges, we are using 5A range module which will be good for our project.



Electrical Schematic Diagram

This is the schematic Diagram we are following from Electronoobs website. This deice contains different circuits which are all connected by rotary switch. This is very complex schematic, therefore it has been divided into different parts and described individually

Brief Description of Schematic

This schematic contains different circuits for measurement of different parameters such as resistance, capacitance, voltage, current etc. All circuits are connected with eachother through the rotary switch and Atmega328 microcontroller.Two probe headers are connected with all circuits by the rotary switch as we change the switch the probes gets connected to different circuit and that's how whole schematic is connected.

Resistance Meter

This is a simple circuit which contains two resistors in series and by using Voltage Divider Rule we measure resistance of unknown resistor. By using ADS1115 we measure voltage at resistor and we know the value of one resistor, input voltage so by using VDR formula we find value of unknown resistor.

Capacitance Meter

This circuit contains two resistors and an unknown capacitor, one resistor is used to charge the capacitor using D11 of Atmega328 microcontroller while other resistor is used to discharge the resistor using D13 of of the microcontroller, and by using this Timing circuit we can measure the value of unknown capacitor. We know that T=RC and one time Constant (T) is 63.6% of capacitor voltage, so we will measure capacitor voltage at one T and since we know the value of the resistor value therefore we can easily measure value of unknown capacitor.

Inductance Meter

This circuit uses LC tank circuits and by producing oscillations we measure reasonant frequency of the circuit and we know the value of capacitor. So, value of the unknown Inductor can be measured easily. Using Atmega pin we generate a spark and produce oscillations and by using an OPAMP we convert them into square-waveforms and by knowing T we measure Frequency as f=1/T and by knowing reasonant frequency we measure Value of unknown inductor.

Voltage Meter

Voltage can be measured by using ADS1115 directly but ADS1115 has limitations and it can only measure upto 6V. So, we have used two VDR circuits and Bridge Rectifier so now we can measure voltages upto 20V and also we can measure AC voltages because of bridge rectifier.

Rotary Switch

As the Rotary Switch has 3 inputs and 12 outputs we have connected positive probe and negative probe with two inputs and Vcc at third input. We have attached probes of each circuit with other pins. And with the ouputs of Vcc input we have attached different resistors and with A3 pin of Atmega, so when we will change the mode of rotary switch we will read analog value using A3 and use conditions in our code to measure the desired value. As we know that current is measured differntly because circuits becomes short therefore we have used a SPDT switch to connect probes with current. This is an important component of the schematic as this part connects all circuits with eachother. Two probes are at input of rotary switch and as we are changing the switch of rotary switch the probes are connecting with different circuit like resistance,capacitance and others that we want to measure. That's how this circuit changes modes.

Other circuits are about Atmega and ADS1115. and OLED headers and we excluded ADS1115 circuit and used ADS1115 module using 1x10 header in schematic and also excluded battery circuit and directly gave voltages using a USB cable

Problem While Prototyping

After we reviewed the literature we started by working on prototype of individual circuits, before moving to PCB designing we tried to verify each circuit on the breadboard and to understand it's principle of operation:

OLED interfacing :

We started from interfacing OLED with Arduino because this is is the main component to show results. As we are using 1.3O" LED (which has an I2C interface) with 4 pins for data interface and power.

It's two pins are given 5V and GND; while SCk/SCL pin is connected with A5 and SDA pin with A4 of Arduino.

At first we faced many problems in interfacing OLED by using Adafruit SSD1306 library; this was not working although on internet this was working fine on same code and same library.

We tried to change library and we used U8G library which is universal library for OLED displays which works as pages and it was working fine but as, our code is in void loop() means it will run again and again so the OLED was stucking at some point.

After troubleshooting for weeks we solved this problem as this I2C OLED uses SH1106 drivers instead of SSD1306 so we used same library SSD1306 but changed a little nbit in code and this OLED was working fine after.

These reference helped us in troubleshooting the OLED Display :

1. "Video tutorial OLED 1.3" 128x64 SH1106 " Blog tutorial by Mohammad Damirchi After alot of toil and tumble we finally managed to get our OLED to operate as desired



PCB Designing

After getting to understand the operation of individual components, we used Eagle software to develop the PCB for our project and we created the layouts in .PNG formats as the workflow of PCB fabrication process at Fablab requires picture format for its processing. Following is the final PCB layout:

Following is the PCB Schematic we designed in Eagle :



Following is the unrouted PCB :



Following is the routed and finalized PCB :





Following is the Top layer Traces :



Following is the Bottom layer Traces :



Following is the Top layer Outline :



Following is the Bottom layer Outline :



Following is the Top layer drills :



Following is the Bottom layer drills :



Challenges While Routing

The cicuit of our device was too complex because there were many components like resistors and capacitors so, the routing was overlaping. The problem was to place the components like rotatry switch, OLED, Output Probs and USB connector because these were the components that were going to be mounted on the 3D printed chassis. The implementation of the circuit required double layer PCB and a host of zero-ohms resistors to place all components in a small foot print.

Picture of Printed Circuit Board


For fabrication of our PCB, we used SRM-20 CNC machine. The fabrication workflow requires a monochrome picture generate necessary tool paths. The monochrome picture we took from Eagle software were then uploaded to the mods.cba.mit.edu and then we generated the ".rml" files needed for SRM-20 to fabricate the printed circuit board.





PCB soldering Process

Soldering is a very tedious / time consuming process, a small oversight negligence while designing the PCB can be take you back to square 1:



Bill of Material on a Paper


Following is the Picture of the components taken from the FabLab


Soldered Printed Circuited Board


After fully soldering the components, our board looked like this:


Picture of Successfully Operating Circuit




Fully Assembled System


Demonstration of operational circuit



Design of Our Algorithm


Main Functions and Libraries of the code



Libraries :
#include Wire.h
#include ADS1115.h
#include SH1106
#include Adafruit_GFX.h
2- Functions:
Adafruit_ADS1115 ads(0x48); for ADS1115
Adafruit_SH1106 display(-1); //because our OLED does not have any Reset pin
pinmode(pinnum,INPUT/OUTPUT) // to define which pin will be input and which will be output
digitalWrite(pinnum,HIGH/LOW) // to make any pin low or high
display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32 or 64 )
display.clearDisplay(); // to clear the display
display.setText();// to set the text size of OLED
display.setCursor(x,y);// to set where to write in OLED where x and y are rows and columns
ads.readADC_SingleEnded(2); // to read value from ADS1115 pin



Design Enclosure

The enclosure of our multimeter was fabricateded with the help of 3D-printer. To design the enclosure we used SolidWorks software. The images below show the CAD designs of the Enclosure.



References

1. Electronoobs
2- Ardino Project hub
3- Interfacing OLED 0.96 LCD With Ardino Uno
Datasheet of ADS1115 Module
5. Rotatry Switch datasheet-
6. Interface ADS1115- with ardino Uno

Credits Acknowledged

We owe a big thanks to the blog posts Electronoobs for a comprehensive tutorial which made it possible for us to materialize this project. The team at FabLab Sukkur IBA was a source of great help when we had difficulty relating hardware and software. Our instructor Dr Muhammad Asim Samejo helped us dealeing with the code as well as hardware. Sir Nadir was a great source of help when we needed help in design the printed circuit board, milling and eventually bringing it to life. Without all of these, our succes in this project was difficult if not impossible.

Zip file containing source code

click here to download Sourse code

Zip file containing sch and brd files

click here to download Eagles files

Zip file containing Enclouser Design files

click here to download Design files
Simple Slider using Flickity Plugin | HackerRahul.com

Slider showing all results:

Conclusion

During this time period we learned alot. We learned so much about PCB designing, Arduino coding, solid works designing. During this project we learned about literature review, team work and troulbe-shooting. We learned that how we can manage tasks and plan to complete them at time. In the End we had fun and learned alot and we hope that it will be very useful in the future as well.


Copyrights:2022, Imtiaz Ahmed and Ali Nawaz, All Rights Reserved | Terms and conditions | Privacy policy