Saturday, July 12, 2014

Measuring PH with Dormant Labs PH Module V2 Using 10 & 7 calibration solutions

Here is another setup guide that shows how to measure PH using the Dormant Labs PH Module V2, except this time we will calibrate using 10 & 7 ph calibration solutions.

You will need

  • 10 ph calibration solution
  • 7 ph calibration solution
  • Dormant Labs PH Module V2
  • A PH probe
  • 4 dupont female to male cables
  • An Arduino
  • Containers to hold the PH calibration solutions, and a container to rinse the ph probe with water.

Fill one cup with 10 PH calibration solution, one cup with 7 ph calibration solution, and one cup with water.



Connect the ph probe to the module.



Connect the module SDA,SCL pins to the Arduino SCL and SDA pins, here because we are using a mega, the SCL is pin 21, and SDA is pin 20. Then connect VCC to 5v on the arduino mega, and then connect GND to the GND pin on the arduino mega.

Then connect the arduino mega to your computer.

Now we will upload the source code. Get the source code from here:

and upload it using the Arduino IDE, if you do not have the arduino IDE then get it from the arduino site.


After uploading the code, open the serial monitor and you should see something like this:



It will output the wrong reading until we calibrate it, so lets do that.

First rinse off the ph probe in the tap water.


Now dip it in the PH 7 calibration solution, and write down the value for avgPhVolts that comes up in the serial monitor.




Now rinse it again.




Now dip it in the PH 10 calibration solution and write down the value for avgPhVolts in the serial monitor.



Also write down the avgRoomTempC value that appears in the serial monitor.

Here are the values that I got:




Now enter them for the values of volt7, volt10, and calibrationTempC and upload.



You now have calibrated your ph sensor! Edit the program to do whatever you want now.

Sunday, April 20, 2014

LCD Display with Dormant Labs PH Module V2

This is a stepping stone tutorial, and comes after first learning to measure PH, you should review this tutorial first.

For my own purposes I do want the arduino to show ph on a screen, without it being connected to a computer. This is the way I went about it.

The LCD I got is a "I2C 0.96" OLED display (for Arduino /PIC /AVR ) Blue/Yellow color" from the ebay seller "wide.hk."




So I soldered some 2.54mm pitch pin headers to the lcd, then super glued it to the back of the ph module.



I then connected and soldered the SDA, SCL, VCC, GND pins of the lcd to the SDA, SCL, VCC, and GND pads on the ph module. 






I should note that I only used dupont cables because I had already soldered headers. If I was going to do it again I would just solder wires to both ends. Also, the area I applied the superglue to was the inductor.

So connect the SDA,SCL,VCC,GND pins of the ph module to your Arduino. After that, load up this code through the arduino IDE:

https://gist.github.com/rezahussain/11128896

Follow the same calibration instructions as in the previous tutorial and now your arduino will display the ph on a screen.


Thursday, April 3, 2014

Measuring pH using Dormant Labs PH Module V2 and Arduino

Here is a quick setup guide to start measuring ph using the Dormant Labs PH Module V2.

You will need:
  • PH 4 and 7 Calibration Solution
  • A Arduino
  • Dormant Labs PH Module V2 (available here)
  • A PH Probe
  • Three small cups, two to hold the two calibration solutions, and one to hold water for rinsing the ph probe 
  • 4 dupont male to female cables

First connect the ph probe to the ph module


Then
  • Connect V+ to Arduino 5v or 3v pin
  • Connect GND to Arduino GND pin
  • Connect SDA to Arduino SDA pin(For UNO it is A4)
  • Connect SCL to Arduino SCL pin (For UNO it is A5)
  • Attach USB to Arduino


Get the source code from here:
https://gist.github.com/rezahussain/bb7715534688d8dc0520

and upload it using the Arduino IDE. If you do not have the arduino IDE get it from the arduino site.

After uploading the code, open the serial monitor and you should see output like this:



You are now ready to calibrate your ph probe.

Fill one cup with PH 4.0 calibration solution, one with 7.0 calibration solution, and a third with water.
Remove the cover from the ph probe and rinse it with water.


Then dip the probe in the 4.0 solution, swirl it around for a little bit, and write down the value you see for the avgPhVolts. For me, I saw 0.95v.


