Monday, May 12, 2014

Atmospheric pressure using Arduino



Part of quarterly vibration inspections on mine fans for a client, they requested parametric pressure included in the vibration analysis report. Due to the fact that mine fans usually are spread within a good driving distance to any mine office, where you can find a barometer, I had to come up with a way to measure the pressure on each site while inspecting. One solution was to use phone application to provide barometric pressure reading. Unfortunately, not all sites we inspect are within phone coverage!

Since an Arduino microcontroller was available around me for a while now; why not use a pressure sensor and Arduino microcontroller to capture barometric pressure readings! As it turns out, this is not a very difficult thing to do. I ordered this sensor from here

Bosch BMP180 high-precision, low-power digital barometer



You can find it on adafruit or sparkfun website. Furthermore, these sellers usually provide libraries required to use their products and even provide example codes. Off course, you will need a display screen to display the pressure reading, a cheap black letter green backlight LCD should do the job. I have used this arduino shield it also includes push buttons which will proof valuable as you will find out in the end of the blog.


Making this project work was one thing and testing it was another thing. Since pressure is a measure of the force per unit area exerted by the weight of air on a surface, you will get less atmospheric mass as the elevation increases. This means best way to test my new gadget was to use it at different elevations. Well, West Virginia Mountains provide the perfect altitude change; I made a trip to Black Water Falls in West Virginian. My trip started at my current residence at an altitude of 900ft and ended at Black Water Falls at an altitude of 3600ft above sea level! Now, to test my barometer it should be compared to a correct reference reading. The phone application we talked about earlier did serve this purpose but phone application provides altitude compensated atmospheric pressure values. This meant my barometer had to provide an altitude compensated values also. Altitude value needs to be available while you are programming the microcontroller or user needs to enter the altitude as a variable while the program is running (online). This is where the buttons on the LCD shield could help; the buttons can be used to change the altitude value without the need to change them in the program. No need to add a keypad to the design; no need to add more cost and more size (Sorry, too much work). 


Instead of using buttons on the shield, a work around was to program the microcontroller with an average altitude between 900ft and 3600ft and I have chosen 1700ft. During the trip the pressure reading on the phone and on my LCD screen did come close but during the trip my phone application was giving message indicating that pressure reading may not be accurate due to the fact that I had no pressure sensor on my phone, What!!! You mean you made me drive three hours trip to tell me I need a pressure sensor. I am just kidding, we went to see the beautiful nature in West Virginia; see picture below
 



On the way back I passed through Okland city, Maryland. While enjoying the scene on a nearby lake, I decided to try my gadget one last time. Reprogrammed the microcontroller with the correct altitude and pulled up accu Weather webpage on my phone, now this has to be correct, turned on my microcontroller. See picture below.






Now, came the moment of truth. A client called asking for urgent vibration inspection on the fan location near the office. I went to collect vibration data on the fan and off course had to collect pressure reading, see picture below.




This is a link for the atmospheric pressure and temperature near this area on the day this picture was taken
 

Sunday, May 11, 2014

VB Online Communication Troubleshooting



Our company had to commission a project for an underground mine including mounting a VB Online unit (from GE_Commtest) and setting up a wireless link to connect VB online unit to the mine wide monitoring system.  Hence, we used a wireless access point (a router in our case). Reason that VB online unit had to be wireless is that it was installed on a tripper car: part of a belt system that is mobile (moves on rails) and include two pulleys and VB online unit provide temperature and vibration readings with an update interval each 10 minutes.  With some recent difficulties experienced on Wi-Fi start-ups, I put together a brief write-up to help with steps required to solve a specific problem we faced:
After getting the wireless link up and running between access point and the VB Online, the VB Online did not respond to Ascent; VB Online does not display in the right panel of the window of “Online device Setup wizard” page. Furthermore, when entering the VB Online IP address and port number in the remote IP address field on the same page, a pop-up message shows indicate that ‘”a firewall problem”  or “TCP/IP problem exists” that prevent from communicating to the VB Online unit or that “Non response from VB Online unit”.
Steps below assume that all IP address and Network SSID information (including WPA key and other security setting) are configured correctly in the VB Online unit and VB Online unit can be access using a serial cable, and/or the Ethernet/Wifi interface on VB Online unit can be configured via telnet session using an Ethernet cable or a wireless link.
First of all, try to connect to the VB Online unit using a non-network connection- E.g. using a laptop with (COM) port and RS232 cable as shown in Figure 1 below.

Figure 1 Connect to VB Online unit#21944 using Serial Cable on COM port# 23

Once connected to VB online unit, the unit number and serial port number used to connect to the unit should be highlighted on the Online device setup wizard. Click on “Edit” button and the “VB Device Properties” page should come up. Under “Tasks” tab, look for “Reset Device” section and click the “Reset” button. Wait for a minute and note the led blink on the VB unit then a pop-up message shows indicating that unit has been reset, please see Figure 2 below.


Figure 2 VB Unit successful rest result


Next, we need to rest the Ethernet interface. This is very important to be done after a successful rest of the VB module; resetting only the VB module or only the Ethernet interface will not produce required results.  Under same “VB Device Properties” page, look for “Rest Ethernet Defaults” and click on “Defaults” button. A successful rest operation of the Ethernet interface is shown in Figure 3 below.


Figure 3 A successful Ethernet interface reset result


Once this is accomplished, then the VB module needs to be change from Serial port to Network connection through “change button” found at the setup tab under the “Change VbOnline: Wifi/Ethernet (Cabled Ethernet)” section. Make sure to connect the cross cable provided with the VB Online unit to Ethernet port on your laptop and to the VB unit before changing communication method. Press the “Change” button and a pop-up window “Change vbOnline: Wifi/Ethernet” dialogue shows. Select the “Cabled Ethernet” radio button and press “Ok” button; wait for the change to take effect as shown in Figure 4.



Figure 4 Change vbOnline Wifi/Ethernet window with Cabled Ethernet radio button selected

Once this action on the change of the module communication method is confirmed with a pop-up message, the vbOnline is properly configured for Ethernet communication to the outside world.
Now, we try to change the way Ascent software communicate with the vbOnline unit. Under Setup tab, look for “Change Ascent-> vbOnline address” section and select the Ethernet radio button. Enter IP address of vbOnline device in the IP address field. If you know the port number the vbOnline is using, enter it in the Port field as shown in Figure 5 below.


Figure 5 Enter IP address and port number in the Change Ascent-> vbOnline address section

 Once this action on the change of the way Ascent software communicate with the vbOnline device you show see this reflected in the “Online device setup” page as shown in Figure 6.
 



Figure 6 Online device setup page showing unit # 21944 on an Ethernet Address
It is a good idea to perform some simple test like “Get Address” command under Setup tab or even go further and set a test route and collect some data using a sensor. If you wish to communicate with the vbOnline device using wireless communication then set up the vb module back to wireless communication using telnet or using the “Change vbOnline:Wifi/Ethernet” dialogue. Stay tuned to see how this is done in a following post.