Repository navigation
Expand file tree
/
Copy pathArduino-Subsystem_141558543.html
More file actions
134 lines (121 loc) · 24.7 KB
/
Copy pathArduino-Subsystem_141558543.html
File metadata and controls
134 lines (121 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<title>Watson Lab Behavioral Box : Arduino Subsystem</title>
<link rel="stylesheet" href="styles/site.css" type="text/css" />
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body class="theme-default aui-theme-default">
<div id="page">
<div id="main" class="aui-page-panel">
<div id="main-header">
<div id="breadcrumb-section">
<ol id="breadcrumbs">
<li class="first">
<span><a href="index.html">Watson Lab Behavioral Box</a></span>
</li>
<li>
<span><a href="Watson-Lab---Behavioral-Box-Home_141559292.html">Watson Lab - Behavioral Box Home</a></span>
</li>
<li>
<span><a href="Behavioral-Box-Project_141559650.html">Behavioral Box Project</a></span>
</li>
<li>
<span><a href="Views_141560199.html">Views</a></span>
</li>
<li>
<span><a href="Behavioral-Box---Systems-View_141558485.html">Behavioral Box - Systems View</a></span>
</li>
</ol>
</div>
<h1 id="title-heading" class="pagetitle">
<span id="title-text">
Watson Lab Behavioral Box : Arduino Subsystem
</span>
</h1>
</div>
<div id="content" class="view">
<div class="page-metadata">
Created by <span class='author'> Pho Hale</span>, last modified by <span class='editor'> Anjesh Ghimire</span> on May 24, 2021
</div>
<div id="main-content" class="wiki-content group">
<div class="contentLayout2">
<div class="columnLayout two-left-sidebar" data-layout="two-left-sidebar">
<div class="cell aside" data-type="aside">
<div class="innerCell">
<p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558573.jpg" data-image-src="attachments/141558543/141558573.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558573" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ArduinoStack-4.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-thumbnail" height="250" src="attachments/141558543/141558574.jpg" data-image-src="attachments/141558543/141558574.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558574" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ArduinoStack-3.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558575.jpg" data-image-src="attachments/141558543/141558575.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558575" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ArduinoStack-2.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-thumbnail" height="250" src="attachments/141558543/141558576.jpg" data-image-src="attachments/141558543/141558576.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558576" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ArduinoStack-1.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span></p><h1 id="ArduinoSubsystem-Name:ArduinoSubsystem">Name: Arduino Subsystem</h1><p>Shortname: ArduinoSubsyst</p><p>Ordering Link: </p><hr/><h2 id="ArduinoSubsystem-Subcomponents:">Subcomponents:</h2><p></p><hr/><h2 id="ArduinoSubsystem-Connectors:">Connectors:</h2><p><br/></p><p><br/></p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<h1 id="ArduinoSubsystem-Description:">Description:</h1><p>Composed of the <a href="Arduino_141558590.html">Arduino</a> and the <a href="Motorshield-Subsystem_141558601.html">Motorshield Subsystem</a>.</p><hr/><p><strong>Modified from I.Cerda Thesis: </strong></p><p>The Arduino and motorshield subsystem consists of a Motor Shield Assembly mounted to an Arduino Mega 2560. Power delivery to the syubsystm consists of 12 V for the Arduino, and 9 V for the stepper motor output of the <span style="letter-spacing: 0.0px;">mounted Adafruit Motor Shield v2. The motorshield also uses 5V (drawn from the Arduino) to power its logic on-</span><span style="letter-spacing: 0.0px;">board. The construct is tasked with the transduction of signals generated by nose pokes at the food and water </span><span style="letter-spacing: 0.0px;">dispensing ports into mechanisms ensuring food and water are dispensed. </span><span style="letter-spacing: 0.0px;"> The arduino</span><span style="letter-spacing: 0.0px;"> relays information to the Labjack </span><span style="letter-spacing: 0.0px;">T7 data acquisition device via an IDC parallel cable.</span></p><p><br/></p><p><span style="letter-spacing: 0.0px;"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="attachments/141558543/187433379.jpg" data-image-src="attachments/141558543/187433379.jpg" data-unresolved-comment-count="0" data-linked-resource-id="187433379" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="I.Cerda Arduino.jpg" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span></span></p><p><br/></p><p><strong><em><< Question</em>:</strong> ** Clarify this. The arduino tells the labjack of both beambreaks and dispenses, but dispenses aren't an actual thing. We don't measure that a pellet dispensed or water dispensed or that the motor or solenoid turned or was in use. We just assume that a dispense occured. </p><p>But if this is true, why do we have different numbers of beambreaks and dispenses?</p><p><em><strong>>> Response</strong></em> (Pho Hale): The difference is that after a dispense event, another dispense event isn't permitted until the specified post-dispense timeout elapses. On the other hand, during this timeout period the animal can still be rapidly triggering the beambreak (by nosepoking, withdrawing the nose, then poking again, etc) which will result in a beambreak event being sent for each. The motivation for this was initially a hypothesis that I had about how the ratio of number of beambreaks to pellets received would approximately track with the amount of hedonistic value they're attributed to the food/water reward. This is just speculation on my part, but the intuition being that If you're really excited you might check frequently to see whether it's time to get another treat but if you don't really care it feels like too much effort to keep poking and waiting and you just give up.</p><br/><p>This motor shield assembly performs <u><img class="emoticon emoticon-question" src="images/icons/emoticons/help_16.svg" data-emoticon-name="question" alt="(question)"/></u> the information encoded in the Arduino Mega 2564. The white, red and green wires of 6 female 3-pin connectors are soldered onto their corresponding inputs<br/>in the digital I/O rail, power rail, and ground rail of an Adafruit Motor Shield V2, respectively. Four of<br/>these connectors interface with the 4 different Beambreak Assemblies (sucrose and regular water, fatty and<br/>regular food). When a digital input is received at the I/O pins corresponding to either water Beambreak<br/>Assembly, the Motor Shield uses one of the 2 remaining female 3-pin connectors to relay a digital signal and<br/>5V of power to the Water Solenoid Valve Driving Circuit to activate the corresponding solenoid valves<br/>controlling water dispense. If instead the digital input is received at either of the food I/O pins, the Motor Shield</p><p>provides 500 mA of current to one of the corresponding 2 stepper motors, driving the dispensing of regular and<br/>fatty food pellets.</p><p><br/></p><h1 id="ArduinoSubsystem-Assembly:">Assembly:</h1><p>Marks: Using <span style="color: rgb(128,0,0);">Red</span>, <span style="color: rgb(0,0,255);">Blue</span>, and <strong>Black</strong> sharpie, label the white wires coming off of the motorshield in two places: once near the top by the black connector, and once near the bottom near where it connects to the board.</p><h4 id="ArduinoSubsystem-Conventions:">Conventions: </h4><div class="table-wrap"><table class="wrapped confluenceTable"><colgroup><col/><col/></colgroup><tbody><tr><th class="confluenceTh">Color</th><th class="confluenceTh">Meaning</th></tr><tr><td class="confluenceTd"><span style="color: rgb(128,0,0);">Red</span></td><td class="confluenceTd">Food</td></tr><tr><td class="confluenceTd"><span style="color: rgb(0,0,255);">Blue</span></td><td class="confluenceTd">Water</td></tr><tr><td class="confluenceTd"><strong>Black</strong></td><td class="confluenceTd">Solenoid Power</td></tr></tbody></table></div><div class="table-wrap"><table class="wrapped confluenceTable" style="font-weight: 400;letter-spacing: 0.0px;"><colgroup><col/><col/></colgroup><tbody><tr><th class="confluenceTh">Number of Bands</th><th class="confluenceTh">Meaning</th></tr><tr><td class="confluenceTd">1 Band</td><td class="confluenceTd">System 1</td></tr><tr><td class="confluenceTd">2 Bands</td><td class="confluenceTd">System 2</td></tr></tbody></table></div><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558564.jpg" data-image-src="attachments/141558543/141558564.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558564" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Marks-FoodWires2.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558565.jpg" data-image-src="attachments/141558543/141558565.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558565" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Marks-FoodWires.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558566.jpg" data-image-src="attachments/141558543/141558566.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558566" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="MostWires.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558567.jpg" data-image-src="attachments/141558543/141558567.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558567" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Marks-WaterWires.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141558543/141558568.jpg" data-image-src="attachments/141558543/141558568.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558568" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Marks-SolenoidPowerWires.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-thumbnail" height="250" src="attachments/141558543/141558570.jpg" data-image-src="attachments/141558543/141558570.jpg" data-unresolved-comment-count="0" data-linked-resource-id="141558570" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Marks-SomeWires.JPG" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="141558543" data-linked-resource-container-version="24"></span></p><p><br/></p><p><br/></p></div>
</div>
</div>
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<h1 id="ArduinoSubsystem-SignalPortsSignalPorts:"><span class="confluence-anchor-link" id="ArduinoSubsystem-SignalPorts"></span>Signal Ports:</h1><p class="auto-cursor-target">When a beambreak state changes, or a value is supposed to be written out to one of the the solenoids, a signal port is used.</p><div class="table-wrap"><table class="wrapped confluenceTable"><colgroup><col/><col/><col/><col/></colgroup><tbody><tr><th class="confluenceTh">White Wire Pin</th><th class="confluenceTh">Mark Color, Pattern</th><th colspan="1" class="confluenceTh">Meaning</th><th colspan="1" class="confluenceTh">I/O</th></tr><tr><td class="confluenceTd">D<strong>5</strong></td><td class="confluenceTd">1 <span style="color: rgb(128,0,0);">Red</span> Band</td><td colspan="1" class="confluenceTd">Food 1</td><td colspan="1" class="confluenceTd">Boolean Input</td></tr><tr><td class="confluenceTd">D<strong>7</strong></td><td class="confluenceTd">2 <span style="color: rgb(128,0,0);">Red</span> Bands</td><td colspan="1" class="confluenceTd">Food 2</td><td colspan="1" class="confluenceTd">Boolean Input</td></tr><tr><td class="confluenceTd">D<strong>3</strong></td><td class="confluenceTd">1 <span style="color: rgb(0,0,255);">Blue</span> Band</td><td colspan="1" class="confluenceTd">Water 1</td><td colspan="1" class="confluenceTd">Boolean Input</td></tr><tr><td class="confluenceTd">D<strong>6</strong></td><td class="confluenceTd">2 <span style="color: rgb(0,0,255);">Blue</span> Bands</td><td colspan="1" class="confluenceTd">Water 2</td><td colspan="1" class="confluenceTd">Boolean Input</td></tr><tr><td class="confluenceTd">D<strong>8</strong></td><td class="confluenceTd">1 <strong>Black</strong> Band</td><td colspan="1" class="confluenceTd">Solenoid Power 1</td><td colspan="1" class="confluenceTd">Boolean Output</td></tr><tr><td colspan="1" class="confluenceTd">D<strong>11</strong></td><td colspan="1" class="confluenceTd">2 <strong>Black</strong> Bands</td><td colspan="1" class="confluenceTd">Solenoid Power 2</td><td colspan="1" class="confluenceTd">Boolean Output</td></tr></tbody></table></div></div>
</div>
</div>
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<h1 id="ArduinoSubsystem-RelayedCurrentStatePortsRelayedCurrentStatePorts:"><span class="confluence-anchor-link" id="ArduinoSubsystem-RelayedCurrentStatePorts"></span>Relayed Current State Ports:</h1><p class="auto-cursor-target">When an Arduino event occurs (such as a beambreak detection event, or a dispense event) the Arduino outputs this signal to another output pin to be read by the Labjack. The <a href="https://wiki.med.umich.edu/pages/viewpage.action?pageId=141558544">Arduino Subsystem</a> and the <a href="Labjack_141559058.html">Labjack</a> are connected by the flat, grey <a href="IDC-Parallel-Cable_141559051.html">IDC Parallel Cable</a>. <span>The <a href="https://wiki.med.umich.edu/pages/viewpage.action?pageId=141558544">Arduino Subsystem</a> (Arduino Mega) has a 2 x 18 pin female socket that the <a href="https://wiki.med.umich.edu/pages/viewpage.action?pageId=141558544">Arduino Subsystem</a> sockets onto.</span></p><div class="table-wrap"><table class="wrapped confluenceTable"><colgroup><col/><col/><col/><col/><col/></colgroup><tbody><tr><th class="confluenceTh">Event Type</th><th colspan="1" class="confluenceTh">Output Signal</th><th colspan="1" class="confluenceTh">Arduino Output Pin</th><th colspan="1" class="confluenceTh">Ribbon Cable Wire Number</th><th colspan="1" class="confluenceTh">Labjack Input Port</th></tr><tr><th rowspan="4" class="confluenceTh">Beambreak<br/><br/></th><td colspan="1" class="confluenceTd"><span style="color: rgb(0,0,255);">Water</span> 1</td><td colspan="1" class="confluenceTd">D<strong>22</strong></td><td colspan="1" class="confluenceTd">6</td><td colspan="1" class="confluenceTd">EIO<strong>0</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(0,0,255);">Water</span> 2</td><td colspan="1" class="confluenceTd">D<strong>24</strong></td><td colspan="1" class="confluenceTd">8</td><td colspan="1" class="confluenceTd">EIO<strong>1</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(128,0,0);">Food</span> 1</td><td colspan="1" class="confluenceTd">D<strong>26</strong></td><td colspan="1" class="confluenceTd">10</td><td colspan="1" class="confluenceTd">EIO<strong>2</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(128,0,0);">Food</span> 2</td><td colspan="1" class="confluenceTd">D<strong>28</strong></td><td colspan="1" class="confluenceTd">12</td><td colspan="1" class="confluenceTd">EIO<strong>3</strong></td></tr><tr><th rowspan="4" class="confluenceTh">Dispense</th><td colspan="1" class="confluenceTd"><span style="color: rgb(0,0,255);">Water</span> 1</td><td colspan="1" class="confluenceTd">D<strong>23</strong></td><td colspan="1" class="confluenceTd">5</td><td colspan="1" class="confluenceTd">EIO<strong>4</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(0,0,255);">Water</span> 2</td><td colspan="1" class="confluenceTd">D<strong>25</strong></td><td colspan="1" class="confluenceTd">7</td><td colspan="1" class="confluenceTd">EIO<strong>5</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(128,0,0);">Food</span> 1</td><td colspan="1" class="confluenceTd">D<strong>27</strong></td><td colspan="1" class="confluenceTd">9</td><td colspan="1" class="confluenceTd">EIO<strong>6</strong></td></tr><tr><td colspan="1" class="confluenceTd"><span style="color: rgb(128,0,0);">Food</span> 2</td><td colspan="1" class="confluenceTd">D<strong>29</strong></td><td colspan="1" class="confluenceTd">11</td><td colspan="1" class="confluenceTd">EIO<strong>7</strong></td></tr></tbody></table></div><p class="auto-cursor-target">"Ribbon Cable Wire Number": The pin 1 is defined as the one nearest the edge of the cable marked with the <u><span style="color: rgb(255,0,0);">red </span></u>line.</p></div>
</div>
</div>
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p><br/></p></div>
</div>
</div>
</div>
</div>
<div class="pageSection group">
<div class="pageSectionHeader">
<h2 id="attachments" class="pageSectionTitle">Attachments:</h2>
</div>
<div class="greybox" align="left">
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558564.jpg">Marks-FoodWires2.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558565.jpg">Marks-FoodWires.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558566.jpg">MostWires.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558567.jpg">Marks-WaterWires.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558568.jpg">Marks-SolenoidPowerWires.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558570.jpg">Marks-SomeWires.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558573.jpg">ArduinoStack-4.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558574.jpg">ArduinoStack-3.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558575.jpg">ArduinoStack-2.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/141558576.jpg">ArduinoStack-1.JPG</a> (image/jpeg)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141558543/187433379.jpg">I.Cerda Arduino.jpg</a> (image/jpeg)
<br/>
</div>
</div>
</div> </div>
<div id="footer" role="contentinfo">
<section class="footer-body">
<p>Document generated by Confluence on Mar 24, 2022 11:12</p>
<div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
</section>
</div>
</div> </body>
</html>