StripPi – Software Demo, Roadkill Electronics

I’m constantly loosing the remote for my RGB LED strip lights, and I have a few days for spring break, time to get hacking. Here’s a demo and explanation video:

I don’t mention it in the video, but the cool part of this project is how the different processes communicate with each other. Rather than interacting with the different processes through pipes, or something like stdin, I’ve decided to use a TCP websocket server:

StripPi High Level Diagram

Processes on the device send RGB values to the Strip Server via a TCP packet. This very very easy to implement, and almost all of the hard work is taken care of via the socketserver  module included in python3. This also allows for interactions with that main process (the StripPi Server process) to take place off of the Raspberry Pi as well. I plan on writing an Alexa integration for this project moving forward, and this should make that a lot easier.

The analog to digital conversion is handled by an MCP3008, exactly the same way as I did it here.

Thanks for reading, more soon.

RS485 Hardware Network 2 – Multi-Byte Communication

Edit: I don’t really make a point of saying it, but the common ground between the modules isn’t necessary.

Here’s a video of the software running on the boards.

So for this example,  there are 4 bytes being transmitted from the master to the slaves.

  1. Start of Transmission (0xDB)
  2. ID of the slave to talk to
  3. The type of command
  4. The data that is transmitted

A transmission to set the pwm value of the green led on the slave with the ID 1 to 100 would be:

This is the schematic of the circuit for this example:

This is the code running on the master Arduino:

This is the code running on the slave Arduinos:

RS485 Hardware Network 1 – Getting Started

For another project I’m currently working on, I need a way to control multiple microcontrollers in a multi-point, multi-drop network configuration. Luckily, we live in amazing times. As I write this, you you can buy a fully assembled breakout board for the MAX485 chip from Maxim Integrated for a mere $0.45 USD shipped from China.

I bought a 5 pack, here are some of the boards:

RS485 is an old protocol, but is the logical next step for devices I’m already communicating with via RS232. For this example, I’m using 4 Arduino boards of various types.

  • An Arduino Micro as the master
  • 2 Slave Arduino Leonardos
  • 1 Slave Arduino Pro Mini (5v)

Here is a video of the setup:

The schematic is really straightforward as well. The only tricky bit is that I’m using a software serial port on each of the Arduinos for ease of debugging. Here’s a schematic:

The code to acomplish this is really intuitive as well.

Here is the code for the master Arduino:

This is the code for the slave Arduinos:

In subsequent posts, things will start getting more advanced. For now however this should be enough to start from scratch.

Thanks for reading.

UV Resin Curing Cabinet | Final Code, Schematic, Bill Of Materials and Demo

Here’s a demo of the finished system:

In the end, it all turned out really well. Painting it white and using a white print stand was a good insight, the light reflects around the box pretty well for how few LEDs are in use.

The software flow chart has changed slightly. I removed the speaker as it wasn’t loud enough and added software debouching for the pushbutton interrupt service routine. Here’s that most recent version:

 

The interesting parts of the code are the cookResin function as well as the main loop of the Arduino:

Again, this all should all be explained by the flow chart. The full source can be found at the bottom of this post.

The circuit schematic hasn’t changed at all since this post, here’s a fritzing of what’s going on:

Super simple, basically a screen and a button. The parts to make this are here:

Assembly is super straight forward, if you’re trying to build one and have any questions, let me know!

Thanks for reading!

UV Resin Curing Cabinet | CAD Modeling And Physical Build and Installation

This past school year I too several classes related to 3D modeling. One class in particular, a class based around SolidWorks. I hadn’t really been able to use the software again, not having the tools to actually execute. MADE@MassChallenge really has the whole kit, 3D Printers, a 40W Laser Cutter etc. All the tools of a hackerspace as a part of my job. Here’s a “finished” model of the system:

Cure Cab Models

The frame is built out of:

  • .22in thick masonite painted black on one side
  • The frame is held together with a series of L brackets and machine screws from home depot
  • The front opening is secured with two metal hinges from home depot

There were a couple 3D modeled components as well:

  • The four feet

I ended up gluing these down with hot glue even though they have cuts for screws. In the end, it wasn’t worth it to use more screws and add more complexity.

  • The electronics enclosure

View post on imgur.com

There is a frosted acrylic sheet inserted in the top. One of the goals of this project was to show off the tech, and I think this does that quite nicely.

  • The knob assembly

View post on imgur.com

The knob has a stem that comes of the back and forces the hinge back, keeping the door closed. I wanted to try and keep things as simple as possible. The threads I modeled weren’t within tolerance. So I just glued the nut in place so the knob could rotate freely.

  • The print stand, for holding up the prints so they cure evenly

View post on imgur.com

It doesn’t make sense to have the prints just sit on the bottom of the frame. I also cut inserts that fit the inside of the print stand. This is so resin doesn’t cure to the print stand so it can be used many times while only needing to change the cardstock inserts.

Here are some more photos of the build process:

Cure Cab Build Photos

I’ll include the plans to build this whole assembly in the final post for this project once it’s all finalized.

UV Resin Curing Cabinet | Declaration and Software Flow

This project is the first of what I hope to be many in collaboration with the MADE@MassChallenge Hardware lab. The primary goal of this project is to speed up the time to delivery on prints coming out of the Formlabs Form 1+ SLA 3D printer using UV LEDS. Here’s a proof of concept of my circuit:

