Solving the Negative Analog Input Problem for Micro-controllers

Taking a negative analog input onto your micro-controller or prototyping device becomes necessary at times, specially when dealing with applications like sound recognition, reading EMG signals, ECG signals, working with OpAmps etc. While your micro-controller can (probably) sense between 0V-5V or 0V-12V, this little hack will double the capability to accommodate negative inputs as well, expanding your range to -5V – +5V or -12V – +12V. This hack is valid for Arduino-based devices and most micro-controllers in general. It will also be useful for evive users who wish to sense negative voltages from it’s Arduino pin-outs.

Micro-controllers like Arduino can take only positive voltage input at its pins. The method elucidated below takes both negative and positive values and sends them to Arduino along with the sign information. The idea is to take both the original input and an inverted one and select one of them using a multiplexer. So we can get the positive input as it is and the negative input in an inverted form. The sign can be determined using the output of a comparator which is subjected to the same input as the differential amplifiers.

Differential Amplifier

I have used two differential amplifiers. One amplifier gives output V1-V2 and the other V2-V1. (The circuit for both of them is the same we can give inverted input to one of the amplifiers).

The differential amplifier gives an isolated input so that one does not have to keep ground of the input common with the micro-controller. I would want to read input from one of the two amplifiers using my micro-controller. For this I use the CD4053 mux and use output of the comparator to select outputs from the mux. The comparator is given the same input as the two differential amplifiers.

2017-06-22 (2)
Complete Schematic

You can read more about this circuit on our step-by-step guide here. One problem that remains (in some cases) is that of power supply. If the op-amp is given +5 and zero volts, the op-amp saturates (on the lower voltage side) at around 500 mV. For the above design we do not need a -5V negative supply as the output of the op-amp (at least the one we need) is always positive. However, to get voltage values near 0V, an unregulated negative supply can be used.

One of the ways to create a negative voltage supply can be found in the article here. Note that the gain of the amplifier can be set according to one’s requirements by changing the values of the resistors. Also, if you need a regulated negative supply a 7905 regulator can be used after the 555 circuit.

evive uses ADE7912, an isolated analog to digital converter IC which simplifies the PCB design and gives better resolution. But it adds to the cost of a project so might not be very useful if such high resolution is not required. In such a scenario, the above circuit might be very useful.

Observe the output of sign(second channel)
Negative input
Positive input

Pictures above show the circuit with a positive input and negative input respectively. Observe that the output sinusoid remains the same but the multimeter reading changes.

Submitted by: Harsh Chittora, a happy evive user!

Sick of this? evive solves this problem with it’s inbuilt systems, offering a range of -30V to +30V on its data acquisition channels, unlike any other platform on Earth. Find more about it’s features at

Active STEM learning with evive

The world is shifting towards new ways of learning, with rote bookish learning being phased out in favour of learning-by-doing. STEM (Science, Technology, Engineering and Mathematics) education is particularly benefiting from this movement, with students being able to learn by experimentation and unleashing their creativity. Getting students to actually experience the concepts that they are learning about makes much stronger impressions on their mind and facilitates improved learning.

evive is a self-contained prototyping lab which gives students all the tools they need for learning about circuits, building robots, and tinkering with all the objects around them. The idea behind evive was to make learning and building quick, intuitive and affordable, and we have done just that with the on-screen menu interface that gives easy access to all of evive’s functions without the need to reprogram the microcontroller for repetitive tasks. Students can learn at home by referring to a multitude of projects on the internet and connecting with the huge Arduino support community online. Features like the plug and play hardware interface make building and driving robots easy and fun, while the robust circuitry inside evive makes sure that they can try out their ideas confidently, without fear of failure. With programming skills becoming essential and interactive graphical programming environments like Scratch on the rise, evive’s Scratch compatibility allows the students to make programs graphically without worrying about syntax, and see their code actually interact with the physical world.


Be it building a toy car and controlling it from their smartphone, or making their own piano, evive enables students to get their hands dirty, build complex systems and program it, all within minutes! Students can learn the basics of electricity and electrical current by measuring voltage drops and current flow with evive, visualising it in real time using the mini-oscilloscope functionality. The best thing about evive is that when implementing their ideas becomes so easy and convenient, there is no limit on what the students can dream up and implement.

Introducing students to the world of electronics and robotics requires a humongous amount of investment in infrastructure, components and space. evive solves this problem by packing all the components they will need into a small, portable unit. It comes with learning modules like toy car, robotic arm and home automation kit which are easy to use Do-It-Yourself kits that serve as great examples for the students to start with. Complemented by these learning modules, evive offers an end-to-end active STEM learning solution which can be deployed with great ease. We are creating a huge base of video tutorials and documentation of projects that can be reproduced easily using evive, which will serve as a source of ideas for students and will help educators to create content for their curriculum.

You can learn more about evive here



Precision sensing with evive

