“I’m scared of the dark” Robot

For this week’s assignment, I created an Arduino “robot” that is scared of the dark. The idea is that it will print out its current emotions based on the light measure and will get “scared” and light up when it’s too dark. It did cross my mind that I was giving a robot “emotions”, but that thought went out of my brain pretty quickly.

To get started, I read through the tutorial below for an idea of how the schematic and what the code might look like.

Arduino IDE with an output showing light measurements

Next, I started by giving the new light variable so I had more control over the value that was coming in and simplifying the code a little bit more.

Arduino IDE with an output showing light measurements and emotions

Using if statements, I had the Arduino print out statements based on the measurement of the photoresistor.

  • If there’s lots of light, it would say “I’m not scared, it’s bright out!”.
  • If it’s somewhere in the middle, it would say “I’m fine, I can still see”
  • If it’s dark, it would say “AWWW, IT’S SO DARK! I’m scared!”
Arduino IDE showing it’s scared of the dark

Next, I wired up my breadboard with an LED and added the output value into my code. Then inside the if statements, I had the LED values be off in the bright and medium brightness values. Once it goes into the dark threshold, the LED will be turned.

First attempt, nothing. So I changed the wiring a little bit.

Second attempt, nothing again. Some profanity.

After, the third and fourth attempts, I looked at my code. But it was definitely working because it was printing out correct, so I slacked Professor Benedetta for help. With one look, she diagnosed that the resistor I chose was too high.

BOOM. Once I changed the resistor, it worked like a dream. Here is a video below that shows my robot in action. Lessons learned, use a resistor with a smaller value for LEDs and you can make a robot that’s scared of the dark.

--

--

--

What is resilience? This publication is a documentation of my exploration into what it means to be resilient and how we might design for resiliency.

Recommended from Medium

A design sprint to fine-tune our website

Getting up close and personal

Sprint 2: Usability Testing

Roof Inspections Phoenix — https://t.co/KIE7jxu7mG

Does modern technology influence architecture?

How I Cleared Google UX Design Professional Certificate:-

project five — documentation

Hutton Modular Office Collection: Working from Home in Designer Style

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Som Liengtiraphan

Som Liengtiraphan

I hoard postcards and will dance in public with no shame.

More from Medium

Make swap memory on btrfs

Unix, a standard

Modern C++ in embedded development

PicoCTF: Glitch Cat Challenge-WriteUp