Maker.io main logo

Robotics Education: Detector Building Part 1

2023-12-22 | By Antonio Velasco

License: Attribution Logic Probe / Analyzer

In my previous blog, I talked about the premise of the project and how I started the students off on the basics. Now, we're going to get into the nitty gritty with the Detector Building Event or building a basic ORP (Redox) sensor.

To recap, the premise of this event is to create a probe that can measure NaCl (or salt) concentrations in ppm and the voltage (and thus conductivity) of a solution using a microcontroller and basic electronic components. It needs to be built from the ground up, and getting there will take a minute. Fortunately, we hit the ground running with basic breadboard and coding techniques.

I came up with a very basic schematic for their first prototype: an Arduino nano with an LCD and a couple of cable probes. Here's a Scheme-It diagram for it:

Scheme-It

A very simple first pass! U3 and U4 represent the probes that we would be using, which are connected to A0 (which acts as an input for our voltage) and ground/5V, which will provide the flow of electricity. A resistor is additionally connected between the ground and the probe to give us a reference point for calculating conductance and to give us room for calibration. It also allows us to change the range of measurement for the sensor. This simple build will allow the students to get an idea of what we're working with and to have a rudimentary starting point.

Getting Started

The first thing that I did with the students was to get them familiar with the Arduino IDE and to use a component along with its library. I went through a walkthrough similar to my LCD blog here. Having this material on hand and already written made it a lot easier to go through!

LCD

The LCD walkthrough got them more comfortable with pinouts and utilizing libraries, introducing concepts that would definitely be helpful later on. Establishing how to use the LCD is also important as later we'll have to incorporate it into our design to display the voltage and conductivity.

Next, I briefly went over resistance and how it works again--this time talking about why it is important in our circuit and how we're going to utilize it. Something fun that I had them do with the resistors was figure out the color codes

Resistor Color Chart

We had a ton of resistors to work with, and for our design, I explained to them that having a higher resistance would be optimal in our case since our solutions tend to be less conductive. I gave them a few and had them find the resistance values of each individually. The one to point out the highest resistance resistor and tell me the specific value would win (and get a few snazzy DigiKey PCB rulers). This turned out to be a 4.7k Ohm resistor.

After getting the resistor and probes added to our LCD circuit, we had our conductivity sensor build-ready! The code was relatively simple; we designated pins and output to the LCD (remembering to clear the LCD screen and change the cursor) location.

First Build

As you can see, we got a value in Ohms and S/m (the unit for conductivity, which is calculated just with 1/R). For S/m, it showed up typically as 0 until we multiplied it by 100 just to see if we had a value there. We did note that the value is actually 100x less, and that we just did that to see if we even returned a value.

This, however, was pretty inaccurate. We were getting values, yes, but they were random-ish. 

Serial Monitor

We utilized the Serial Monitor to get a log of all our values to see what we could change. The first thing that came to my mind was changing out the wires, as while they're perfect for breadboards, they may be less optimal for a probe.

Cables

We then tried a several other wires--including these jumper cables (which allowed us to remove the LCD from the breadboard with M-F cables). They ended up being more accurate to what we wanted to see, but the resistance also ended up being wildly low at times (as shown in the picture). The resistance was also shown to be 0 sometimes. The keyword here though is sometimes, meaning that even if the probe was kept in for a while, the values wouldn't necessarily stabilize.

Further Improvements

Moving on, we'll definitely have to get some new probes--preferably something plated in copper or a more conductive material. Additionally, we'll likely need to get a stronger resistor. This, however, is an easy fix as we can just connect a few in series! I'm thinking we might also need to rework some of the circuitry. However, all of this done in just Day 2 is amazing! We have a ways to go, especially in terms of meeting the rules as we'll need to include LEDs to display relative conductivity, but I'm confident we'll be able to get it done in no time.

 

制造商零件编号 A000005
ARDUINO NANO ATMEGA328 EVAL BRD
Arduino
¥172.33
Details
制造商零件编号 BB-32621
BREADBOARD TERM STRIP 3.20X2.08"
Bud Industries
¥40.44
Details
制造商零件编号 MIKROE-2315
TIP PLUG TO TIP PLUG 7.9"
MikroElektronika
¥42.98
Details
制造商零件编号 MIKROE-2314
TEST LEAD TIP PLUG 7.9"
MikroElektronika
¥42.98
Details
制造商零件编号 398
LCD MODULE 32 DIG 16 X 2 R/G/B
Adafruit Industries LLC
¥105.41
Details
制造商零件编号 292
I2C/SPI CHARACTER LCD BACKPACK
Adafruit Industries LLC
¥80.99
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum