Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

DIY USB controlled 12v power distribution box

3d printing DIY Software
  • Please log in to reply
17 replies to this topic

#1 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 20 March 2023 - 09:16 PM

The BigPowerBox.

 

I have been working on this for the past couple of months, as a way to learn electronics design but also mostly because most powerbox connectors are not secure.

Sure, you can buy great powerboxes out there but like all the accessories we love they all use those 2.5mm barrel connectors. As I was building my observatory I wanted something secure that would not disconnect with a slew. A few years ago I got so frustrated with my EQ6 power connector and flimsy serial port that I removed the plate and replaced both with Gx12 aviation connectors. I never again had an insecure connection. So of course when shopping for my new power distribution box I wanted something similar. I could have bought a commercial one and added a 3d printed case around it with my own connectors but I thought "how hard can it be to build one from scratch?" after all I had already built several Arduino projects.

 

Project goals:

  • cheap (well at least not as expensive as those awesome 650$ power boxes)
  • gx12 connectors
  • plenty of ports
  • switchable ports, PWM ports, measure power draw on each port.
  • open source

And here is the result:

internals.jpg

 

  • all-in I spent about 300$ to get 4 boards built ( minimum order was 2 boards for each prototype ), it would cost about 120$ to have one built from my files.
  • 2 always-on up to 10Amps ports
  • 8 on/off ports 6.5A each
    • 6 12V
    • 1 5v 5A
    • 1 USB 3A
    • or any other combination you want out of those 8 12v ports
  • 4 PWM ports 6.5A each  
  • 1 expansion port for an i2c sensor (temperature and humidity) because why not?

 

Note that my power box does not have downstream USB ports. I wanted them but it turns out that designing a big reliable USB3.1+ hub is really hard and the 'cheap' would have flown out the window with the number of iterations it would have required a non pro designer like me to get it right. So I'll be buying an industrial USB hub to go with it.

 

If you want to build one or even better: make it better and contribute back here is where you will find everything you need

I included the Arduino code, ASCOM drivers, 3d print STLs and source, all the PCB build files, and am working on Indi drivers.

 

 

 

 


  • RNSpeed, tjay, mdavister and 12 others like this

#2 OregonAstronomer

OregonAstronomer

    Messenger

  • *****
  • Posts: 431
  • Joined: 20 Apr 2020
  • Loc: Central Willamette Valley and Oregon High Desert

Posted 21 March 2023 - 12:21 AM

Thanks so much for making all your hard work available to the rest of us! This couldn't have come at a better time. I just bought one of those expensive power boxes and one of the selling points was a secure connection to the box using an XT60 connector. Imagine my surprise when I discovered that the short XT60 cord, attached to the box that is mounted on top of the slewing scope, is attached to the stationary power brick by (yup, you guessed it) a simple barrel connector!

 

Looking forward to building yours for the other scope.


  • El Mitch, Starsareus and Bob4BVM like this

#3 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 21 March 2023 - 04:07 PM

Very nice work!  Looks great, and the circuit board design is nice and clean!

 

Is the I2C connection for the temp and humidity sensor actually used yet?  

 

I've been looking at (and collecting components because I can't resist) for a ESP32 based PWM Dew Heater controller with a temp and humidity sensors, plus temp feedback sensors for the dew heaters.



#4 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 21 March 2023 - 07:04 PM

Is the I2C connection for the temp and humidity sensor actually used yet?  

It works, I get values when I plug in a true i2c sensor like the SHT31 ( the DHT21 are not real i2c) but I have not implemented a heating algorithm that matches the dewpoint - and TBH not sure how to do it without temp feedback. The best I can think of is to enable a PWM port when ambient temp goes below dewpoint.



#5 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 22 March 2023 - 07:16 AM

It works, I get values when I plug in a true i2c sensor like the SHT31 ( the DHT21 are not real i2c) but I have not implemented a heating algorithm that matches the dewpoint - and TBH not sure how to do it without temp feedback. The best I can think of is to enable a PWM port when ambient temp goes below dewpoint.

I think if you used an i2c multiplexer (https://www.adafruit.com/product/2717), or use devices that allow different i2c addresses (https://www.adafruit.com/product/1782), you should be able to get multiple sensors on the same i2c bus like this 

 

https://learn.adafruit.com/working-with-multiple-i2c-devices/two-devices-using-alternate-address

 

This would let you add temperature feedback for each PWM port.  The external wiring might get a little messy though.

 

My thinking was to use a DS18B20 temperature sensor for each PWM channel since multiple can be connected using the same pins.


Edited by tjay, 22 March 2023 - 07:18 AM.


#6 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 22 March 2023 - 10:42 AM

This would let you add temperature feedback for each PWM port.  The external wiring might get a little messy though.

That's an awesome idea, am going to order one and breadboard it, I have a pretty good idea for the firmware and how it can tie into the driver. the RJ12 is a full-on i2c bus so I think it can be done cleanly


  • tjay likes this

#7 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 22 March 2023 - 11:48 AM

The idea of exposing the i2c bus through the RJ12 was and is a very good idea!



#8 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 26 March 2023 - 02:20 AM

Hardware assembled and discovery of probes works, now I can start working on the logic for the PWM feedback

 

Attached Thumbnails

  • 20230326_001520.jpg

  • tjay and lookbackintime like this

#9 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 26 March 2023 - 11:43 AM

Looks great! 



#10 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 08 April 2023 - 11:57 PM

Any update on this?  I am curious to know if the PWM feedback worked.



#11 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 11 April 2023 - 10:31 PM

Hi Tom,

I've had a few busy weeks, I've made progress and should be able to release in a couple of weeks. I've had to redesign a lot of logic and other mods got in the way.


  • tjay and flamidey like this

#12 tjay

tjay

    Gemini

  • *****
  • Posts: 3,041
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 12 April 2023 - 05:59 PM

I completely understand that!  I've got a some PCBs around here from mlord waiting for components to be soldered on so they become Homebrew Gen3 AUX relay boards to work around the dead GPS in my Nexstar 8GPS.

 

There's always a list of projects!



#13 mhnudi

mhnudi

    Lift Off

  • *****
  • Posts: 9
  • Joined: 06 Dec 2021
  • Loc: Matthews, NC

Posted 22 April 2023 - 03:49 PM

I was just starting to look into a project like this and came across this thread. Great work! Very interested to see what you come up with for the temperature feedback. Will be following!



#14 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 22 April 2023 - 06:43 PM

Hi mhnudi, thanks for the interest. I've been stalled recently but just figured out it's just a PID problem... Am going to implement PIDController.h and it should work, next will be adapting the Ascom driver as I've done a bunch of other mods
  • tjay likes this

#15 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 30 April 2023 - 01:50 PM

I just pushed the new code to the repo. So here is what is new:

  • rewrote the temperature probe support
    • added support for a i2c multiplexer
    • added support for AHT10 probes (dirt cheap)
    • the first probe found ( either non-multiplexed or port 1 of the multiplexer if no 'native' ) will be the global probe feeding global temperature, humidity and dewpoint
    • the next probes found are assigned in order to the PWM ports
    • maxed the number of probes to 5 ( even though we could support up to 24 - 3 per mux port )
  • rewrote PWM port handling
    • PWM ports have now 4 modes of operation
    • mode 0: regular 255 level PWM port
    • mode 1: on/off mode. in N.i.n.a. this requires a reconnect of the driver to change the UI
    • mode 2: simple dew mode: when global temperature dips to the dewpoint the PWM port turns on to the previous set PWM value. turns off if the global temperature rises beyond the dewpoint
    • mode 3: PID control with temperature feedback. You need multiple temperature probes for this to work. This will monitor the temperature of the heated component ( your tube ) and use a PID algorithm to keep the dew heater heating it up to the dewpoint + a configurable offset
  • changed a bunch of smaller things in the code

CAVEATs: the tuning of the PID parameters is basic at best. I live in the Mojave desert so I don't know what dew is, I don't have a dew heater so all of this is theoretical.

In N.i.n.a. changing the PWM port mode from 0 to 1 and back requires a reconnect of the driver to change the UI.


  • tjay and flamidey like this

#16 SteveL42

SteveL42

    Ranger 4

  • *****
  • Posts: 321
  • Joined: 18 Sep 2020
  • Loc: Colorado

Posted 20 May 2023 - 12:07 PM

This is very nice work!  I also think the "powerbox" type solutions are way more expensive than they need to be. I am afraid that projects like this don't get seen in this forum much - kinda buried here.  Did you post a link in any of the astrophotography forums?  



#17 polslinux

polslinux

    Viking 1

  • *****
  • Moderators
  • Posts: 794
  • Joined: 05 Jun 2020
  • Loc: Veneto, Italy

Posted 20 May 2023 - 01:28 PM

This thing is a work of art. Really a fantastic job, well done!!!

#18 El Mitch

El Mitch

    Sputnik

  • -----
  • topic starter
  • Posts: 27
  • Joined: 15 Mar 2005
  • Loc: California

Posted 20 May 2023 - 02:32 PM

Wow, thanks for the compliments! That's a good suggestion for the other forums.




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics





Also tagged with one or more of these keywords: 3d printing, DIY, Software



Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics