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
1940 replies to this topic

#26 dcamp

dcamp

    Sputnik

  • -----
  • Posts: 25
  • Joined: 13 Nov 2022

Posted 15 December 2022 - 09:34 PM

Hey Mark, I got the boards on Monday and finally had a chance to build them up and test them this afternoon.  waytogo.gif Everything worked 1st time.  Very nice board, quite easy to put together.  I chose to socket the ESP32 and the 74HCT125.  It does make the package a bit fatter but I support all kinds of legacy machines at work and having to desolder lots of pins to replace a component always makes me throw 4 letter words toward whoever decided to save a few pennies. bawling.gif I've decided to use a 2 position DIP switch instead of separate switches to keep things cleaner, unless of course you are planning to add additional switchable functions.  Maybe I'll go with a 4 position dip switch just in case.  I'll try to take pictures and post them later tonight or tomorrow morning.

 

I also see that you added support for the nunchuck in the latest firmware - good call, if you decide to order more boards it would be really cool to add that to the board artwork to make it even cleaner.  It would also be cool to add a couple more locations for additional RJ12 jacks for those of us with only one on our mount, possibly incorporating optional artwork for jumpers and components to support the aux relay for those that need it.  It will make the board bigger for sure so maybe a daughter board that can be plugged in like a shield would be a better solution.



#27 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 08:59 AM

Thus far, there hasn't been much interest in the AUX Relay project.  One person has asked for one of my two prototypes, and also the guy who loaned me his NXGPS mount for testing wants one eventually (for StarSense!).  I still think this is a great way to modernize the electronics of the older mounts, making them compatible with apps and easier for sidewalk astronomy.

 

But I probably won't be doing anything special for those now.  They're not hard to cobble together from two of the regular PCBs, though a few changes might make that easier.

 

Speaking of which, the original PCB run has now been completely distributed.  I have one or two left for myself, and that's it for now.  Stay tuned.  smile.gif


Edited by mlord, 16 December 2022 - 09:05 AM.


#28 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 12:39 PM

Since the PCB supply here has run dry, last night I submitted a new order to the factory.  This redesign is now in production, and with luck could be here by this time next week!

 

smd1_pcb_3D_2.jpg

 

The circuit/schematic is exactly the same as before, no change there.  But the board has gotten smaller -- it is now exactly the same footprint as the ESP32 DevKit-V1 module that attaches to it.  For this to happen, the design had to switch to using surface mount devices (SMDs).  But those are _tiny_ and quite difficult for the average DIY person to install, so this time the factory is doing that for us!

 

This means these boards will arrive with all eight resistors, the diode, and the 74HCT125 chip already soldered in place.  Leaving only the DC-converter, the RJ12 jack, and the ESP32 module to be attached, all easy enough for most of us.  The only possible downside is that the ESP32 will mount over top of the SMD components, hiding them from view and making replacement of any of them quite difficult.  Fortunately, I have never had a component failure on any assembled HomeBrew project (except for some of the ProMicro boards when used without DC-Converters).

 

This HomeBrew Gen3a board also has more on-board pads for I2C, and +12V/GND, as well as some extra holes and (hopefully) improved spacing for the two switches.  The layout around where the DC-converter goes has been improved, to accommodate different versions of 5V-output buck converters, including the little black cubes that I favour for breadboard use here.  Everything is also now labelled on the silk-screen layers.

 

smd1_pcb_bottom.jpg smd1_pcb_top.jpg

 

The primary power and ground tracks have gotten much beefier too.  Not a perfect layout, and I wanted another 6-pin header to replicate the RJ12 signals, but space was getting tight by that point.   Anyway, I'm looking forward to seeing how these turn out.  Never ordered a pre-populated board before -- they are about 4X more expensive to produce than the original gen3 boards.  Hopefully they will be okay.

 

Don't you just dig it the way tech moves forward; there's always a new/improved model on the horizon!  blush.gif


Edited by mlord, 16 December 2022 - 11:57 PM.

  • fdboucher likes this

#29 dcamp

dcamp

    Sputnik

  • -----
  • Posts: 25
  • Joined: 13 Nov 2022

Posted 16 December 2022 - 01:43 PM

