Well, what started off as a simple exercise in Grasshopper and an introduction to Arduino has transformed into a year-long educational experience in simple electronics, DIY PCBs, 3d printing, clearing extruder heads, and most importantly, PATIENCE. Today, I am happy to present Mr. Octopus: the interactive nightlight friend.
The PCB is designed so that you can alter the Arduino code and change the basic interaction of the nightlight. You can also design your own nightlight body (make some friends for Mr. Octopus... I see a bright future for Miss Dolphin and Sir Whale). The PCB was drafted in Eagle CAD and fabricated by OSH Park. The octopus STL was generated in Grasshopper for Rhino, but I'm sure there are plenty other applications that will work just as well.
But enough chatter... this is what you'll need:
- 3d printer (I used a Printrbot Simple Metal)
- Soldering station (ie. soldering iron for electronics, solder, flux is helpful, tip cleaner, fume extractor, tweezers).
- Fabricated PCB
- Fine tooth file
- Computer, with Arduino installed
- Wire cutters
- USB to USB mini B connector
- Arduino UNO and jumper wires
- All the teeny tiny smd parts (see the BOM)
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Fabricate the PCB
I used OSH Park to fabricate my board. I received it about 2 weeks after submitting my order.
After you get the boards, use a file to sand off the rough edges (mouse teeth). Make sure you run the board under water while you do this so you don't inhale any fiberglass.
- The USB connection is a USB MINInot a USB micro (the PCB component is labeled wrong, but the footprint is correct)
Step 2: Print Mr. Octopus
While you are waiting for your boards to arrive in the mail, make a nice print of Mr. Octopus's shell.
Download the STL and print it on your 3d printer. You may want to do a few test prints to adjust your printer settings for the best surface finish. I used support material for the bottom piece and no support for the top piece.
Trim out all the stray whiskers from your print. As you can see, I was a little lazy here and did not trim out all the whiskers from the bottom...
Step 3: Solder
Solder all the components onto the circuit board. Reference the eagle file if you are confused about any of the parts.
I recommend this order:
- Resistors and capacitors
- Voltage Regulator, NPN Transistor, Battery Charging IC, Attiny85
- Battery connector, USB
- Header Pins
Special Instructions for the Photoresistor:
- Before soldering, thread the legs of the photoresistor through the PCB.
- Place the PCB into the bottom half of Mr. Octopus.
- Line up the photoresistor with its cutout on the edge of the printed shell.
- Bend the photoresistor such that it faces out of the Octopus and just barely sticks out from the surface (see the image).
- Once you are happy with the photoresistor placement, solder it. I actually soldered mine while it was sitting my 3d printed piece, so feel free to do that too.
- Trim the legs of the photoresistor after soldering.
Step 4: Program the Tiny
I used my Arduino UNO to program the Tiny for this project.
Setup the UNO:
- Connect the UNO to your computer.
- Open "ArduinoISP" found in File > Examples > ArduinoISP
- Upload the "ArduinoISP" code to the UNO.
Program the Tiny:
- Connect the header pins on the PCB to the UNO as shown in the diagram.
- Test the connection by uploading a simple sketch (like a blinking LED).
- If the connection works, upload the nightlight code.
Step 5: Test the Battery
Once your code has successfully uploaded, unplug the board from your computer and gently plug in the battery. Make sure you don't push the battery all the way in -- it's very difficult to remove with your fingers (I had to use pliers).
You can test the recharging circuit on the board by plugging the USB cable back into the board. The red light means it is charging. The green light means it is fully charged.
Step 6: Put It All Together
The final assembly:
- First place the battery in the bottom half of the octopus.
- Put the PCB over the battery and pull the battery wires through the notch next to the hole.
- Gently push the PCB into place (line up the holes in the 3d printed bottom and the PCB)
- If you want, use a small screw to hold the PCB in place. It should thread itself easily.
- Plug in the battery.
- Put the top half of the octopus over the PCB.
Step 7: Turn Off the Lights...
and bring it to life!