While making projects and doing laboratory experiments, we often need to capture the response from sensors or measure voltage drops across circuit elements for the purpose of debugging. Measuring current flow through components is a must for design of efficient power circuits.  We use a variety of instruments like voltmeter, multimeter (DMM), oscilloscope, data acquisition modules, etc. When we need to program and control devices with sensor feedback, Arduino and BeagleBone are frequently used as they are very cost effective and easy to learn platforms. However, their sensing interfaces are very primitive with very low resolution and small range ADCs. The alternative is buying an oscilloscope, which is like bringing an automatic gun to a handgun fight! Oscilloscopes are expensive, bulky and loaded with features that most researchers, let alone hobbyists, never end up using. Clearly there is a huge middle ground here which needs, and deserves, to be filled. 

evive gives you a great new way to test your circuits, without needing expensive equipment like oscilloscopes, function generators and data acquisition modules. We have integrated Analog Devices’ 24-bit isolated ADC chip ADE7912 into evive, giving it precision sensing capabilities for IoT, lab testing and debugging. While Arduinos AVR ADC takes 112us for sensing 0-5V data in 10bit resolution, evive allows you to measure 24bit resolution data in less than 15us, with an accuracy of 3mV for +-5V range, and 10mV for +-30V range. Like any oscilloscope, evive offers two channels for simultaneous measurements, with one channel being optimized for voltage measurement in the 30V range and the other being optimised for both current measurement upto 3A and voltage measurement in the 5V range, with a jumper deciding which measurement is done. The ADE7912 was chosen since it offers an isolated power supply, which allowed us to completely isolate the measurement circuit from the rest of evive, allowing you to measure voltage and current from any circuit without worrying about creating ground loops or inadvertently shorting the probes. When combined, the ADC and evives screen make a formidable mini-oscilloscope, with multiple modes of display and ranging the axes of the oscilloscope. The display can be triggered in single, scan and auto modes. The voltage division can be scaled from 20mV to 10V at the press of a button, while the time division can similarly be scaled from 2.5ms to 1ms. evive also allows you to set cursor offset for making measurements onscreen, adjust both channels offsets independently and change the level of the trigger with the on board Joystick.
Apart from viewing the graphs on the TFT screen, the data can be logged into the SD card with timestamps provided by the on-board real time clock or can be sent over serial communication. Also our LabVIEW interface allows viewing the graphs on your PC/Mac in real time via a serial USB interface.
evive data log serial
With the rapid growth and proliferation of Internet-of-Things and big data, lots of sensor network data is communicated to the cloud for a huge number of applications like weather monitoring, precision agriculture, pollution monitoring and tons of DIY hacks. With inbuilt adapters for Wi-Fi (ESP8266 ESP 12-E), RF (Xbee) and Bluetooth (HC-05), evive is IoT ready and can communicate with the cloud and other devices, with its portability making it ideal for deployment for data collection and experimentation.
Evive’s 24 bit ADC, 1.8″ TFT screen, SD card support, real time clock, serial communication capabilities and menu interface make evive a revolutionary new player in the data sensing and logging arena.

The Journey Towards A Magical Solution

Our previous post highlighted a multitude of problems makers are facing today. Considerable amount of time and money is spent in developing relevant skills, then making the project, juggling through complicated circuits and finally searching timelessly for the smallest of imperfections and improving on them. This accentuated the need for a one-stop solution to cater to all such hassles, which we’ve categorized into different phases such as learning, building and debugging. Being makers ourselves, we encountered similar problems and started searching for that magical solution. Unfortunately, we ended up disappointing ourselves as no such thing was in existence except some solutions to individual plights.

How a disappointment challenged us for something great!

“So what! If you need it and nobody has it, build it!” We took the challenge of making that one-stop solution ourselves. But how did we get here? Where did it start from? Rewind couple of years, while working for a student robotics competition, we built a testing board to help us debug our beloved robots whenever they went mad! But that was tough, testing which actuator was malfunctioning or if it was the battery or some other component needed different circuits altogether. It was cumbersome. Iterations followed and all the different circuits for testing a variety of commonly used components were integrated together into a single testing and debugging tool. A LabVIEW interface for the same was later developed during a Virtual Instrumentation course. The debugging tool was capable of testing performance of PMDC motors, servo motors, steppers, pneumatic systems, batteries etc. We kept it to ourselves for several years and were using it with negligible improvements.

So what! If you need it and nobody has it, build it!

Fast forward to 2015, we decided to make it available to makers around the country. But prolonged usage without any significant improvement started raising concerns. Will this always stay just a testing & debugging tool? This way, we could only have catered to people like us, who were building robots for some reason. What about those who haven’t started making quite yet but are eager to learn? What about those who want to teach robotics? What about those who are making projects? Can the efforts they put in to realize their idea be reduced, amplifying their focus on the idea itself, rather than on the inconvenience of connecting wires all the time? Can it be made simple enough to enable building projects just by plugging in the hardware? Can advanced features be included to allow things as complex as data acquisition? What more can our makers do with it? Oh! The curious human mind, it never stops asking for more.

Team Robocon IITK.mp4.00_02_14_04.Still002edited
debugging a robot isn’t the most fascinating thing around!