One of my tasks during my internship at MassChallenge was managing the queue of incoming models to be 3D printed on our 3D printers. Turnaround is often a pressing issue when doing this. It was often the case that teams had a deadlines or presentations that they needed parts for. Shaving even minutes off of the time from submission to receiving a fully processed part mattered quite a bit.

The Form 1+ is an amazing printer. If used correctly, the print quality can be much higher than the other 3D printer in MADE, a uPrint SE Plus by Stratysis; a printer almost 5 times the cost.

The post processing involved with the Formlabs has a steeper of a learning curve and leaves a lot of room for possibly destroying a part in the process.

The problem is not a fault of Formlabs, but rather a problem in the chemistry behind the resins used to create the parts. They are photopolymers, and need UV light to be cured. It is suggested that this be done through exposure to sunlight, but that takes quite a long time. I also have a sneaking suspicion that there are adverse effects of doing this, but I can’t prove any of that as of now but hopefully more on that later.

As this is a project that will be used by people other than myself, it is worth it to commit time and effort into the user experience. Atheistic should also be taken into account as this has to stand up next to the beautiful design of the Form1+. In short, a UV LED strand, a 3A switch, a power supply and a Light tight box could functionally do the trick, but in this case a polished design is as important as the functionality.

At this point, a push button switch, a rocker switch and a 16×2 Character LCD will be the UI. The software flow is as follows:

I’ll post the final code when I finish, but this chart is basically what the code running in the above video looks like.

Thanks for reading, more on the physical construction in the next post.

PiPlanter 2 | Plant Update and Daughter Board Migration

First, a video:

I’ve worked very hard since my last update to move all of the hardware that interfaces the Raspberry Pi with the plants (GPIO, ADC etc) from on board the Raspberry Pi using the GIPO to a daughterboard based around an Arduino.

This has been a lot of work to accomplish, but as of about a week ago, the transition was completed in it’s entirety and everything is operating totally normally without using any GIPO on the Pi.

This provides a portability for the platform that I haven’t been able to achieve so far. As the name of the project suggests, I’ve only used a Raspberry Pi to drive all of the hardware so far as well as do everything with the software. This transition opens up the possibility of using any computer running linux to be able to drive a PiPlanter if they have the board.

I’ve outlined the “PiPlanter Hardware Specification” in the current block diagram for the project. So if you have these parts, you can make a PiPlanter. The protocol for communicating between host computer and the Arduino is outlined here. I’ve decided to go with plain text serial using a rudimentary handshake to handle the communication. Pretty much all computers have a serial port, and the Arduino is very good at dealing with it as well.

One of the next steps that I take in this project would to be to design and fabricate PCB’s for specifically for this. This is certainly going to be a challenge for me, but it’s nothing I can’t handle. This also gives me the opportunity to maybe start selling PiPlanters which is exciting. I might need to change the name for obvious reasons…

Here are some nice photos of the updated setup:


All of the code and documentation for this version of the PiPlanter can be found here.

I am going on break from school from today, December 18th 2014 to on or around January 14th 2015. Now that the PiPlanter isn’t at my house, I can’t access the network remotely and make changes to the code. The next month will be a good stress test of the new daughterboard infrastructure. Hopefully it all goes well.

Thanks for reading!

PiPlanter 2 | Python Modules & Text Overlays

So in my last posting of the PiPlanter source code, the python script alone was 500 lines long. The intent with was to make things more modular and generic compared to the original version of the code that ran two years ago. Since the project has expanded a considerable amount since two summers ago, my goal of keeping everything short and concise isn’t really valid anymore so I’ve decided to split the code up into modules.

This improves a number of things, but it makes it kind of inconvenient to simply paste the full version of the source into a blog post. To remedy this, I’ll be utilizing www.esologic.com/source, something I made years ago to host things like fritzing schematics.

The newest publicly available source version can be found here: https://esologic.com/source/PiPlanter_2/ along with some documentation and schematics for each version to make sure everything can get set up properly. What do you think of this change? Will you miss the code updates in the body text of a blog post?

With all that out of the way, let’s talk about the actual changes I’ve made since the last post.

The first and foremost is that using Pillow, I’ve added a way to overlay text onto the timelapse frames like so:

Before

After

 

This was prompted by some strange behavior by the plants I noticed recently seen here:

I thought it was strange how the chive seemed to wilt and then stand back up and then wilt again, it would have been nice to be able to see the conditions in the room to try and determine what caused this. Hopefully I can catch some more behavior like this in the future.

Here is the new Image function with the text overly part included if you’re curious:

Now that I’ve got the PIL as part of this project, I’ll most likely start doing other manipulations / evaluations to the images in the future.

Okay! Thanks for reading.

PiPlanter 2 | Installing a 3rd Instance of the PiPlanter

Ten days ago I finished installing the third ever instance of the PiPlanter in a lab in the physics department at my college! I went with the the rack mounted design as I did this past summer, and am going to be growing Basil, Cilantro and Parsley as opposed to tomatoes. Here are some photos of the new setup:


There are a few major changes that come with this new instance. The first and foremost being the addition of LED grow lights. I’ll post a new version of the code with LED routines included when I think it’s polished enough. The second difference is that a tray of soil is being used as the growth medium for the plants as opposed to pots of soil. This will more than likely be the configuration I use moving forward. The final difference is the actual type of plants being grown. I’m moving away from tomatoes because there will be nothing to pollinate the flowers in the winter as well as the fact that I cook a lot and it will be neat to have spices that I can use on a day to day basis.

The first 10 days of growth has gone well. Here’s a video of them growing so far:

Thanks for reading!