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

HomeBrew Gen3 PCB: WiFi+BT+GPS+MUSB+Relay !

  • Please log in to reply
1452 replies to this topic

#1351 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 26 April 2024 - 05:22 PM

The SkyWatcher AZ-GTi mount I ordered finally is here. 

New Project time:

 

https://www.cloudyni...on-accessories/
 



#1352 nexStar2008

nexStar2008

    Lift Off

  • -----
  • Posts: 18
  • Joined: 08 Aug 2008

Posted 27 April 2024 - 01:40 AM

Received my HBG3 kit, soldered everything as per the pics on the website. What a fun project! Everything works great! I attached a nunchuck from a Wii I bricked about 15 years ago (trying to homebrew it oddly enough) and a Ublox Neo-6 GPS I had laying around in a box for a decade or more and it works perfectly (well there was a some modification required in u-center cool.gif ). Now I don't have any GPS date issues on my NexStar 8 GPS and it finally works again like it did when I bought it. This is a very versatile bit of kit, I think CPWI w/telescope control via my local network is my favourite. Thanks Mark, great job on this!


Edited by nexStar2008, 27 April 2024 - 01:42 AM.

  • mlord and fdboucher like this

#1353 scopewizard

scopewizard

    Apollo

  • *****
  • Posts: 1,416
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 27 April 2024 - 09:22 PM

On your site, the HBG3.ino is still v8.40. Will you post the v8.43 or higher?

 

https://rtr.ca/hbg3/hbg3.ino.txt



#1354 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 28 April 2024 - 06:57 AM

On your site, the HBG3.ino is still v8.40. Will you post the v8.43 or higher?

https://rtr.ca/hbg3/hbg3.ino.txt

Thanks for pointing that out -- Fixed.

It was already in the .ZIP/.TGZ archives, but I guess I forgot to put it in the simpler location!
 



#1355 scopewizard

scopewizard

    Apollo

  • *****
  • Posts: 1,416
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 30 April 2024 - 08:55 AM

Small update on my new project for CPWI getting voltage and current readings.

The setup is using a voltage divider, ACS712 for current and ADC1115 for I2C com and analog readings.

The initial reading showed the voltage within 0.06v compare to my multi meter.

Current readings on one channel within 0.15 amps compare to calculation and multi meter.

Current tested using a dew heater strip for my FLT132.

 

Sadly, my fault, a 2mm screw found its way in the box and landed on the ESP32.

New testing showed the ESP having erratic behaviors, freezing and distorting the display on start.

After checking all voltages, signs of heat or wiring faults followed by testing with all attached devices removed, the I2C circuit was malfunctioning.

Using serial mode showed the failure of the I2C, SHT30, ADC1113 and OLED not activated.

If it sat for 10+ minutes, it would initially start fine but failed within 5 to 10 secs.

I tested with SHT30, ADC1115 removed and a different OLED, two of them, same issue.

 

I removed ESP32 from the HBG3 board and ordered new ones.

 

Stay tune.


Edited by scopewizard, 30 April 2024 - 08:57 AM.


#1356 scopewizard

scopewizard

    Apollo

  • *****
  • Posts: 1,416
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 30 April 2024 - 03:28 PM

I am looking forward to seeing code for the ADC1115 to read the thermistor values.

 

Cheers

I have not done any testing for thermistor but this code might work. Fine adjustments might still be need.
 

int thermistor_25 = 10000;

float refCurrent = 0.0001;

Voltage = adc0 * (3.3 / 65535); //  5.0 or 3.3 with whatever the actual Vcc of your Arduino is

float resistance = (Voltage / refCurrent); // Using Ohm's Law to calculate resistance of thermistor

float ln = log(resistance / thermistor_25); // Log of the ratio of thermistor resistance and resistance at 25 deg. C

float kelvin = 1 / (0.0033540170 + (0.00025617244 * ln) + (0.0000021400943 * ln * ln) + (-0.000000072405219 * ln * ln * ln)); // Using the Steinhart-Hart Thermistor Equation to calculate temp in K

float temp = kelvin - 273.15; // Converting Kelvin to Celcuis

 