Keeping all the makers in mind- from students to teachers, from hobbyists to researchers, from beginners to professionals, we started working towards making the magical solution! Being the most commonly used and easy to learn platform, we chose Arduino to base it on. An all-in-one device to perform a wide range of functions was evolving. A platform to which one could connect multiple sensors & actuators and can learn how they work or can build projects using them. A device which can act as an ammeter, a voltmeter, an oscilloscope or a function generator and can help people analyze and debug their projects or make experimental setups with. An IoT gadget which can be a Wi-Fi router, a Bluetooth or XBee based wireless transceiver and could save and send sensing data. An instrument to which devices requiring different power outputs can be connected, be it a 3.3V IMU, a 5V proximity sensor, a 7.4V servo or a 12V PMDC motor. And yeah, it should be compact, lightweight, portable, affordable, should work across multiple OS & development platforms and blah blah! Once it has all these, it shouldn’t blow itself up if someone does mistakenly overpowers the device or connects reverse terminals etc. Phew! We had tough targets to achieve.

An all-in-one platform to perform a wide range of making functions was evolving.

Remember McFly from Back to The Future? He once said “if you put your mind to it, you can achieve anything”. We were confident and too stubborn to go easy on our goals. The target was defined and we set sail. All these features were gradually integrated into a single product. After endless iterations and improvements, evive was born as an open-source embedded platform for maker around the world to help bring their ideas to reality.

the evivelution!

evive was loaded with tons of useful features for a variety of needs. It had a plug & play interface to directly connect and control hardware; a hardware interaction module equipped with switches, potentiometers and a joystick to control evive and the hardware connected to it; a power module to allow it to be powered by any DC supply between 5V & 30V and supports a variety of power outputs from evive; a communication module to connect evive with other devices; a data acquisition and logging module to sense, plot and store relevant data and a lot more. The list of features was endless. We’ll cover them in our next blog, stay tuned!

Makers Are Awesome, But They Await A Revolution!

Have you ever tried making a robot and spent endless hours searching for the right component & testing its feasibility? Did you ever get stuck with a code or a circuit which you thought was correct but unfortunately it didn’t work? Have you ever tried searching for an economical way of testing your project’s response and ended up wasting valuable resources on expensive oscilloscopes, function generators or data acquisition systems? Do you often get frustrated with complex wiring and find it burdensome to debug your project? Have you ever felt that it takes ridiculously large amount of time and money to buy numerous components and build complex circuits to help your student make a project or help your child take her first step towards making for improving her STEM (Science, Technology, Engineering and Mathematics) skills? 

evive stuck learn build debug

These problems become a daily headache for makers around the world; makers such as students, teachers, hobbyists, engineers, entrepreneurs, innovators, researchers and professionals. A maker’s life is challenging, but the challenges they face make them crucial to innovation and technology development. Let us look at some statistics to speculate scale of the problem. There are around 135 million adult makers in United States alone, excluding children and teens interested in STEM and tinkering. The maker movement pumps in roughly $29 billion in the US economy every year. That’s huge! As per Make: and Intel’s maker market study, 70% of the makers are involved in developing hardware projects, and 53% are using a micro-controller. They are well connected and are supportive of each other. 86% of those who obtain money from investors, crowdfunding, fellow makers or somewhere else pledge money to other makers. ASME (American Society of Mechanical Engineers) believes that robotics is the second most popular field for offering opportunities to engineers.

The maker movement pumps in roughly $29 billion in the US economy every year.

So what are all these makers using? Arduino has lead this revolution and ended up transforming the maker community to a more innovative and productive one. It offers a wide variety of options and add-ons which can possibly solve every problem a maker has. But what comes after Arduino? Though Arduino is a very crucial part of any project, the makers need more! More simplification, more flexibility and more integration. An informed choice of hardware, carefully planned circuits, flawless mechanical design and tremendous efforts in analysis and debugging are needed to build any project. And prior to all that, an evolved skill set is necessary. On the path of makers, the journey to success is never an easy one.

evive arduino community

As makers ourselves, we have spent plenty of time in developing the relevant skills, in learning how different things work and in figuring out which of these can help us turn our idea into reality, let alone building the project. Even after all our sincere efforts, things don’t usually work the way they should. Now we would be investing time in figuring out why they didn’t work and then re-iterate everything over a very long time. It’s difficult, demanding and frustrating at the same time. We definitely needed a one stop solution to help us in this process by making it easier and interesting, transforming the cumbersome process of making to a fun-filled learning experience, a device to harness and enhance all the potential Arduino has to offer. Something magical for the maker magicians!

We need something magical for the maker magicians!

What if there existed another way, a way to learn quickly and effortlessly. What if you no more have to face these problems which you’ve been facing since time immemorial. What if there were affordable alternatives available for analyzing and debugging. What if there was one product which could act as a learning and teaching tool, a perfect research platform and an easy to use professional debugging equipment. What if you had everything in one small portable open-source device. Wouldn’t it make your life easier?

What if there were affordable alternatives for analyzing, debugging and learning?

Let these questions sink in for a while. Phew! It’s tough, you, me and every other maker around the world awaits a solution. Turns out there is one, all you need to do is wait for our next post!