The Arduino Mega 2560 and the Tale of the Hijacked Amygdala
- Samantha H.
- Nov 14, 2022
- 4 min read

In his 1995 book, "Emotional Intelligence: Why It Can Matter More Than IQ", Daniel Goleman used the term "Amygdala Hijack" to describe the brain's radical response to extreme emotion including fear, anger, frustration, excitement. Known famously for being responsible for a person's fight-or-flight, survival driven response to danger, the amygdala is supposed to work with other parts of your brain to decipher if a "danger" is actually dangerous, or if it's okay for the body and brain to go back to equilibrium. Normally this happens quickly, but if the amygdala is "hijacked", the body's physical response to the "danger" does not relax...thus, chronic stress and anxiety disorders. Books have been written on the effects of chronic stress, anxiety, depression, etc. on physical and mental health, but for the sake of brevity I will assume that the reader has some understanding that the words "chronic" and "hijacked" are mainly used as unpleasant descriptors.
Enter Week 2 Adventure:
Our goal this week built off of the project from Week 1 (you can read about that here), by modifying and elaborating on the code and physical components of our preceding project. I spent a few days thinking about what it would take, learning the difference between analog and digital waves, the purpose of a potentiometer (POT), and learning more about the breadboard in detail. The end goal was to control the rate/power level of two LEDs using the potentiometer to manually manipulate the voltage in the circuit.
Going into this adventure I reasoned that this would be fairly simple, and that I would have it worked out quickly with some planning (in my mind's eye), and some reading. I am not sure if you have gathered yet, but I go off on tangents pretty regularly: that's the real adventure! So, I started thinking, then reading, which led to more thinking and some new questions, which led to more reading, which led to...you get the idea. So, I learned a ton, and by Saturday night I had a brain full of new knowledge that I needed to figure out how to incorporate with the zilch I had accomplished physically. (BTW, this assignment is due on Sunday night *gulp*)
To start off I reconstructed my first project from week 1, and used the original code to make sure that everything was working correctly. Then I rearranged and added some wires and another LED, resistor, and the potentiometer to the circuit. I attempted to alter the code, and the resulting code is shown below: (P.S. Don't use this code if you are trying to reproduce this project...it doesn't work, trust me)

Continuing, I decided that perhaps the problem was physical, so I rearranged some wires on my breadboard, and asked the editor to run the program again to test the old code with the new build. Nothing. I tried two more arrangements of wires and resistors, and the potentiometer...still nothing. So, I returned everything, including the code, back to where I had it the first time (at least I knew something was going to happen). At this point, my blood pressure is rising, my eye is starting to twitch, and I can feel myself about to "snap"!
Deep breath...then another. I started looking at the clock, and started to stress, sweat, feel a sense of impending doom. I tried to shake it off, so let's continue. I made a few more tweaks to the code. Below you can see one of the codes that almost did what I wanted it to. Not really, but it got me moving in the correct direction.

I'm frustrated, tired, and stressed about the time. My heart is racing, I'm sweating, and getting upset, the BAM! Hijacked!!!! I can't think straight, I'm insanely irritated, tired, and I know there is no way I am going to meet my deadline. I try breathing, but the negative feelings and the nerves and the pain in my head won't stop! Chronic stress, fatigue, etc. does funny things to your mind and body. I got up from the table (angrily saying a few "choice" words to my project), and retreated to the sanctity of my bedroom.

At 10:30 p.m. I could finally think again, and decided it was time to finish this! I found the "secret" to fix my code from the blog/YouTube video of one of my classmates. I made a few minor adaptations to fit the remedy into my current code, saved and analyzed it, held my breath, and Viola!!! Success!!! It was an epic celebration with dancing and whisper screaming!!! (the kids were already asleep)
Thankfully no one caught my victory dance on video, but you can see the video of my project functioning properly below ( watch with closed captions on):
I have also included an info-graphic to allow a closer look at the code, and the physical build of my project.

Hallelujah!!
So, after an epic struggle I was able to solve the puzzle, and then went after a few of the questions that popped into my head while I was in my reading/thinking cycles. I wondered if the POT is necessary to control the voltage (make the LEDs fade/decrease or brighten/increase), and found that at least with my unit (Arduino MEGA 2560) I can write a code to take advantage of the PWM (pulse-width modulation) pins on the board to control the speed and intensity of the LEDs. The PWM pin does this by simulating analog signals (from the digital that is produced by the computer) by adjusting the voltage output.
For example: if you define a variable, and set a range of voltage outputs (either increasing, or decreasing) the PWM in the Arduino MEGA can make the LED appear to grow brighter or dimmer. However, the overall effect/appearance will differ depending on the delay that is set between power settings: too little delay will result in an LED that appears to be always on, and too much delay will result in a choppy (blinking) effect. Pretty cool!!
My take-aways from this activity are as follows:
I have a ridiculous time with time-management and staying on task when I am interested in an activity or subject.
The thinking/reading cycle seems to be part of the maker mindset (or possibly a psychosis), and it leads to greater discovery and understanding.
The greatest struggles lead to the most satisfying rewards (and victory dances)
Making is fun!!
Amygdala "hijacking" aside, this was a great experience, and I am really starting to understand the type of learning and experiences a maker space should provide to its users. I am excited to get involved with the next project, and see more examples and ideas for maker spaces in schools.
Comments