The Adjustable Aperture Gate is designed to produce multiple programmable apertures between two sliding doors for use in rodent behaviour experiments. The various apertures can be pre programmed using the programming module, the programming module can then be used to test the operations using the DIP switches on it's front panel, once the programming module is disconnected and the unit connected to experiment controller (external controller) these preset distances between the sliding doors can then be recalled using three 5V TTL (Transistor-Transistor-Logic) or 3.3V logic inputs driven by a single board computer (Raspberry Pie or Arduino for example) or any other microprocessor or logic controller.
The unit requires a 12V power supply and three logic control inputs with ground, a simple three bit binary word input will recall the various presets causing the sliding doors to move to the selected distance.
The design has two parts, the Programming Module (LCD/Buttons) and the Gate Unit (Mechanical/Main PCB) which are connected together using a standard one-to-one 15pin D type male to female cable. The LCD and switches are mounted in a small housing allowing parameter changes without disturbing the experiment. The Gate Assembly unit is designed using Google Sketchup and 3D printed using a FormLabs Form 2 SLA (Stereolithografie) 3D printer, assembly of the mechanical parts is quite labour intensive and modification of the motor for this application requires the use of a lathe.
The Programming Module only needs to be connected to change the preset aperture or to run tests to check operation, all changes are then saved to non volatile memory in the Gate Unit and the Gate Unit can then run without the programming module. Therefore only one Programming Module is necessary to operate multiple Gate Units.
Part | Qty | Part Description | Manufacturer | Part ID | Order URL |
---|---|---|---|---|---|
J1 | 1 | DSUB 15M connector | MH Connectors | 746751 | Conrad |
LCD1 | 1 | LCD 16x2 White on Blue | Gleichmann | 183045 | Conrad |
SW1-4 | 4 | Momentary Switch TC-D6SW | TRU COMPONENTS | 2238782 | Conrad |
DSW1 | 1 | DIP Switch 4 Way | APEM | 700640 | Conrad |
R1 | 1 | Resistor 56 Ohm 1/4W | Yageo | 1417715 | Conrad |
R2,3,4 | 3 | Resistor 2.2k Ohm 1/4W | Yageo | 1417683 | Conrad |
RV1 | 1 | Trim Potentiometer 10k Ohm 1/4W | Vishay | 423980 | Conrad |
PCB | 1 | Strip Board Paper/Copper 2.54mm | Rademacher | 529531-62 | Conrad |
Case | 1 | Case 73x117x27mm | OKW | 531612 | Conrad |
The programming module is created using the following schematic, a small piece of strip board is used to mount the four main switches as shown in the picture below. All components are mounted directly onto the LCD or switches therefore no PCB is necessary for the programming module. The potentiometer RV1 is used to adjust the contrast on the LCD and is required to be set only once. D1 is the backlight that is built into the LCD module and connected using pins 15 and 16 of the LCD module.
All components are mounted in a plastic housing and necessary holes for the the LCD, switches and connectors are drilled accordingly.
Programming Module - Button Mounting
Part | Qty | Part Description | Manufacturer | Part ID | Order URL |
---|---|---|---|---|---|
U1 | 1 | Microchip PIC18F23K20 MPU | Microchip | 666-9860 | RS Components |
U2 | 1 | L297D Stepper Motor Driver SOIC | STMicroelectronics | 102-3535 | RS Components |
U3 | 1 | L298P013TR Dual Full Bridge Driver | STMicroelectronics | 880-5308 | RS Components |
U4 | 1 | SMD 3.3V Regulator TLV111733 | Texas Instruments | 923-3827 | RS Components |
U5 | 1 | L78S05CV 5V Regulator TO220 | STMicroelectronics | 179345 | Conrad |
D1-8 | 8 | Schottkey Diode SK26L | PanJit | 1304995 | Conrad |
R1,2 | 2 | Resistor SMD 1206 1 Ohm 1/2W | Panasonic | 1473248 | Conrad |
R3 | 1 | Resistor SMD 0805 22k Ohm 1/8W | Tru Components | 1584677 | Conrad |
R5 | 1 | Resistor SMD 0805 3.3k Ohm 1/8W | Tru Components | 1584493 | Conrad |
R4,6-13 | 9 | Resistor SMD 0805 2.2k Ohm 1/8W | Tru Components | 1584491 | Conrad |
C1 | 1 | Capacitor SMD 0805 3300pF | Thomsen | 460338 | Conrad |
C2,3,5,7 | 4 | Capacitor SMD 0805 100nF 50V | Samsung | 454108 | Conrad |
C4 | 1 | Elecrolytic Capacitor 470uF 16V | Yageo | 445373 | Conrad |
C6 | 1 | Elecrolytic Capacitor 100uF 16V | Yageo | 445579 | Conrad |
J1-6 | 4 | Pin Strip Header 8Pin Male | BKL Electronic | 742235-VQ | Conrad |
J1-6 | 4 | Pin recepticle 8Pin Female | TRU COMPONENTS | 1560801 | Conrad |
J7 | 1 | D15F connector | MH Connectors | 746800 | Conrad |
J8 | 1 | Low Power connector Socket 2.1mm 5.5mm | BKL Electronic | 733946 | Conrad |
PSU | 1 | Powersupply 12V 3A | Mean Well | 1439200 | Conrad |
M1 | 1 | Stepper Motor 0.25Nm 0.6A | EMIS | 198398 | Conrad |
SW5,6 | 2 | Microswitch125V AC 3A | Hartmann | 704713 | Conrad |
Tube 5mm | 1 | Brass Tube 5mmx500mm | REELY | 221794 | Conrad |
Rod 6mm | 1 | Silver Steel Rod 6mmx500mm | REELY | 237086 | Conrad |
Collared Bush | 2 | ID-6mm OD-10/15mm | REELY | 237043 | Conrad |
Spindle | 1 | RH Threaded Spindle TSR-Tr 5x1.5 | HFB | 12-0515-01 | HFB |
Spindle | 1 | LH Threaded Spindle TSR-Tr 5x1.5 | HFB | 12-0515-02 | HFB |
Spindle Nut | 1 | RH Nut 5x1.5 | HFB | 33-0515-01 | HFB |
Spindle Nut | 1 | LH Nut 5x1.5 | HFB | 33-0515-02 | HFB |
Bearing | 2 | Radial 3x10x4 | REELY | 215210 | Conrad |
Cable | 1 | D-Sub15 Cable M-F 1M | Pheonix Contact | 673800 | Conrad |
Wire | 1 | Jumper Wire 1x0.2mm | Tru Components | 1567899 | Conrad |
PCB Gerber files are supplied allowing production and ordering, the origional Proteus design file is also supplied incase any modifications for specific requirements are necessary. All components of the PCB are mounted by hand and special attention should be applied to the motor driver (U3) as the underside of the component is used as a heat sink and must be soldered to the PCB, this is done from the reverse side of the PCB using the through holes integrated on the PCB design. Soldering SMD devices by hand requires some experience.
The Microprocessor must be programmed with the included program, this is performed using a Microchip Pickit 3 In-Circuit Debugger/Programmer and the Microchip MPLAB IDE X software. once the included project is added to the programming software the PicKit programmer can be plugged directly into the J1 on the main PCB and the program uploaded to the microprocessor.
The output shaft of the motor (22) requires modification, this is best performed on a lathe, The motor should be carefully dismantled and the rotor removed.
- Using a lathe the shaft of the rotor should be shortened to the same length as the shorter side of the rotor meaning the assembled motor has no protruding shaft from either side.
- Using a lathe the complete length of the rotor/shaft should be drilled out using a 2.5mm drill bit mounted in the tailstock,
- it is very important that the drilling is centered correctly for smooth operation and this can be achieved by using a centre drill first as a guide before the 2.5mm drill bit.
- Using a lathe an M3 thread must be cut within the hole drilled in step two, the M3 Tap should be mounted in the tailstock and the tailstock should be freely moving on the guide ways,
- by manually turning the main spindle chuck holding the rotor the thread can be accurately cut through the entire length of the rotor shaft.
- The motor should now be reassembled paying particular care to making sure there is no small pieces of metal swarf trapped within and all parts are sufficiently clean,
- any dirt or swarf will cause the motor to jam.
The two Silver Steel Shafts (17) should be cut to a length of 202mm, using a lathe the ends of the shafts should be drilled to a depth of 10mm using a 3.3mm drill, these holes should then be tapped using a M4 tap.
A piece of 5mm brass tube (6) should be cut to a length of 72.5mm, this is used to carry and protect the two wires that connect to the end of travel switch (4) as shown in the picture below.
The left and right threaded rods (8,18) should be cut to a length of 88mm.
- Using a lathe 4mm of the ends of the rods should be reduced in diameter to 3mm.
- Using a lathe, 10mm of the opposite end of the rods should be reduced to a diameter of 3mm.
- Using a lathe and an M3 die the 10mm end should have a M3 thread cut.
Once all parts are 3D printed a small amount of cleaning/trimming and sanding is required to allow all parts to accurately fit together without force. The following drawing shows all parts for assembly.
The four motor mount holes on the Main Body (12) should be counter sunk to allow for flush mounting of the motor allowing the slider (10) to travel up against the Main Body (12) without obstruction.
- M4x10mm Screw x4
- M4 Washer x4
- Left Slider Stop
- End of Travel Micro Switch
- Bearing Radial 3x10x4 x2
- Brass Tube 5x72.5mm
- Collared Bush 6x10x15mm x8
- Left Hand Threaded Rod
- Left Handed Brass Nut 5x1.5
- Left Slider
- Start of Travel Micro Switch
- Main Body
- Mounting Clamp
- D15 Female Connector
- Assembled Printed Circuit Board
- PCB Cover
- Silver Steel Shaft 6x202mm x2
- Right Hand Threaded Rod
- Right Handed Brass Nut 5x1.5
- Right Slider
- Right Slider Stop
- Motor
-
The Motor (22) is inserted into the Main Body (12) and fixed in place with the wires facing upwards using four M3x10 counter sunk screws.
-
The two Silver Steel Shafts (17) are inserted into the Main Body (12) with equal lengths of the shaft protruding from each side of the Main Body (12), these should now be fixed in place using cyanoacrylate glue being careful not to get any excess glue on the Shafts (17).
-
The two End Stop Microswitches (4/11) should be prepared by soldering two 0.05mm wires of 15cm length to each of of the Microswitches normally open contacts(no).
-
One Microswitch (11) can now be mounted into its cutout on the Main Body (12) and the wires threaded through to the PCB cavity inside the Main Body (12), the second Microswitch can now be inserted into the cutout on the Left Slider Stop (3) and the wires threaded through the channel inside the Left Slider Stop (3), for the time being the wires should be left long and will later be attached.
-
The eight Collared Bushes (7) should be carefully pressed into the Left and Right Sliders (10/20), it is important that these are inserted straight and true, this is best done using either a press or a machine vice using a scrap piece of the 6mm silver steel shaft as a guide, opposing bushes should be pressed into place at the same time with the 6mm shaft inserted into both bushes as this will guarantee alignment during insertion.
-
The Left Handed and Right Handed Threaded rods (8/18) can now be attached to the Motor (22), the 10mm of M3 thread on the threaded rod should be screwed into the motors shaft using thread lock to be sure they don't unscrew.
-
The two Bearings (5) are to be pressed into the Left and Right Slider stops (3/21) this is easily accomplished using a machine or bench vice.
-
The Left and Right Hand Threaded Brass Nuts (9/19) can be installed into the Left and Right Sliders (10/20), the nuts should not be a tight fit but also should not have any excessive play as this will affect the accuracy of the aperture, however a small amount of movement must be available to allow for slight inaccuracies in the Threaded Rods (8/18).
-
The two Sliders (10/20) can now be slid onto the two Silver Steel Shafts (17) and with the Left and Right Handed Brass nuts (9/19) held in place can be slid until the Brass Nuts come into contact with the Left and Right Handed Threaded Rods (8/18).
-
By applying a small amount of pressure to both Sliders (10/20) and turning the Motor Shaft both the sliders will be drawn in towards the motor, it is important that both Sliders arrive at the Main Body (12) at the same time, the Microswitch (11) should be heard to click just before the Sliders come into hard contact with the Main Body.
-
The Right Slider Stop (21) can now be fitted to the end of the Silver Steel Shaft (17) paying attention that the end of the Right Hand Threaded rod (18) is inserted into the Bearing (5), This can now be fixed in place using two M4x10 screws and washers (1/2) holding the Slider Stop to the two Shafts.
-
The Left Slider Stop (3) is mounted in exactley the same way with one exception, the wires from the End Stop Microswitch (4) which were earlier threaded though the Left Slider Stop should now be threaded through the Brass Tube (6) and as the slider stop is brought into place this tube should be inserted into the available holes on the Left Slider Stop (3) and the Main Body (12), approximately 2.5mm of each end of the Brass Tube should be inserted. The microswitch wire should be threaded through to the Main Body PCB cavity. The Slider Stop should be fixed into place using two M4x10 screws and washers (1/2).
-
By turning the Motor/Threaded Rods the assembly can be checked for smooth operation and that the microswitches are pressed before the sliders make hard contact at either end of their travel, a small amount of machine oil or grease should be applied to the threaded rods and also to the silver steel shafts.
-
The PCB (15) can now be placed within the cavity in the Main Body (12) with the wires from the two Microswitches (4/11) and Motor (22) exiting above the PCB. The PCB (15) is a tight fit inside the Main Body (12) and does not require and additional fixing.
-
The wires from the Motor (22) should be cut and spliced (shortened) to a length that easily reaches the motor connector (J4) at the top of the PCB (15) without too much excess length, this is now plugged into the motor connector (J4).
-
The wires from the End Stop Microswitches (4/11) should be shortened and soldered to three pins of the female recepticle as shown in the diagram below, this is then plugged into the end stop connector on the PCB (J3).
-
The D15F (J7) is be prepared by soldering 10cm of wire on to each of the 15 pins, this can then be mounted into the Main Body (12) with the wires exiting from the bottom of the PCB (15), the wires should then be connected to strips of female receptacle as shown in the diagram below, this can then be plugged into (J5/J2) on the PCB.
-
The Low power connector (J8) is prepared by soldering two wires (red and black) to the connector, The red wire is connected to the centre pin of the connector and the black to the ring, the wires should exit inside the Main Body at the bottom of the PCB and shortened so that they easily reach the power connector on the PCB and then soldered to two pins of a female receptacle, this can then be plugged into the power connector (J6) on the PCB. The PCB (15) is a tight fit inside the Main Body (12) and does not require and additional fixing.
The gates themselves should be made to fit individual requirements, the gate holders on the sliders have been designed to accept 1mm aluminium sheet and fixed in placed using M3x25 screws and nuts.
Once the power supply and programming module are connected the LCD will illuminate and the program will initiate. A simple menu structure for the operation is shown below.
The first menu shows that the unit is running and waiting for an input change.
Pressing SETUP will enter the function to adjust the presets of the different positions starting with position 0.**
Pressing NEXT will change the selection to position 1 and then 2 up to position 7.
Pressing SEL on the selected position to be changed will enter the function to set the value for that preset.
Pressing + or - on the selected position will change the numerical value in millimeters for that position, pressing SEL to confirm will save this value to memory.
Once the required presets have been entered using the Programming Module the positions can be checked using the DIP switches on the programming module. The Gate Unit can be de-powered and the Programming Module removed, all parameters will be saved to Non-Volatile Memory.
Position 3 has been preset in the program to Fake Move and this mode will cause the doors to move away from the current position and then return to this position, this has been done incase the sound of the motor creates a false stimulus/cue for the animal performing the experiment. Position 7 is reserved and will always cause the doors to return Home thus closing the doors completely. The two reseved positions can be modified in the program to allow eight user definable positions.
Using the diagram below a control cable can be built to allow the Gate Unit to be connected to a controller of choice as long as the controller presents a 3.3v or 5v 3bit logic output
The three bit binary logic inputs are as follows:
Logic Input | Position Number | Position |
---|---|---|
000 | Position 0 | User Definable 0-55mm |
001 | Position 1 | User Definable 0-55mm |
010 | Position 2 | User Definable 0-55mm |
011 | Position 3 | Fake Move |
100 | Position 4 | User Definable 0-55mm |
101 | Position 5 | User Definable 0-55mm |
110 | Position 6 | User Definable 0-55mm |
111 | Position 7 | Home/Closed |
Control Pin Out for External Controller
Once the power is re-applied the gates will follow the given logic inputs.
The Main Body (12) has been design for mounting on a 30x15mm rectangular steel tube present in our personal setup, the clamp (13) is screwed down tightly to achieve a tight fit, the drawing can be modified before printing to allow for any other types of mounting requirements, orientation or position.