“I turned myself into a lab rat, Morty!!! BOOM! Big reveal. I’m a lab rat! I’m lab-rat-Riiiick!”


Operant conditioning is learning by consequences. If a behavior is followed by something good, you do it more. If it’s followed by something bad, you do it less. This theory was developed by B.F. Skinner in 1937 and forced upon sociology majors ever since. He created the “Skinner box”, an automated enclosure that taught lab rats to press a lever because it was followed by food.

I think that laziness can be a good thing (simple and low-effort solutions are always best). However, this also means that my motivation to perform certain tasks can be… low. But what if I could hijack my inner rat-brain and condition myself to certain behaviors? What if I Skinnerbox’d myself? Let’s find out!

Queue theme music.


I was inspired to develop this project after seeing an Instagram reel by Zaq Makes. He’s an author who literally locks himself in a shed for an hour and receives candy from a gumball machine every time he writes 500 words. This forces him to sit down and write, and also incentivizes him to perform a task. Skinner would be proud!

My photo

However, I see a problem with Zaq’s method. What prevents him from eating candy without writing 500 words? That takes a lot of self-control.

It’s hard to reinforce behavior when you can reward yourself any time you want. Self-control needs to be taken out of the equation (for me at least).

IF (task complete) THEN (give reward) ELSE (nothing)

Fortunately, we live in a time where semi-intelligent digital automatons abound!

Using the power of AI chatbots and automated dispensing machines, we can build a Skinner box without the cage.

My photo “Gentlemen, we can condition him. We have the technology. We have the capability to make the world’s first AI-trained man.”


Here’s how to Skinner box yourself:

  1. Store rewards in a locked vending machine

  2. Send proof of completed tasks to an AI chatbot for verification

  3. Receive valid codes

  4. Enter codes and collect rewards

Seems simple in theory. It was actually way more annoying in practice. Before we discuss that, let’s talk about tasks and rewards.


DISCLAIMER: I DO NOT RECOMMEND ANYONE REPLICATE THESE METHODS. AVOID ADDICTIVE SUBSTANCES.

Rewards are very important for operant conditioning. They should be rapid, effective, and repeatable to reinforce the desired behavior. Nicotine fits this profile very well (which is why it’s so hard to quit). It produces a reinforcement loop that is both habitual and physiological. Also, I’m all out of cocaine.

My photo “Forgive me Father for I have zynned.”


Tasks are the most variable part of the experiment. There is a sweet spot of difficulty: tasks that are too easy will be abused, while tasks that are too difficult will be ignored. We also need to generate proof that the chatbot can verify.

I’m required to complete 40 hours of continuing education every two years to renew my professional license. Credits can be earned by attending live webinars and passing a quiz at the end, after which you receive a digital certificate of completion. Seems like a good task to test.


Task: 1 Hour of CE

Proof: Digital Certificate

Reward: 1 ZYN Pouch

Let’s build it!


The Capsules:

Nicotine pouches need to be stored in an airtight container to avoid losing potency and flavor due to moisture absorption (they are essentially miniature desiccant packages). So, I printed a small army of PLA cylinders, each with a TPU plug to seal the ZYN inside.

My photo My photo


The Magazine:

These capsules are loaded into a magazine with zig-zag ramps, allowing me to dispense them one at a time. Hoppers did not work - they would just bridge and jam. Its total capacity is approximately 70 pouches. An acrylic plate helps visualize how many are left.

My photo My photo

Smoooooth.


The Dispensing Mechanism:

At the bottom of the magazine, the capsules roll into a hollow bolt, which rotates 180 degrees via a servo motor. Gravity feeds the bolt, rotates to dispense, and then cycles back to load the next one. It’s surprisingly reliable.

My photo My photo

Unmute to hear the satisfying sounds of Skinnerbox success.


The Control System:

An ESP32 microcontroller with OLED display handles the servo and keypad logic. I have no shame in admitting that ChatGPT helped me vibe-code this monstrosity. It is powered with a USB powerbank and programmed with 300 valid six-digit codes. Once a code is used, it is “burned” and does not allow another rotation of the servo. The case is glued shut to prevent tampering.

My photo My photo

But wait! There’s more…

The most difficult part of this project was not the dispenser’s construction, but rather the AI chatbot implementation. Specifically, it was very hard to hide the codes from myself.

In order for a chatbot to provide valid codes, I must first tell it the codes. This is an issue because I can simply scroll to the message in the conversation where I provided them and thus cheat the system. You cannot delete those messages, otherwise the chatbot will forget them.

My photo

Sam Altman, if you’re reading this, PLEASE add persistent file editing.


I tried hosting a cloud-based spreadsheet, but could not restrict the permissions such that the chatbot could access it while I could not. The chatbot would also reveal all the codes in its “reasoning log” during access. To make matters worse, it sometimes reused or hallucinated bad codes because it could not keep track of them.

Frustrating!

My photo

“Open the Zynnerbox doors, HAL.”

“I’m sorry Dave. I’m afraid I can’t do that.”


I considered many complicated cryptographic, Wi-Fi, and time-based solutions, but they all made my head hurt. Eventually I settled on the following method:

Google Gemini Gems are shareable chatbots - you provide a list of instructions and can share a link for others to interact with it. The user cannot see the instructions, and the Gem can be told to never reveal its instructions when the user asks for them.

If we create a new Google account for this purpose, a trusted third party can then change the account password and remove our access. Now we can’t cheat!

My photo Jokes aside, I was actually pretty impressed by Gemini Gems and Google Labs.


Finally, I needed to ensure the chatbot was tracking used codes accurately. To do this, I implemented a system where the chatbot does not have to track codes at all.

Here is how:

  1. Create a mathematical function to generate codes

We define a function f(n) that generates integers ranging from 100,000 to 999,999 when given an input from n=1 to n=300. These 300 codes are hardcoded into the dispenser. For example:

My photo
  1. Create a new Google account to save our work and host the Gem

I saved the project’s Arduino program, the list of valid codes, and the mathematical function to its Google Drive. Then I created a new Gem and shared the chatbot link with my normal Google account (viewing permissions only).


  1. Provide the Gem with the mathematical function and instructions

The chatbot will only solve the equation for a provided “n” if the user uploads proof they completed an acceptable task. As long as we give it a unique “n”, it will provide a unique and valid code. All we have to do is increment by “n+1” each session.

My photo
  1. Delete everything related to the codes

I deleted the list of valid codes, the Arduino program, and the mathematical function from my computer. The function is long and I purposefully did not memorize it.


  1. Ask a third party to change the Google account password

My friend changed the password so that I could not access the account. He has instructions to only tell me the password 24 hours after I ask for it (in case bugs appear or changes to the Gem are needed). My photo

I’m pretty proud of this solution, but if you have an obviously better one, please email it to me. This would have been a fun brainteaser if it didn’t constantly hold my lip pillows hostage.


So, does the Zynnerbox work?

My photo

Well, let’s just say I completed my CE ahead of schedule.