I will eventually put that on the bread board and test. Replacing the ESP32 and focusing on volts and amps right now.

 

I would have need for 5 analog pins. So I do see the need for possibly 2 x ADC1115 which would provide 8 possible analog inputs.

This may help if using the compare mode of one active input to an other, noise reduction method. 

 

BTW, the ADC1115 are only 28mm x 16mm in size.


Edited by scopewizard, 30 April 2024 - 03:30 PM.


#1357 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 30 April 2024 - 04:41 PM

The ADC-to-degrees formula is already in the hbg3.ino sketch.  I have adapted it to the ADS1115 here now and (after fixing a bug) it works reasonably well.

 

> BTW, the ADC1115 are only 28mm x 16mm in size.

 

The ADC1115 chip is actually a LOT smaller than that.  Were I to someday incorporate one into a HomeBrew design, I'd just use the chip and a few other SMDs (resistors) rather than the full breadboard module.

 

Sample code using the ADS1115_WE library (installed here from the Arduino IDE Library Manager)Attached File  ads1115_thermistor.txt   1.31KB   8 downloads


Edited by mlord, 30 April 2024 - 08:27 PM.


#1358 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 02 May 2024 - 04:19 PM

Firmware v8.45 is now available for the HBG3 and All-In-One projects:  Attached File  hbg3.ino.v8.45.txt   317.75KB   19 downloads

 

Version 8.45 2024-05-02

  • Add ADS1115 ADC support for thermistors. Wire ADC A0 to 3.3V, A1 to Thm0, A2 to Thm1. ADC A3 is not-used.
  • Incorporate a default ADC_LUT[] table.

There was also an internal v8.44 snapshot/release before adding the ADS1115 changes:

 

Version 8.44 2024-05-02

  • Add SSSWI_HACKING: intercept Challenge/Response and feed our own data to SSHC.

Sources and binaries are available in all of the usual places now.

 

One change is that hbg3.ino now includes an ADC Look-Up-Table (LUT) to improve thermistor readings when wired directly to the ESP32's Analog-to-Digital-Conversion (ADC) pins.  The binary versions have always had that, but anyone building from source didn't have it, and the readings seem far worse without it.

 

