My robot is ready for a nap

Sophie Lowen
A practical guide to resilience process
3 min readNov 10, 2020

My first thought when I read the assignment to make an environmentally sensitive robot was what are my own reactions to the environment? I know we just passed daylight savings time and its starting to become very apparent that the days are getting shorter. I find that with less light out I always want to take a nap and have less energy. I thought it would be cool to reflect that in this robot.

I decided to use a servo motor to reflect the energy output and then also a photoresistor. I started by building the circuit. I used my previous experience with photoresistors to set up that side of the circuit. I then realized when I went to put the motor in the circuit that the nano only has one 3v3 pin so I had to connect that pin to the left column so that both of the components could connect to power.

I then tested both sides of my circuit separately to make sure they worked by using the example code in the arduino libraries.

I then found a tutorial that helped me figure out how to combine the two components and the code using the map function. (https://www.instructables.com/Light-Controlled-Servo/) . This was really helpful to explain how to get an Analog value to map to the position of the servo knob.

My code then looked like this:

I realized though that I still wanted the sweep function when there was a lot of light because that would show that the robot had energy so I changed the code a little bit more and ended up with this:

So now in the serial monitor it tells you when it has energy and when it doesn’t based on the light value and when it has energy it is doing the full sweep motion and when it doesn’t it is back at 0.

This is what it looks like:

--

--