Smartening Plantation Shutters

Hi Chris, this is very impressive! :bowing_man:

I’m curious to why you use the additional 2 gears that get swapped depending on the direction of the lever?

because of the gear ratio of the n20 motors they are not back drivable and one of the key requirements for the design is to be able to be manually adjusted (my wife hates getting out her phone to do things).

After each move the gear disengages the rack making it manually adjustable. the actuator arm still moves in and out with the blind, moving the linear potentiometer, so position is always tracked… every 60seconds while sleeping, and every 1.5seconds while moving.

This design works well because the gear turning into the rack pushes it harder into the rack, and the gear rotating out of the rack pushes it back into the internal gear.

Another update, unfortunately the i2c and the repeaters i chose are being difficult and not reliable enough to use. So i’ve changed to rs485, this means another round of PCB designs for both the master and slave devices. but testing is underway now. off the shelf options were 5v modules and also require level shifters… so its spaghetti junction at the moment - till my next AliExpress delivery!

On a positive note, the software has had some major advances with the help of AI.
The gateway has a web interface, it creates a AP to enter Wi-Fi credentials and MQTT server settings if they are not saved in flash already, otherwise the web interface is available from the assigned IP address. From the web interface you can generate your own keys, these are saved to flash and can then be downloaded to your phone as a small json file.

The master device also creates a web interface on an AP if there is no keys found in flash. from the interface you can upload the key file, the device then restarts, and connects directly to the gateway.

The first message from a new device to the gateway will publish mqtt discovery messages and subscribe to the relevant topics automatically. The master device creates a device that reports battery voltage and some diagnostic info. The master also creates a cover device using the master deviceID_0. If there are any slaves connected to the master they will be discovered on a power cycle of the master, once discovered the master will publish the info to the gateway and the discovery message will automatically add the slave device cover as master deviceID_X, where X is the slave number…

Stay tuned as i hope to have some software and PCB designs up on github as soon as i have verified that multiple slaves work nicely together on the rs485 bus.

2 Likes

This project looks so cool!!! Great job ! I cant wait to see the STL and code on github so folks can contribute !!

Its taken way to long to get here… that last 20% definitely takes 80% of the effort. Ill try and add some user guides and some assembly videos over the next few days.

Can someone also try this Onshape link for the actuator, I’m not sure exactly how to share the model

A sneak peak at the automatically discovered devices in home assistant. I’m still blown away by the fact they just show up and you can add them to a dashboard!



3 Likes

Wow @chris.huitema. Absolutely love the level of detail in the README.

I have plantation shutters all over my house and it’s the one thing I’d paused on trying to automate, but needless to say I’m very excited to check this out asap.

Your Onshape link works just fine. You have a public document, so anyone can view and make their own copy to play around with without impacting your orig design.

Over time I’ll add more info and pictures, my focus was getting the software to a point where devices in hard to reach places could be updated OTA. And now that’s done and working well.

I need to make a video and some clear assembly instructions as I do some pretty hacky stuff with the heltec board, like soldering a wire to a MOSFET to drive the step up board


This photo was one of the original prototypes but the concept is the same…

New package thrown over the gate today… saved me going to the post office to pick it up! Earlier than expected… it’s amazing how fast they make them and get them out the door, submitted the files on the 31st and delivered on the 9th with the slow (aka cheap) delivery

Have checked I got the footprint right for the new rs485 module already, and everything else looks perfect, so tomorrow I’ll be making a build video of how to assemble the pcb’s.

Unfortunately the printer messed up, I need to review why but it looks like it could be a slicer issue… it sucks because it was about $40 worth of resin. The z axis might have shifted but it’s strange, there should be 5mm tall supports but they are about 1mm, and the end plate is paper thin instead of 2mm, but then it looks pretty good, maybe about 1% shorter than it should be… can see the tooth pitch on the rack is different to previous prints

I’m going to look at injection moulding the parts, the resin I’m using has gone from $95 to $170 AUD and with spillage and wastage it’s looking like about $10 per actuator… while they are perfect when they work it’s just not cost effective. Alright if you just need a few but I need dozens! At 20hrs to print and an hour of post processing for 6 of them it will also take a while.

If anyone is making some let me know how you go! I have a bug in the gateway software that was causing the Lora to stop transmitting after a while, I think I have it fixed, will monitor for another day and push the changes to GitHub…

I am super excited about this project! I’ve been waiting for a solution that still allows manual control of the shutters.

My PCBs arrived today too!

I’m still waiting on all the other parts from aliexpress. Those are probably a few more weeks out.
I already had a heltec lora board that I plan to use for the gateway. I bought a couple wireless stick lites from a local retailer (rokland).

My shutters don’t exactly match yours. The gears/linkage is all internal. I’ve been messing with a couple ideas for the clamp. I haven’t been able to really test them out yet. I’m planning to iterate more on that once I have the first actuator put together.


That’s awesome, I’m on my way to Jaycar to pick up some caps and resistors… Plan today is to whip up a electronics build video… it’s pretty straightforward… main thing is the wire on the vbat MOSFET before you solder it in…

also, how did you go printing the gears? Looks like you are using a FDM printer? I’m interested to see how they look and how well they mesh…

video is made, just exporting it now and uploading to yt. I’ll put the link here and on the GitHub page. I kept it short… about 20mins for building both master and slave… it’s not fancy… but will do for now

1 Like

I’m using a bambu printer. For the first test run, everything is printed in PLA. On future prints, I’ll probably use PETG.

The gears mesh pretty well. At the moment, I’m holding them together with resistor leads and they are a little loose. I expect they will tighten up when I get the proper sized metal dowels.

And how are you with vs code / platform IO? I plan on releasing pre-compiled binaries to flash once I add the calibration routine, but for now it’s a manual process by changing defines and recompile.

A couple more updates pushed today fixing a gateway bug and correcting a pin change between my v1 PCB’s and the v2 that I released to the wild.

Hopefully I can get this calibration routine done over the next week or so… plan will be to have 2 buttons on the web portal of the master and slave where you move the blinds to closed by hand and push the set closed button, then move them fully open by hand and push set open. The time to move calculation should then function the blind open/closed a couple of times to figure out normal times for moving and disengage etc. this should also take care of the left vs right actuators too

edit: slaves basic open/closed calibration done and pushed to GitHub, will work on master tomorrow… hopefully mostly cut and paste…
edit 2: master now has buttons for setting open and closed limits too!

Thank you for your work, everything looks great! I have a question, if my windows are divided into 2 segments, then I need 1 master and 1 slave for each window, am I right? Are they connected to each other by a wire? Should power be supplied only to the master? Did you not make a compartment for the battery?

Yeah, I designed the system to minimize the battery and solar requirements

So you would use 1 master and 1 slave, they would connect via a 4 pin connector/cable, basically 5v power and RS485. the master is powered by battery, and will step up the voltage to 5v to power its own motor, and to power the slave.

I have been using telephone cable as its cheap, but more importantly its flat and can be held in place easily using double sided tape.

Currently i haven’t done much testing to see how many slaves can be powered off a master… but its at least 3… ultimately i would like up to 11, but that’s pushing it for the step up module and will require software interlocks for the motors

In the BOM i list out the solar panel and charger i have been testing for a few days, its more powerful (2.5w vs 1w) than the one that’s been running on my front window for a couple of weeks. this is the trend for a single master unit with the 1w panel and a 2000mah 18650 battery (note - the weather was really bad with several days of rain and full cloud cover, followed by a 4 good days, then another patchy day and today is clear)

I havent made a compartment for the battery yet, i couldnt fit it in the actuator due to the space limitation at the side, unless i made it longer but then printing would take longer. I will whip one up in onshape at some point to keep it all neat, ill keep you in the loop when i do.

I’m not familiar with c++ or platform IO, but it seems straightforward so far.
I already flashed the gateway firmware. After configuring everything, it popped right up in home assistant.

Sorry, I can’t figure out what solar panel you are using, as the link in the BOM says solar panel 18v 3.8w and the CN3791 board in BOM is for 6/9/12v. Is this correct? Because based on your message, 1w will not be enough to maintain Master+Slave, so 2.5w would be good, would like to take what you have already checked out )

The small panels I was using originally are enough, but the 18v panel I list in the BOM looks better and is cheaper. It could be 3.8w I was just going off the top of my head…

The 12v charger board says 12-18v solar panel, so choose the 12v version

1 Like

I’m noticing when testing with the actuator for the right hand side that there is some issues with sensing position while the motor is running, there is a voltage drop which makes the position read about 10% higher than when the motor is stopped. This was not noticeable when the left actuator was in use, because the pulldown is strongest when the actuator is retracted thus less offset is observed.

I’m tossing up a couple of ideas how to resolve the issue, I can compensate with a software offset when the motor is moving, which does work reasonably well but may drift as battery voltage reduces (tested this last night). The other option is to measure the voltage at the middle of the voltage divider as well as the wiper, this would be the most reliable but will need a jumper wire or an updated PCB. I’ll run a test doing it this way when I have time

Edit: i tested this tonight by adding a 1cm jumper between GPIO15 and the resistor going to the pot, and made some code changes to calculate the offset, this resolves the issue and position is stable now and always ends within 0.5mm of previous position. mod required for V1 and V2 boards



Ill make the changes to the PCB file soon. I need to do some more testing and ensure the slave devices can be done in the same way (I don’t even know if they have the same issue yet)
Edit 2: the slave device doesn’t display the same issue, position is stable at all times. i made the same change with the reference voltage and it doesn’t change.