Here are pictures of my build using the now obsolete 1st run Gen3 PCB. lol.gif   I've socketed the main parts, just because I always socket everything.  My DC-DC converter is also a bit larger than the one's Mark has linked above and didn't fit as well on the other side of the board so I put it between the ESP32 board and the PCB.

 

GEN3[1]
GEN3[2]
GEN3[3]
GEN3[4]
GEN3[5]

Edited by dcamp, 16 December 2022 - 01:43 PM.

  • tjay and mlord like this

#30 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 02:34 PM

Good job, working with the parts on hand too!



#31 scopewizard

scopewizard

    Surveyor 1

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

Posted 16 December 2022 - 09:51 PM

mlord,
 

I got the setup all done , loaded V59 and only selected GPS.

After failing on using CPWI, I disconnected the GPS and everything worked, Client, Server and BT.

When using gps_verbose, I see the gps getting data in the serial, check the wires, all seem to be as it should.

The mount does not detect the gps using CPWI or HC.

I am puzzled on that one.

 

I should have added that when the gps is plugged in nothing works in CPWI, it tries to connect than all fails.


Edited by scopewizard, 16 December 2022 - 09:53 PM.


#32 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 09:56 PM

What is "V59" ?



#33 scopewizard

scopewizard

    Surveyor 1

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

Posted 16 December 2022 - 10:02 PM

What is "V59" ?

Sorry, gen3,  esp32_wifi_V59.ino



#34 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 10:18 PM

You mean v5.9.  There has never been a v59.

 

Okay, I see the bug.  It should work fine from a hand-controller though, once you enable GPS through the Utilities menu on the HC.

 

It definitely crashes in CPWI when accessing the GPS though.  I'll fix that shortly.

 

Thanks!


Edited by mlord, 16 December 2022 - 10:18 PM.


#35 scopewizard

scopewizard

    Surveyor 1

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

Posted 16 December 2022 - 10:40 PM

You mean v5.9.  There has never been a v59.

 

Okay, I see the bug.  It should work fine from a hand-controller though, once you enable GPS through the Utilities menu on the HC.

 

It definitely crashes in CPWI when accessing the GPS though.  I'll fix that shortly.

 

Thanks!

My mistake, I renamed the file so I would know which one I am using. I tried twice with HC and checked utility for GPS to be on, even cycled it off than back on, restart the mount and HC does not wait or see the GPS.

I never use the HC anyway so not an issue.

 

Thanks, I will check for the fix tomorrow.


Edited by scopewizard, 16 December 2022 - 10:41 PM.


#36 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 December 2022 - 11:54 PM

Here is v5.11 of the Arduino ESP32 code for this project.  This version fixes a crash in the GPS code which mainly affects use of a GPS attached to the board when CPWI is used.  If no GPS is attached, then no need to upgrade just yet.

 

Attached File  esp32_wifi.ino.v5.11.txt   72.59KB   102 downloads



#37 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 01:04 AM

Here is v5.11 of the Arduino ESP32 code for this project.  This version fixes a crash in the GPS code which mainly affects use of a GPS attached to the board when CPWI is used.  If no GPS is attached, then no need to upgrade just yet.

 

attachicon.gifesp32_wifi.ino.v5.11.txt

Not totally fixed. I just installed and tested. It works fine on BT but not on wifi.

It opens the alignment window, finds gps but 4 or 5 seconds later, window disappears and CPWI looses connection, same on both wifi client or server mode.


  • Chayko likes this

#38 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 17 December 2022 - 08:47 AM

Not totally fixed. I just installed and tested. It works fine on BT but not on wifi.

It opens the alignment window, finds gps but 4 or 5 seconds later, window disappears and CPWI looses connection, same on both wifi client or server mode.

Try again.  Could be a bug in CPWI.  I saw that here too, and just closed CPWI and tried again.  Worked.



#39 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 09:43 AM

I found the issue.

 

I set CPWI to ignore the Focuser, Starsense and DewHeater, everything work from there.

 

I looked in the codes to see if all these id devices were defined. Found the Dew Heater missing, added to the code, all worked perfectly after.



#40 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 17 December 2022 - 10:11 AM

No, there's more to it.  Definitely a CPWI bug though.  I just spent an hour tracing things, and using the detailed logging in CPWI-2.3.5-beta11.   Sometimes CPWI simply doesn't see the GPS reply if we respond immediately.

 

Most likely because they probably send the request, and THEN flush their input buffer, and then wait for a reply.  Classic programming error.  If the reply arrives too quickly, it gets discarded (or partially discarded) as they flush the input buffer.

 

So.. here is the Arduino ESP32 source code, now version 5.12:

  • CPWI-2.3.5-beta11 doesn't like fast GPS replies, so slow them down.
  • Improve WiFi connect reliability in client mode.

That fixes it for me here about nine times in ten.  CPWI-2.4.2 seems to work regardless.

 

Also included is a workaround for an issue I noted where WiFi Client mode (home network) doesn't always work after a code download -- seemed to need a hard reset before it would work.  Workaround is to always start up in Server mode, and then switch to Client mode.  Reliable now.  smile.gif   That would be a bug in the ESP32 support layers.

 

Attached File  esp32_wifi.ino.v5.12.txt   73.06KB   76 downloads

 

Cheers

Mark


Edited by mlord, 17 December 2022 - 10:30 AM.


#41 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 11:16 AM

No, there's more to it.  Definitely a CPWI bug though.  I just spent an hour tracing things, and using the detailed logging in CPWI-2.3.5-beta11.   Sometimes CPWI simply doesn't see the GPS reply if we respond immediately.

 

Most likely because they probably send the request, and THEN flush their input buffer, and then wait for a reply.  Classic programming error.  If the reply arrives too quickly, it gets discarded (or partially discarded) as they flush the input buffer.

 

So.. here is the Arduino ESP32 source code, now version 5.12:

  • CPWI-2.3.5-beta11 doesn't like fast GPS replies, so slow them down.
  • Improve WiFi connect reliability in client mode.

I agree with the timing issue. It crossed my mind when sometimes it works, sometimes not.

 

So far the 5.12 version seems to work.

 

Thanks

 

BTW, I found out that my GPS 220, maybe others,  requires 4 satellites to lock lat and long positions.

I changed the code to test this. It worked fine so it could be an other way to see if gps is valid.

 

static bool gps_fix_is_valid()
{
  if (!gps_is_on)
    return false;
  return gps.satellites.value() > 3;
}



#42 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 11:30 AM

Here my final setup.

 

The gps is tilted as the unit attaches to the leg of my tripod.

 

 

Attached Thumbnails

  • MyDIY.jpg

  • fdboucher and CraigB1960 like this

#43 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 17 December 2022 - 12:20 PM

Tripod leg???  Cord-Wrap!!

 

Cannot base gps_fix_is_valid() on the satellite count, because even with four sats it could still be returning no location data for a minute or two.

 

btw.  4-sats is the minimum for a "3D" fix.

 

-ml


Edited by mlord, 17 December 2022 - 12:21 PM.


#44 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 02:00 PM

Tripod leg???  Cord-Wrap!!

 

Cannot base gps_fix_is_valid() on the satellite count, because even with four sats it could still be returning no location data for a minute or two.

 

btw.  4-sats is the minimum for a "3D" fix.

 

-ml

No. This is not satellites in view but lock (strong enough signal) by the gps for data. It takes 3 only to get Lat and Long while the 4th provides clock sync and get ground elevation.

You can have dozen of satellites in view and not get a lock due to weak signals.

 

No Cord wrap with a CGX, aux port (2) are not on any moving axis.


Edited by scopewizard, 17 December 2022 - 02:01 PM.


#45 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 17 December 2022 - 02:22 PM

Cannot base gps_fix_is_valid() on the satellite count, because even with four sats it could still be returning no location data for a minute or two.

Still applies.

 

There might be a GPS setting that could be changed to tell it to return Location data even without a 3D fix.  Dunno.



#46 scopewizard

scopewizard

    Surveyor 1

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

Posted 17 December 2022 - 03:17 PM

Still applies.

 

There might be a GPS setting that could be changed to tell it to return Location data even without a 3D fix.  Dunno.

It is possible if you have your own very accurate clock. These little GPS do not have a clock.

In the 90, we used to sync our gps with the Atomic clock Norad to triangle using only 3 satellites ( not very accurate) but today it is not needed if you use 4 satellites. 

Lots of info on line about this. If I remember right, the military band which was freed up years ago, carry the gps sync clock time negating the need for a internal clock.

This is why 3 for position data (on one band) and one for clock on the other band. Basically, without time you can not calculate your position.



#47 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 18 December 2022 - 07:54 AM

The redesign is now in production, and with luck could be here by this time next week!

It looks like the new partially assembled boards will be here on Tuesday, or Wednesday at the latest.  Which means some of them could be distributed before Christmas!  I didn't get the silk-screen printing quite right on them, but good enough for purpose.

 

HomeBrew_Gen3a_1_PCB_3D.jpg

 

These boards come with the eight resistors, the diode, and the 74HCT125 chip already soldered in place, as surface mount devices (SMDs) on the flip side.  To complete the assembly, one has to solder on a 3-pin DC-Converter module, a 6-pin RJ12 jack or cable, and the 30-pin ESP32 DevKit-V1 module -- about $10 for those three parts from various sources.  Then flash the firmware, and it should work!

 

Not all of the boards have been spoken for yet.  Get in touch if you want one.

 

Cheers

Mark


  • tjay, fdboucher and arturo1 like this

#48 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 7,454
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 19 December 2022 - 12:58 PM

aux_if_top.jpg aux_if_bottom.jpg

 

I've created a PCB design for a Standalone AUX Bus Interface with two jacks ("built-in splitter").  This board is suitable for direct connection to a Raspberry-Pi, ESP32, RTL8720DN (5Ghz WiFi), any type of Arduino board, etc.  Or even to the HomeBrew Gen3 boards to create an AUX Bus Relay for older mounts.

 

It uses the same basic circuit as the HomeBrew Gen3 and All-In-One projects, with the 74HCT125 interface chip, eight resistors, and a 1N5817 diode, all pre-soldered by the factory.  Add one or two RJ12 jacks and connect it to the processor board of one's choice.  It can supply 5V power from the AUX bus via an optional DC-converter, or be provided with 5V from the processor board.

 

The question is, who else (other than I) might want some of them?

They don't exist yet, other than as CAD files.


Edited by mlord, 19 December 2022 - 10:44 PM.


#49 outofdark

outofdark

    Vostok 1

  • -----
  • Posts: 197
  • Joined: 04 Aug 2018
  • Loc: SLC

Posted 19 December 2022 - 11:13 PM

attachicon.gifaux_if_top.jpgattachicon.gifaux_if_bottom.jpg

 

I've created a PCB design for a Standalone AUX Bus Interface with two jacks ("built-in splitter").  This board is suitable for direct connection to a Raspberry-Pi, ESP32, RTL8720DN (5Ghz WiFi), any type of Arduino board, etc.  Or even to the HomeBrew Gen3 boards to create an AUX Bus Relay for older mounts.

 

It uses the same basic circuit as the HomeBrew Gen3 and All-In-One projects, with the 74HCT125 interface chip, eight resistors, and a 1N5817 diode, all pre-soldered by the factory.  Add one or two RJ12 jacks and connect it to the processor board of one's choice.  It can supply 5V power from the AUX bus via an optional DC-converter, or be provided with 5V from the processor board.

 

The question is, who else (other than I) might want some of them?

They don't exist yet, other than as CAD files.

Ttl serial to a raspberrypi? Is there a matching schematic?



#50 Bartec

Bartec

    Explorer 1

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

Posted 20 December 2022 - 06:15 AM

attachicon.gifaux_if_top.jpgattachicon.gifaux_if_bottom.jpg

 

I've created a PCB design for a Standalone AUX Bus Interface with two jacks ("built-in splitter").  This board is suitable for direct connection to a Raspberry-Pi, ESP32, RTL8720DN (5Ghz WiFi), any type of Arduino board, etc.  Or even to the HomeBrew Gen3 boards to create an AUX Bus Relay for older mounts.

 

It uses the same basic circuit as the HomeBrew Gen3 and All-In-One projects, with the 74HCT125 interface chip, eight resistors, and a 1N5817 diode, all pre-soldered by the factory.  Add one or two RJ12 jacks and connect it to the processor board of one's choice.  It can supply 5V power from the AUX bus via an optional DC-converter, or be provided with 5V from the processor board.

 

The question is, who else (other than I) might want some of them?

They don't exist yet, other than as CAD files.

Good day. You can see the electrical circuit diagram for a complete understanding.




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