Rinse the ph probe in the water, then dip in the 7.0 calibration solution and write down what you see for avgPhVolts.


Here are the values I got:


Now I replace the volt4, volt7, and calibrationTempC, then re-upload to the Arduino.


After re-uploading your probe is now calibrated! The serial monitor of the arduino IDE will show the correct information. Edit the code as you like now.

Sunday, March 16, 2014

PCDuino Primer

I have considered and evaluated several mcu functionality+wifi boards, and 'pcduino lite wifi' is the board I chose to proceed forward with.

It is an ARM cpu running Linaro 12.07. What you need to get started is an hdmi cable for video, a usb hub, mouse and keyboard, and then a 'USB Cable A-micro' usb cable.


The default username for the pcduino is 'ubuntu'. On startup press F8, and then set the password.


The next step is to get the pcduino to connect to your home wireless network, this is the easiest way:


But you should assign it a static ip. These are the settings I used.


I set the pcduino to have an ip of 192.168.1.216 on my local wifi network.


And my wifi network is using WPA2 security, so there are these settings:


Now with those steps done, I can remotely ssh into the pcduino to do any administration/coding that I need to do. On my mac I opened up the terminal app:

Then enter in the password that you specified for the ubuntu user, and you are in. Now you only have to have power connected to the pcduino to put and run code on it.

Once you ssh in, install nano by typing

sudo apt-get install nano

Now lets setup arduino style programming:

cd ~
mkdir rezaWork
cd rezaWork
git clone http://github.com/pcduino/c_environment
cd c_environment
make

This compiles all of the sample arduino programs.
Lets run the blink example:

cd output
cd test
./linker_led_test 13


The LED on the board blinks.


If you wanna change the blink time:

cd ~
cd rezaWork
cd c_environment
cd sample
nano linker_led_test.c

Now change the blink delay, then save and exit out of nano.
Now you have to recompile and run:

cd ~
cd rezaWork
cd c_environment
make
cd output
cd test
./linker_led_test 13


The LED now blinks at whatever interval you set it to.

Monday, January 20, 2014

Compiling objective-c 2.0 with Foundation on Freebsd 9.1

This was harder than xubuntu, so here is the corresponding how to.

1. Install necessary packages
pkg_add -r subversion
pkg_add -r libffi
pkg_add -r libicu
pkg_add -r nano

2. Install libobjc2
cd ~
mkdir tempSetup
svn co svn://svn.gna.org/svn/gnustep/libs/libobjc2/trunk libobjc2
cd libobjc2
setenv CC /usr/bin/clang
setenv CXX /usr/bin/clang++
make

3. Install gnustep tools
cd ..
svn co svn://theraven@svn.gna.org/svn/gnustep/tools/make/trunk make
cd make
./configure -enable-debug-by-default
gmake install

Note the output for the next step:

Creating system tools directory: /usr/local/bin
Creating makefile directories in: /usr/local/share/GNUstep/Makefiles
Installing GNUstep configuration file in /usr/local/etc/GNUstep/GNUstep.conf
Installing gnustep-make support software
Installing makefiles
Installing Test Framework scripts
Installing Test Framework support files

Installing (and compressing) manpages


chmod 755 ./usr/local/share/GNUstep/Makefiles/GNUstep.csh
./usr/local/share/GNUstep/makefiles/GNUstep.csh
echo ./usr/local/share/GNUstep/Makefiles/GNUstep.csh >> ~/.profile

4. Install gnustep base
cd ..
svn co svn://svn.gna.org/svn/gnustep/libs/base/trunk base
cd base
./configure --disable-mixedabi CC=/usr/bin/clang CXX=/usr/bin/clang++
gmake install

5. Make a test program
cd ~
mkdir testapp
cd testapp
nano test.m
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[])
{
   @autoreleasepool
   {
      NSLog(@"Helloworld");
   }
   return 0;
}
exit nano and save

6. Create the makefile

nano GNUmakefile

GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles

include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = test
test_OBJC_FILES = test.m

include $(GNUSTEP_MAKEFILES)/tool.make


exit nano and save


11. Make and run the test
gmake
cd obj
./test

References:
https://forums.freebsd.org/viewtopic.php?&t=39466
http://etoileos.com/downloads/installtrunk/freebsd/