Japan Chemical Senses Research Institute

PIC Application Corner

By Noriyo Suzuki, DSc, Director of JACSRI, Kotoni 1-6-4-23, Nishi-Ku, Sapporo 063-0811, Japan, E-mail: suzuki@nsdigital.sytes.net

1. Infrared LED Flasher Tag for Observation of Chemosensory Behaviors of Deep-Sea Isopods in the Laboratory (IR-Flasher Tag, Noriyo Suzuki, Copyright Reserved, Dec. 13, 2004 ).

Requirements for development: The tag should be as small and light as possible for animal's free movement in sea water. Therefore, the number and size of electronic parts commercially available should be as small as possible. The tag must be water-proof. The PIC device should have low-power features because the tag is operated by a lithium coin battery. The IR-LEDs should be as bright as possible in a range of applied current in the dark and have a wide irradiation angle for video-camera recording of animals moving around even with some body tilting.

The electrical circuit and the specifications are shown in Fig. 1. All electronic parts were obtained at internet shops: http://dkc1.digikey.com/jp/digihome.html for PIC devices, http://www.buhinya.com/top.html for CRDs. http://www.tamadevice.co.jp/ for CCOs, and http://www.rswww.co.jp/ for others. Shinetsu Chemicals RTV silicone rubber was obtained from a local dealer (http://www.hwako.co.jp/).

The PIC programs were developed using PIC C-compiler, PCWH version 3.214 (Custom Computer Services, Inc. (CCS ), http://www.ccsinfo.com/ ). The devices were programmed with PIC Start Plus programmer firmware version 4.30.04 implemented with MPLAB IDE version 6.62 (Microchip Technology, http://www.microchip.com/ ) .




The C-program for the PIC device, PIC12F509-I/SN for Infrared(IR) LED flasher tag, NS-IR-2S-06 is shown in Table 1 and the PIC device was programmed with the set of the configuration bits shown in Table 2 by the PIC Start Plus Programmer of MPLAB IDE.

Table 1. The C-program of ledtest2.c for NS-IR-2S-06.

///////////////////////////////////////////////////////////////

//2-LED control 0.5 Hz, Duty cycle 5%=0.1 sec On/2 sec for each LED //

//12-9-2004 by Noriyo Suzuki 2-Wide IR LED flasher 6 //

//(ledtest2.c for PIC12F509-I/SN External Clock 32.768 KHz) //

//////////////////////////////////////////////////////////////

#include "C:\Program Files\Picc\Test folder\ledtest2.h"

void main()
{

setup_timer_0(RTCC_EXT_L_TO H|RTCC_DIV_1);

while(1){ //endless loop

if (input(PIN_B1));

output_low(PIN_B0); //Anterior led on

delay_ms(100);

output_high(PIN_B0); //Anterior led off

if (input(PIN_B0));

output_low(PIN_B1); //Posterior led on

delay_ms(100);

output_high(PIN_B1); //Posterior led off

delay_ms(1800);

}

}

///////////////////////////////////////////////




Table 2. The set of configuration bits.

-----------------------------------------------------------

Oscillator : EXTRC

Watchdog Timer : Off

Code Protect : Off

Master Clear Enable : External

-----------------------------------------------------------


Photographs in Fig. 2 A-C show the IR-flasher tag put on the table and attched to a typically sized specimen of deep-sea isopod, Bathynomus doederleini, that was caught by a cage-trap set in 600 m-deep sea of the Suruga Bay, about 1 Km far from the mouth of the Fuji River, Shimizu, Shizuoka, Japan.


A
B
C

Fig. 2. IR-LED flasher tag, NS-IR-2S-06. A: The flasher tag and a magnet for the power-off . The smallest division of the plastic scale indicates 1 mm. IR-LEDs (gold) , CCO (silver square), PIC 12F509-I/SN (black square) and glass-sealed reed relay switch (green). B: The top view of the flasher tag attached to the deep-sea isopod with a clip on the head of the animal. The smallest division of the plastic scale indicates 1 mm. C: The side view of the flasher tag attached to the animal. IR-LEDs (gold), glass-sealed reed relay switch (green) and a lithium coin battery (dark silver).





2. PIC Solenoid Valve Controller for Olfactory and Taste Stimulation (6-Inlet Solenoid Valve Controller, April 30, 2002, Noriyo Suzuki : Jpn. J. Taste Smell Res. Vol.9, No.2, pp.195-199, August 2002, PDF-file in Japanese)

Requirements for development: The precise time control of solenoid valve opening and closing. The circuit shoud be as simple as possible. Simple switching of rotary switches for variable time opening of different valves. The switch remote control box should be as small and handy as possible. The solenoid valve should have a small dead space. The valve flow surface must be coated with Teflon to avoid any contaminant of preflowed liquid .

The circuit for 6-Inlet Solenoid Valve Controller is shown in Fig. 3. Most electrical parts commercially available were obtained at internet shops (http://www.rswww.co.jp/, http://akizukidenshi.com/, and http://www.wakamatsu.co.jp/ ) or obtained from local parts shops in Sapporo (http://www.parts-land.co.jp/ and http://www.yodobashi.com/ ) . The manifold direct lift solenoid valve (EW-01367-83, Cole-Parmer Instrument, U.S. A.) was purchased from a local dealer (http://www.yamato-net.co.jp/).




Fig. 3. The electrical circuit for 6-Inlet solenoid valve controller. Download fig3.jpg for the better visualization. The C-program for PIC16F84A (Table 3) was developed with PIC C-compiler, PCW version 3.079 (Custom Computer Services, Inc., http://www.ccsinfo.com/ ). The PIC16F84A was programmed by PIC Start Plus programmer implemented with MPLAB IDE version 5.61(Microchip Technology, http://www.microchip.com/ ).



Table 3. The C-program of PIC16F84A for 6-Inlet Solenoid Valve Controller, with publication permission obtained from Mr. Mark Siegesmund, Custom Computer Services, Inc.; support@ccsinfo.com, May 14, 2002.

--------------------------------------------------------------
// Pulse Generator; EX_PEGN.C by CCS, Inc 1996, 2001; modified by Noriyo Suzuki 5-3-2002; PULSGEN1.C //
#include "C:\Program Files\PICC\Test folder\pulsgen1.h"
#byte port_b = 6
void wait(byte time) {
switch(time) {
case 0 : break;
case 1 : delay_ms(1000); break;
case 2 : delay_ms(2000); break;
case 3 : delay_ms(3000); break;
case 4 : delay_ms(4000); break;
case 5 : delay_ms(5000); break;
case 6 : delay_ms(10000); break;
case 7 : delay_ms(30000); break;
case 8 : delay_ms(60000); break;
case 9 : delay_ms(60000); delay_ms(60000); break;
}
}
void read_selections(int & sw1, int & sw2) {
sw1 = (~(port_b >> 4))&15;
sw2 = (~(port_b & 15))&15;
}
main() {
byte high_time, low_time;
#define one_shot_selected ((high_time==0)||(low_time==0))
while (TRUE) {
read_selections(high_time, low_time);
if(high_time==0)
output_high(pin_a0);
else
output_low(pin_a0);
while ((one_shot_selected) && input(pin_a1))
read_selections(high_time, low_time);
output_high(pin_a0);
output_low(pin_a2);
wait(high_time);
output_low(pin_a0);
output_high(pin_a2);
wait(low_time);
if( one_shot_selected )
delay_ms(500);
}
}
--------------------------------------------------------------

A
fig4A.jpg
B
fig4B.jpg
‚b
fig4C.jpg

Fig. 4. Photographs of 6-Inlet Solenoid Valve Controller. A: Manifold direct lift solenoid valves (left). Remote control box (middle). Unregulated DC power supply (right). B: Inside view of the remote control box. C: Top view of the remote control box. Download the linked jpg files for the better visualization.


Return to Index Page