All of that said, the other BIG change is that this project now supports use of an external ADC conversion module wired to the I2C bus, using the ADS1115 chip.  This chip is VERY accurate, and easy to hook up as well.  If the code detects one at start-up, then Dew Control will automatically be enabled and that chip used for the Thermistors (rather than using the ESP32's ADC pins).  Going forward, anyone building their own Dew Controller should incorporate a module with this chip.  They are readily available on Amazon and AliExpress for peanuts.  smile.gif

 

I'm going to retrofit one to my own Smart Dew Controller, which ought to take me half an hour or so to accomplish. [DONE!]

 

EDIT: Mmm.. Forgot to set the I2C clock to 800KHz for ADS1115 accesses, so it will be running at only 100KHz (higher overhead) until the next update.


Edited by mlord, 03 May 2024 - 03:16 PM.


#1359 scopewizard

scopewizard

    Apollo

  • *****
  • Posts: 1,416
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 05 May 2024 - 04:18 PM

I was not able to set my wifi name and password in CPWI as it come up with an error.

I checked in the Arduino serial mode and the wifi is going crazy. Select the access mode and it seem fine.

I download a new file and tried again same issue.

 

Update: Found the issue, construction, bad switch.


Edited by scopewizard, 05 May 2024 - 05:03 PM.

  • mlord likes this

#1360 jlutzwpi

jlutzwpi

    Sputnik

  • *****
  • Posts: 33
  • Joined: 19 Nov 2023

Posted 05 May 2024 - 10:09 PM

When putting together my second HBG3 I managed to turn the button 90 degrees resulting in a perpetual reboot cycle. I desoldered the button and and soldered it back in the right position.

 

Unfortunately, I did not catch the issue before connecting it to the mount, and now neither the first nor the second HBG3 is able to to talk to the mount.

 

The mount works as expected with the HC and the Celestron WiFi accessory.

 

On connect with the HBG3 attached, SkyPortal tells me the following: "Celestron SkyPortal can make a connection to the scope, but the scope is not responding. Make sure it is connected and powered on. Also check that the scope type is correct". CPI essentially says the same thing.

 

I have tried to

  • Power cycle the entire system
  • Change the cable between HBG3 and the mount
  • Use different sockets for the HBG3
  • Disconnect all add-ons from the mount (SSAG, MotorFocuser) and the RPI, and QHY camera from the PocketPower Advance (gen 2) and only use HBG3 and SkyPortal/CPWI

... but still get the same result.

 

When boot the mount with both HC and HBG3, the HC  says "No Response 17". I also saw errors 6 and 7s but these were resolved by power cycling with only the HC connected.

 

I have connected the serial cable and am using the Arduino serial monitor. Found the help command, but would appreciate some assistance on debugging the issue... Any ideas?

Thank you for writing this.  Mine was resetting every 5 seconds, and I discovered this thread and your comment made me double-check my assembly.  I did the same thing and wired the button incorrectly.  De-soldering and reorienting fixed the issue for me.  Thank you!


  • cyberduck likes this

#1361 nexStar2008

nexStar2008

    Lift Off

  • -----
  • Posts: 18
  • Joined: 08 Aug 2008

Posted 10 May 2024 - 09:19 AM

Is it possible to use the HBG3 with a focus motor and a camera rotator? Would like to DIY a rotator but won't bother if it's not possible.

 

Thanks!



#1362 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 10 May 2024 - 09:44 AM

Is it possible to use the HBG3 with a focus motor and a camera rotator?

I don't understand the question.

 

But to answer what you wrote, the HBG3 has nothing to do with camera rotators, so of course they can coexist just fine together.  No issues.

 

For the Celestron Focus Motor product, the HBG3 actually includes support for using a Nunchuck to adjust focus on the Focus Motor product, much more conveniently than with a Celestron hand-controller or an app.

 

The HBG3 can also act as a Celestron-compatible Focus Motor if one wires in a stepper motor and driver chip (for under $20) to the A,B,C,D pads of the HBG3.  This then acts identically to the Celestron product, including being able to be controlled by CPWI, SkyPortal/SkySafari, and the Nunchuck.  Adding a $5 FRAM module to the setup makes it even better.  More about all of that is earlier in this thread.  Use the SEARCH button.


Edited by mlord, 10 May 2024 - 09:46 AM.


#1363 nexStar2008

nexStar2008

    Lift Off

  • -----
  • Posts: 18
  • Joined: 08 Aug 2008

Posted 10 May 2024 - 03:42 PM

I don't understand the question.

 

But to answer what you wrote, the HBG3 has nothing to do with camera rotators, so of course they can coexist just fine together.  No issues.

 

For the Celestron Focus Motor product, the HBG3 actually includes support for using a Nunchuck to adjust focus on the Focus Motor product, much more conveniently than with a Celestron hand-controller or an app.

 

The HBG3 can also act as a Celestron-compatible Focus Motor if one wires in a stepper motor and driver chip (for under $20) to the A,B,C,D pads of the HBG3.  This then acts identically to the Celestron product, including being able to be controlled by CPWI, SkyPortal/SkySafari, and the Nunchuck.  Adding a $5 FRAM module to the setup makes it even better.  More about all of that is earlier in this thread.  Use the SEARCH button.

Apologies, my question was unclear. I already have a focus motor hooked up to my HBG3, I am inquiring whether or not it is possible to also hook up a DIY camera rotator (along with the focus motor), I am assuming will have to use different pins or some way to differentiate between the two. Is there any pins left available that can perform the task? Some way to switch between the selected stepper? I searched and could not find anything regarding this. Thanks
 


Edited by nexStar2008, 10 May 2024 - 03:45 PM.


#1364 tjay

tjay

    Gemini

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

Posted 10 May 2024 - 05:03 PM

It's probably possible to build one, but there isn't any support in the existing software.

 

Apologies, my question was unclear. I already have a focus motor hooked up to my HBG3, I am inquiring whether or not it is possible to also hook up a DIY camera rotator (along with the focus motor), I am assuming will have to use different pins or some way to differentiate between the two. Is there any pins left available that can perform the task? Some way to switch between the selected stepper? I searched and could not find anything regarding this. Thanks
 

You could probably build something, modify the software to drive it, but it definitely not an "out of box" project.



#1365 nexStar2008

nexStar2008

    Lift Off

  • -----
  • Posts: 18
  • Joined: 08 Aug 2008

Posted 10 May 2024 - 05:43 PM

It's probably possible to build one, but there isn't any support in the existing software.

 

You could probably build something, modify the software to drive it, but it definitely not an "out of box" project.

I understand, didn't know if anyone else had done it before or not (would save me some time if so). I don't mind getting my hands dirty :) Any recommendations for a switch of some type that could be triggered by a pin on the ESP32, something like a relay that would enable one stepper over the other depending on the high/low signal from the ESP32. I don't think there is an enable pin on the ULN2003 driver. But perhaps there is a clever way to enable/disable it by removing the ground from one driver (that drives the focus motor) and adding the ground to another driver (that drives the rotator).

Perhaps I should back up a bit and state that I was hoping to use another 28byj48 to function as a rotator, wired in parallel with the focus motor, and a switch of some sort to switch the ground from one motor to the other to provide power depending on the signal from the ESP32 pin. The 28byj 8 may not have enough torque to turn the camera, maybe a nema17 instead, who knows this is all experimental at this point. Thanks for the reply.



#1366 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 31
  • Joined: 27 Nov 2022

Posted 11 May 2024 - 11:53 AM

But perhaps there is a clever way to enable/disable it by removing the ground from one driver (that drives the focus motor) and adding the ground to another driver (that drives the rotator).

I would be extremely reluctant to "remove the ground".  Without actually simulating this, my first thought is that doing so would surely damage the ESP32.

 

Much better would be a data selector IC (74HCT241?), whereby the ABCD inputs are steered to one stepper controller or the other, a simple physical switch selecting between the two.  No change to the code is required .. the HBG need have no knowledge of the switch or this duality; it simply focuses by focusing or rotates by focusing.

 

A small downside to this might be that when switching from one stepper controller to the other, an extra step or two might be introduced if using a "dumb" ULN based controller.  If using a "smart" step and direction controller, extra steps shouldn't occur.  (I don't actually know what kind of steppers the HBG supports, not having paid attention to this.)

 

Hope this helps.


  • mlord likes this

#1367 nexStar2008

nexStar2008

    Lift Off

  • -----
  • Posts: 18
  • Joined: 08 Aug 2008

Posted 11 May 2024 - 02:14 PM

I would be extremely reluctant to "remove the ground".  Without actually simulating this, my first thought is that doing so would surely damage the ESP32.

 

Much better would be a data selector IC (74HCT241?), whereby the ABCD inputs are steered to one stepper controller or the other, a simple physical switch selecting between the two.  No change to the code is required .. the HBG need have no knowledge of the switch or this duality; it simply focuses by focusing or rotates by focusing.

 

A small downside to this might be that when switching from one stepper controller to the other, an extra step or two might be introduced if using a "dumb" ULN based controller.  If using a "smart" step and direction controller, extra steps shouldn't occur.  (I don't actually know what kind of steppers the HBG supports, not having paid attention to this.)

 

Hope this helps.

Thanks for the reply, That seems like it would work as well. I have some leftover A4988 stepper drivers from a 3d printer upgrade that I did a while ago, I am thinking that using these may be the best option as they have a sleep mode and a rst pin that will ignore any steps when pulled low. I could use two of these drivers and the esp32 could signal which driver to enable and switch between the motors that way.



#1368 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 31
  • Joined: 27 Nov 2022

Posted 11 May 2024 - 07:16 PM

I could use two of these drivers and the esp32 could signal which driver to enable and switch between the motors that way.

If others besides yourself are looking for camera rotation, Mark may choose to add that as a feature.  Until/unless he does, your suggestion requires a fork of the code .. written by you ? .. to add the feature.  And when Mark updates the stock code, you'll have to update yours.  And another Mark update ...

 

My way, a 20 cent LS241and a switch (that you'd have to buy anyway) and you can use the stock code unmodified.  And if the A4988 is a step and direction driver, so much the better  as Mark's code appears to support step/dir drivers.

 

There's no need for a reset to prevent unwanted steps.  Indeed, 3 times out of 4 (in full step mode), reset adds a few steps by returning the motor to a particular state.  In half/quarter/micro step mode, the odds are even worse.

 

If the LS241 is not passing signals from the ESP32, there will be no motion.

 

Sleep is good from a power consumption viewpoint BUT a completely unpowered stepper motor has (near) zero holding power.  You might well find the weight of the camera is enough to cause unwanted rotation if there's no power to the motor.

 

A better option, available in many drivers, is a reduced power mode after some inactivity period, typically a second or two.

 

Again, an LS241, a switch, a handful of resistors (possibly even just one, depending on the driver) and ANY version of the code with stepper support and you're good, without any modification to the code.


Edited by alanbc, 11 May 2024 - 07:18 PM.


#1369 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 11 May 2024 - 08:25 PM

Firmware version v8.46 is now available for this project:  Attached File  hbg3.ino.v8.46.txt   318.57KB   16 downloads

  • Use P2000_ACTIVITY_TIMEOUT for MUSB as well as WiFi/BT connections.
  • Increase P2000_ACTIVITY_TIMEOUT to 8 seconds (was 4).  SSAA has been observed taking 5-seconds to respond.
  • Dump SSSWI challenge/response pairs together when verbose=1.
  • ADS1115: Use I2C clock of 800KHz for lower overhead.
  • ADS1115: use 475 SPS, so that a sample can be read in 2.1msec.
  • Increase default oled.timeout.secs to 120 (was 60).

So, that's a BUG FIX for CPWI when using StarSense AutoAlign, and possibly also the same for SkyPortal/SkySafari.  Plus speed-ups for using the external analog-to-digital conversion (ADC) chip (ADS1115) for thermistor readings.  And other more minor stuff.

 

Sources and binaries are now available in all of the usual places, for both this project and for the HomeBrew All-In-One (AIO) project.

 

Go forth and update!



#1370 Bartec

Bartec

    Explorer 1

  • -----
  • Posts: 54
  • Joined: 31 Jan 2022
  • Loc: Russia, Krasnodar

Posted 12 May 2024 - 11:40 AM

Increase default oled.timeout.secs to 120 (was 60).

 

Super!!!!


  • mlord likes this

#1371 Bartec

Bartec

    Explorer 1

  • -----
  • Posts: 54
  • Joined: 31 Jan 2022
  • Loc: Russia, Krasnodar

Posted 16 May 2024 - 02:14 AM

Good afternoon, Mark. I updated to version 8.46b and after the update the screen with GPS data disappeared. Please fix the program.



#1372 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 May 2024 - 05:43 AM

.. the screen with GPS data disappeared.

That must be an issue with your specific unit, as the GPS screen is present and working on the ones I have here.



#1373 Bartec

Bartec

    Explorer 1

  • -----
  • Posts: 54
  • Joined: 31 Jan 2022
  • Loc: Russia, Krasnodar

Posted 16 May 2024 - 07:00 AM

Yes, indeed everything is fine on the other module. And this module froze at 20% during the update and then rebooted. I re-enabled the update and it was successful. But the GPS screen disappeared. Apparently you will have to manually change it through the computer.



#1374 Bartec

Bartec

    Explorer 1

  • -----
  • Posts: 54
  • Joined: 31 Jan 2022
  • Loc: Russia, Krasnodar

Posted 16 May 2024 - 02:46 PM

Yes, indeed everything is fine on the other module. And this module froze at 20% during the update and then rebooted. I re-enabled the update and it was successful. But the GPS screen disappeared. Apparently you will have to manually change it through the computer.

Got it, my mistake. From version 8.20, if the GPS module is not connected, the GPS screen is not displayed.



#1375 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,539
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 May 2024 - 02:57 PM

Yeah, same as with the Focus Motor screen, and Dew Controller screen, etc..  :)




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






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics