jgyates / genmon

Generac (and other models) Generator Monitoring using a Raspberry Pi and WiFi
GNU General Public License v2.0
381 stars 78 forks source link

Non-Issue - Build Variation - PI Zero W with MAX3232 board #31

Closed madisdev closed 5 years ago

madisdev commented 7 years ago

Hey Guys,

So i finally got around to putting the box in the generator and it looks like all is working smoothly. I just wanted to show off my build a little bit to show how I used some different components.

This isn't going to be as cool as some other builds, I don't have a full home automation system or a fiber to serial link ;)

So I decided to use a PI Zero W as I can pick them up cheap at my local Microcenter(10$ each). I also choose to use a MAX3232 board as I didn't want to use a DB-9 as it seemed a little redundant, Considering the DB9 boards use the same chip.

I picked up a waterproof enclosure on ebay and added some rubber cable seals to it. I did a little soldering and wire crimping for the connectors. Other than that nothing too crazy. I am pulling power from the generator off pins 1&2.

Thanks again to Jason for the great work he puts into this project. And everyone else that has contributed.

Here is a pic before I hot glued the PI Zero down and sealed everything up. I'm not sure if heat is going to be an issue off the PI Zero, but its something ill monitor. Cables on the left are TX/RX and on the right is Power/Ground. I'm powering PI using pins 2(5v) and 6(Ground) And connector to MAX3232 are pins 4,6,8,10 are 5v, Ground,TX and RX respectively.

Parts list after the pic :)

pizerowenclosure

Enclosure http://www.ebay.com/itm/NEW-waterproof-Plastic-Project-Box-Enclosure-DIY-100x68x50mm-L-W-H-/151799269041?hash=item2357f106b1

Cable Gland PG7 Black Nylon Waterproof Cable Connect Cord Grip Cable Gland 3-6.5mm US

MAX3232 Board http://www.ebay.com/itm/2PCS-MAX3232-MAX3232CSE-Serial-Port-Mini-RS232-to-TTL-Converter-Adaptor-Module-/222084117081?hash=item33b53eb259

proppilot commented 6 years ago

Got it ! Here are the parts. All from Amazon (prices are in CAD as I am up North) and the box is from Home Depot

box antennas buck converter rs232 canakit

Some details. I bought the CanaKit as it had everything needed to get going including the 32 Gb data card which was preloaded and enabled super easy startup and configuration.

The buck converter converts 12 volts from the battery to 5 volts for the Pi.

(soldering skills needed) I removed the wifi chip antenna from the Pi 3 and cut the end off the antenna connector/cable that came with the antennas and soldered it in place. I little bit of 5 minute epoxy seals it up nicely and the connector end was mounted through a hole in the box. I put it on top and ended up having to seal it all up with epoxy and if doing it again would put it on the side and flip the antenna 90 degrees as it has that ability built in. I bought two sets a) in case I screwed up and b) to build a second unit for my buddy who has a 22 kW Synergy.

The RS232 converter is per the jgyates project description as well as the molex connectors and pins. If you can solder, don't buy a crimper for such a small project. Two pins...done and done...

Knowing what I do now about the hardware configuration, I could build it for about $ 100 USD.

As for mounting everything, 3M double sided tape from home depot. It is sticky so you only need a couple of small pads to mount the power converter and the RS232 converter. The CanaKit came with a really nice case so I used the bottom of the case which I attached to the box with the 3M tape and then popped the Pi into it and secured it in place with the white nylon screw you see coming through the side of the box. It just snugs over the USB connector and keeps the board in place. Easy removal of the Pi if needed.

Four wire cable (two for the serial bus and two for power) with an inline 2 amp fuse connector. I soldered banana clips to the end of the power leads and clipped them to the battery lugs. As the box is held to the generator with outdoor velcro, I can remove any trace of the unit in under five minutes if my maintenance guy needed to show up. The only evidence would be the removal of the little sticker that was covering the connector under the Evolution controller.

As my unit came with a bumper to bumper 10 year parts and labour warranty ( a September special to drive sales just before the hurricane hit PR and FL - then it disappeared ) I want to keep it as sterile as possible to prevent any potential warranty conflict.

Thats about all I can think of.

proppilot commented 6 years ago

PS I added a small 3/16" drain hole in the bottom of the enclosure as mine is outdoors. As I opened and closed the box a number of times while figuring out the fit and finish, the gasket deformed a bit and I got some water in the box that accumulated at the bottom. As the project is done, I put a light bead of silicone around the gasket before sealing it up and the drain hole in the bottom just in case. I think it is good to go.

I added the code from @krisasmith to a sh script that runs on boot so hopefully my disconnect issues are history.

It is sad when projects are done as the learning is quite fun !

kalex1114 commented 6 years ago

@proppilot Thank you Tony. So you used power from the battery not from controller. Nice warranty. I think i got mine with 7 year coverage. That was the special when i installed it. Not 100% sure if labor is included though. Don't remember

I have mobile link now and i'm thinking of reusing the openning for Pi 3 wiring since i already have the hole in there

proppilot commented 6 years ago

Hi Kalex, yes I took power through a fuse from the battery. My concern was any damage to the GenMon ie water ingress (who knows in a Canadian winter) causing a short could perhaps damage the controller if I was taking power from Port 1 (Evolution controller port). It is a nice solution to get +5v from Port 1 but....

madisdev commented 6 years ago

@proppilot Please don't take this the wrong way, you have a nice build. I just had some comments on your build. It sounds a little concerning that you had water accumulate in your work box. :( I opted to use a waterproof work box(see link in first post), even though mine is installed in the Generator enclosure. I understand some people feel more comfortable installing the box on the outside of the generator. I would just suggest that if people go that route to make sure the box is made for the external environment, I.E. water and temperature changes. And also that it can withstand and impacts from branches heavy snow ect. And I would be careful on how you route your wires to the internal of the generator. Not sure I would mix gas and electric in one opening :|

Since I went the internal install method I just needed to install the antenna on the outside of the enclosure. I used the spot the mobile link would be installed for the antenna and installed the workbox under the control board. I mounted it with double-sided foam tape, but would probably use Velcro if I need to remove it in the future. All components can be installed and removed in a short amount of time.

I got inspired to add the external antenna after a link was posted by @jgyates in a different thread, data alliance has good products with decent prices. The PI Zero W does not come with a antenna connector, so I had to solder on one myself. Going forward I think the Orange PI line of PI's would be a better option as the ones I was looking at have external antenna connectors. I found after installing the external antenna that my wifi strength increased enough to keep a constant connection.

Some pics. View of workbox installed below the main board. 3 View of the external antenna from inside enclosure with wire routed back to workbox. 1 Outside view of antenna connector, this will allow installation of many different types of antennas since its a common connector. 2

proppilot commented 6 years ago

@madisdev no offence taken at all. The enclosure is definitely an outdoor electrical box.

The issue was that the compression gasket failed because I opened the lid probably too many times as I was experimenting. No way it would happen if the box was only sealed once or twice. I suspect that the gasket compressed one way and I likely rotated the lid during the process. I was pretty shocked to see some water in the enclosure and not positive if it came through the gasket or through the antenna connector. It may have been the antenna connector as I only had it screwed through the hole and not sealed from the inside in case I needed to modify or move it.

As for the cable, I came in through the gland at the back (I see a peek of your gas pipe) where the gas pipe enters and therefore the cable stays in the safe wiring area where all the low voltage wires are. That is a big hole with the rubber filler and allows the cable with connectors to easily get in and out.

I definitely like your install. For me, I did not want to leave any traces if I needed to remove it however yours looks 100% stock OEM :-)

USAFPride commented 6 years ago

@proppilot, did the wifi script solve your connection issues?

jgyates commented 6 years ago

@USAFPride, the wifi script helped me out. I was having some random disconnect issues but now they are gone. Thanks!

proppilot commented 6 years ago

Absolutely. Up 12 days straight with zero issues

Regards,

Tony Varga

Sent from my mobile device

On Dec 9, 2017, at 1:39 AM, USAFPride notifications@github.com wrote:

@proppilot, did the wifi script solve your connection issues?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

USAFPride commented 6 years ago

All:

I've found a better script to use for resetting the wifi AND it will reboot after 5 (configurable) failed attempts of not making a connection. I'll probably modify it to force the ifup/down on every try and after x attempts, then to issue a reboot.

Reboot

kalex1114 commented 6 years ago

so I finally got all the parts and attempted to solder the mini max3232 board with the wires i need. Wow its tiny and very hard to work with.
Here is what my abomination looks like :) screenshot 2017-12-28 15 57 47

Oh ye and i managed to burn my finger too. But its expected. I think i need to get a bigger board or use @krisasmith method.

Any soldering tips are appreciated :)

USAFPride commented 6 years ago

@kalex1114, first "tin" the pads (put solder on the pads). Then tin the wire. Then lay the wire on the pad and heat the tinned wire. It should melt both the solder in the wire and the pad quickly and then take the heat off quickly.

kalex1114 commented 6 years ago

@USAFPride ah thank you for the tips. I'll try it. What temp should the solder be at? is 350c enough ?

USAFPride commented 6 years ago

@kalex1114 - Just hot enough to melt the solder quickly, but not so hot that is vaporizes :)

JustApu commented 6 years ago

@madisdev Any chance your https://github.com/jgyates/genmon/issues/31#issuecomment-345830037 picture has the Pi Zero pins 4 & 6 reversed? I added some color since my old eyes needed help but I'm not sure if the power is reversed intentionally or not. (The pi4j.com link shows 4=5VDC and 6=Ground.)

generac to rpi

madisdev commented 6 years ago

Yes it looks like I reversed them. Good catch.

On Mar 19, 2018, at 9:02 PM, JustApu notifications@github.com wrote:

@madisdev Any chance your #31 (comment) picture has the Pi Zero pins 4 & 6 reversed? I added some color since my old eyes needed help but I'm not sure if the power is reversed intentionally or not. (The pi4j.com link shows 4=5VDC and 6=Ground.)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JustApu commented 6 years ago

Thanks, @madisdev. Updated image in case anyone refers to this in the future: generac to rpi

Just found this project today and I'm definitely going to implement it as I've wanted monitoring for years but couldn't justify the recurring costs of the commercial products. First hurdle will be getting a good network connection to the generator (~50 ft. from the house, and no existing network connection in that area).

Has anyone used ATX 8-pin power extension cables for plugging into the Nexus controller? Seems like a cheap option compared to buying the Molex connector, pins and assembling it all.

madisdev commented 6 years ago

@JustApu I was going to cannibalize a cable similar to that but ended up just buying some molex connectors. I don't see why it shouldn't work, for a dollar you cant go wrong. Just might need to splice an extension cable depending on where you mount the box.

jgyates commented 6 years ago

I just replaced my cable about an hour ago with the ATX-8 cables. I plugged 4 of them together. Works great. I got mine from amazon, but the ebay link you provided they are much cheaper.

kalex1114 commented 6 years ago

@jgyates do you have pictures of what it looks like now with atx-8?

jgyates commented 6 years ago

@kalex1114 , I did not take a new photo (my old photos are in the Diagrams directory of the repository , it was dark when I replaced the cable and my generator is a large liquid cooled model and the place I mounted is beside the controller so I have to take 6 bolts off to get inside the controller side of the generator enclosure. I used the molex connectors before on both sides of my cable (male and female) to the atx-8 was a drop in replacement for me. I will take a new pic the next time I open the enclosure

I will say that for folks like me who are not so mechanically inclined, the molex is a better way to go to minimize the hand crimping involved. I has getting CRC errors with my cable at times when the generator started, which I thought was due to EMI, but it is actually vibration. ATX preassembled connectors were much better than my attempt at crimping my on connector. No more CRC errors.

proppilot commented 6 years ago

What are the options to use a Pi Zero or a Pi 3 with an external USB wifi dongle ? I am running a Pi 3 that I modified to add an external antenna. I have tried various scripts for doing a wlan restart when there is a disconnect with various success but not 100%. I have had it run up to 21 days with connectivity and the odd 'wlan0 restarted' but ultimately it will disconnect and I need to hit the restart button I have on the bottom of the box. I added it to eliminate having to pull the alligator clip off the battery. Either my Pi 3 is flaky or I am not sure. I am looking to just replicate the hardware with a new Pi and the same methodology for adding the external antenna however other options are 1) adding an external USB dongle or using a Pi zero for a cheaper solution and I believe a USB dongle is needed. Any thoughts/other options people have used that does not require modification of the code posted here ? What do I need to do to use an external USB dongle on the Pi 3 ? Turn off the on board wifi I assume ? Just looking for thoughts and options before I go into version 2.0 of this project. It has been very useful so i want to make it as robust as possible

jgyates commented 6 years ago

I have never used the PiZero.

What is your signal strength? You can get this by the "iwconfig wlan0" command. Looks the output labeled "Signal Level" and compare it to the table on this page. Also look at s"Signal Quality" in the output. This is the rating of the usability of the wifi signal. Due to bouncing signals or crosstalk you could have a strong signal but but low signal quality, in which case an external antenna may help.

https://www.metageek.com/training/resources/wifi-signal-strength-basics.html

I have used USB wifi with an external antenna and built in wifi.. For me it works as well as the internal one with no antenna, which is odd considering the pi is inside an aluminum enclosure and the antenna is not, but, but there are many, many factors that go into play with signal strength and quality. The pi has a pretty good antenna design, but when you put it in a metal box things can get complex with the wifi.

For a while I ran the USB wifi along with the built in. If one could not get a connection I would login to the other, turns out I had another network issue that was complicating things. It may be useful to look at your access point as well. I eventually ran an ethernet cable. My generator is just a little far and it keeps the wifi signal on the edge of being usable.

proppilot commented 6 years ago

Signal level is -72 dBm Link quality is 37/70 Tx power is 31 dBm

so... according to the chart it is just slightly worse than OKAY

Fishing a cable would involve cutting drywall and drilling through brick so it is an option but not a great option

hokie21 commented 6 years ago

Here are pictures of my RPI Zero W build. I'm taking 5 volts from the Nexus wireless monitor connector. I've connected the 3.3 volt output on the RPI to power the TTL to RS232 board. I had purchased some of those cheap TTL-RS232 converters from Amazon/China, but all were DOA. I ended up buying the Sparkfun board for 10x the cost of the Chinese ones. I tied the unused TTL input to the one I am actually using so it won't float. My wifi signals seem to be OK (-68 dbm at the AP, -67 dbm at the RPI) with the cover on the Generac 5875 locked down. The enclosure is a Radio Shack 270-221 (4-5/16 x 2-3/8 x 1-3/16) left over from the parts box. I had planned to hold the RPI using threaded stand-offs, but the box was not deep enough for the wire connectors, so I went with foam mirror mounting tape to keep the PC boards from moving around.

I sort of freaked out when I saw that the wire colors used by the wireless monitor harness I removed when installing this were exactly opposite my color usage. Generac used red and black for the signal wires to the remote monitor radio and green and white for power and ground. I used red and black for the power and ground and green and white for signal. After checking that power and ground were correct with my voltmeter, I powered it up and it worked fine.

I purchased the Minifit-JR crimp tool from Amazon and it did a great job. This was my first time using it.

image

image

dennis48755 commented 6 years ago

@madisdev Where did you connect (solder) the external antenna to the Pi Zero W?

Do you have a picture of this connection?

Dennis

madisdev commented 6 years ago

Here is the article I used. I really wouldn't suggest it to anyone, I had a really hard time doing this. It micro soldering.

I was going to try using an Orange PI as it has an external connector, but the one I ordered on ebay was DOA.

dennis48755 commented 6 years ago

Thanks @madisdev, I did come across that article while Googling, good to know it works.

Dennis

proppilot commented 6 years ago

I had replaced the onboard wifi antenna on my Pi3 with a cable with pigtails soldered in place out to the SMA connector. The connection seemed okay but would never last longer than a few days and even the script to restart the wifi was not working properly so I went to the $ 12 external USB wifi dongle with a jumper coax between the dongle and the box and then an external wifi antenna on the box.

Much stronger signal/connection and seems to be hanging. To keep the theme, I remounted everything in a Generac polycarbonate box (cheap on eBay) that had a bypass relay in it and mounted the LEDs on the front. Looks great. (seems to) work great.

danorum commented 6 years ago

I was planning to build this with a Raspberry Pi 3 and wire it back to my ethernet switch. However, the size of the zero looks interesting to me (power from the port, smaller enclosure, etc. I had a couple of questions.

  1. If I use a USB ethernet adapter, should the pi zero still have low enough power consumption to get power from the controller?
  2. Those of you using the mini RS232 TTL boards, why did you run the power to the pi instead of running all 4 wires to the RS232 board and then power the pi using the pass through pads for power?
JustApu commented 6 years ago

@danorum - I have a variety of Raspberry Pi's (most 2s & 3s though one 2012 Model B) doing everything from streaming public safety radios to the Internet to monitoring my home's environment and utility meters. That said, for genmon, a Pi Zero W was my Pi of choice due to the size and low power requirements.

I'm using the MAX3232 for connection to the generator and powering my Pi via the generator controller, not a separate power supply (36 kW generator with the Nexus controller). I've had no power issues. My WiFi signal is okay on most days but drops out in weather but that will improve as soon as I get a directional AP pointed towards the generator.

madisdev commented 6 years ago

@danorum In regards to #2 I'm not an electrical engineer, so wasn't really sure about how todo that. Have you tested that method out?

danorum commented 6 years ago

@madisdev I have not, but plan to. I am not sure it makes a ton of difference, but when I was looking at these TTL boards, one of the descriptions said the pads on both ends were connected. I would have 4 wires from the connector to the TTL board and 4 wires from the TTL board to the Pi Zero.

hokie21 commented 6 years ago
  1. I measured a Gbit USB dongle and found it takes 130 mA. I think you'll probably be ok powering this from the Generac, but you'll need to try it out to be sure.

  2. I ran power to the PI and the had the PI power the RS232 board because the power from the Generac is 5 volts and I wanted the RS-232 board powered of the PI's 3.3 volt regulator. It seems most folks are running 5 volts into the RS-232 board, but when you do this the RS-232 board is putting out 5 volt TTL into a PI that is expected 3.3 volt TTL. Nobody seems to be reporting any issues with this, but giving 3.3 volt TTL to a port that was expecting 3.3 volt TTL seemed like a good choice.

danorum commented 6 years ago

@hokie21 - #2 that 3.3 volt input is the piece I was forgetting. Looks like all my parts will be here tomorrow, so I have a project for this weekend.

jonathanpisarczyk commented 6 years ago

@hokie21 can you provide a picture of your setup or a diagram? I don't quite follow the 3.3 volt to TTL.

hokie21 commented 6 years ago

My diagram is identical to the one earlier in this thread. The only difference is I took 3.3v power from the 3.3v pin (pin 1) on the RPI header and used this to power the RS232 board.

danorum commented 6 years ago

I wanted to follow up. I was powering my Pi Zero (with USB ethernet dongle) from the molex connector. When I plugged in the monitor to the generator, the LCD display went blank. I had to reset the controller to get the display back. This reproduced 100% for me. I pulled the red pin from the molex connector and used an external power supply. (I kept the black wire connected to have a common ground.) In this configuration, genmon works AND the LCD stays on. It looks like I need to use the battery power supply instead of the controller molex to supply power to the Pi.

jgyates commented 6 years ago

According to the data sheet for the max3232 it will accept either 3.3V or 5V as the power source.

http://www.ti.com/lit/ds/symlink/max3232.pdf

hokie21 commented 6 years ago

Agreed. The max3232 can be powered from either 3.3 or 5V. The voltage used to power the max3232 will set the voltage seen by the PI on the RXD signal line from the max3232 to the PI. GPIO input voltages that exceed the PI's Vcc aren't a good idea. This reference says that there is no overvoltage protection on the RPI GPIO inputs.

jgyates commented 6 years ago

@hokie21 , you are likely correct that 3.3V is ideal. I have been using the same pi with the TTL powered at 5V since November 2016, but you way is safer to be sure. I will change this on my pi the next time I have it opened up. I will also make a note in the wiki. Thanks

krisasmith commented 6 years ago

I switched my max232 board to GPIO pin 1 (3.3v) today without any issues. Seems to work just fine.

kalex1114 commented 6 years ago

@proppilot Tony - now that i got my pi and genmon working I want to get the LEDs as well. Did you use breadboard for your led setup?

proppilot commented 6 years ago

No, I used the spare leads that came with my max232 board and hard soldered to the resistors and LEDs.

Regards,

Tony Varga

Sent from my mobile device

On May 31, 2018, at 9:05 PM, kalex1114 notifications@github.com wrote:

@proppilot Tony - now that i got my pi and genmon working I want to get the LEDs as well. Did you use breadboard for your led setup?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lwbeam commented 3 years ago

I thought I'd share my experience building the monitor using a RPi 3b+. I wanted it to: (a) be contained entirely within its own water-proof enclosure, (b) allow easy access to the SD card and USB/Ethernet ports, and (c) be connected to my network via Ethernet.

To get everything to fit into the enclosure I'd chosen, I had to deviate significantly from the suggested parts list. I initially tried an inexpensive DC-DC buck converter module, that purportedly supplied 5A @ 5V, and a MAX3232-based RS232 to TTL converter module. Both were purchased via ebay. The DC-DC buck converter worked perfectly, and thus far I haven't experienced any under-voltage conditions. Unfortunately, I couldn't get the MAX3232 module to work at all, even after several attempts with two different batches of modules. Eventually I gave up and purchased a SparkFun SP3232-based breakout board from DigiKey, which worked perfectly on the first attempt.

To allow easy access to the SD card and USB/Ethernet ports, I attached the RPi to the lid of the enclosure, with the top side of the RPi facing the inside of the lid. I used standoffs that were sufficiently long to position the RPi circuit board just proud of the lip of the lid. This configuration required less room to access the SD card, which could then be left for access to the USB/Ethernet ports. Furthermore, this left almost the entire interior and sides of the actual enclosure to mount the remaining components and route wires/cables.

As the DC-DC buck converter had no electrical protection of its own, I installed a suitably rated fuse in the 12V supply to the module. I chose a 1.5A, fast-acting, 5mm x 20mm fuse. The fuse and matching panel mounted holder were purchased from a local electronics surplus/hobby shop. This arrangement also provides easy access to the fuse, so that it can be removed to power down the unit when required, without the need for a separate switch.

Finally, I also wanted to be able to locally shutdown/restart the RPi, without access to a phone, tablet or computer. To do this, I installed a normally-open pushbutton between GPIO pin 3 and ground, and added the required firmware overlay to the /boot/config.txt file. For more information on this, see the RPi firmware documentation.

photo1 photo2

I'm still not completely happy with the Ethernet arrangement, as the RJ45 modular plug isn't crimped that securely to the very stiff, weather-proof Cat5e cable that I've run into the generator enclosure. When I have time, I'd like to move the RJ45 panel mount connector to its own small project box, and run a longer, flexible Cat5e cable to it through a second cable gland in the monitor enclosure.

I'm also looking at improving the power connection at the battery terminals. Currently I'm using crimp ring connectors, which would be fine if the battery charger wasn't also connected to the battery in the same manner. It's hard enough ensuring that the battery terminals are secure, without two additional sets of wires hanging off the bolts.

Finally, I'd like to install a connector in the RS232/power cable, so I can disconnect and remove the entire monitor enclosure, without messing with the battery terminals and removing the controller.

Parts List Enclosure DC-DC Buck Converter Module SparkFun SP3232 Breakout Board RJ45 Panel Mount Connector Pushbutton Panel Mounted Fuse Holder 1.5A Fast Acting Fuse

jgyates commented 3 years ago

Very nice setup. Thanks for the details and links.

smeisner commented 3 years ago

Thank you for the detailed information. I just ordered the items you mention in your parts list to replace the RPi Zero W running Genmon I've been using for many years now with a RPi 3. The only change I'm planning is instead of an RJ45 port, I am adding a panel mount USB 2.0 jack to connect to a USB Wifi adapter. It works well when placed inside the original Genrac wireless board container on the rear of the genset.

Some of the parts are on backorder, so it'll be multiple weeks before I get it all set up. But can you share more detail with the wiring you implemented? I think I can figure it out, but it'll be easier if you have a schematic to share.

Thanks, Steve

On Wed, Dec 16, 2020 at 6:33 PM lwbeam notifications@github.com wrote:

I thought I'd share my experience building the monitor using a RPi 3b+. I wanted it to: (a) be contained entirely within its own water-proof enclosure, (b) allow easy access to the SD card and USB/Ethernet ports, and (c) be connected to my network via Ethernet.

To get everything to fit into the enclosure I'd chosen, I had to deviate significantly from the suggested parts list. I initially tried an inexpensive DC-DC buck converter module, that purportedly supplied 5A @ 5V, and a MAX3232-based RS232 to TTL converter module. Both were purchased via ebay. The DC-DC buck converter worked perfectly, and thus far I haven't experienced any under-voltage conditions. Unfortunately, I couldn't get the MAX3232 module to work at all, even after several attempts with two different batches of modules. Eventually I gave up and purchased a SparkFun SP3232-based breakout board, which worked perfectly on the first attempt.

To allow easy access to the SD card and USB/Ethernet ports, I attached the RPi to the lid of the enclosure, with the top side of the RPi facing the inside of the lid. I used standoffs that were sufficiently long to position the RPi circuit board just proud of the lip of the lid. This configuration required less room to access the SD card, which could then be left for access to the USB/Ethernet ports. Furthermore, this left almost the entire interior and sides of the actual enclosure to mount the remaining components and route wires/cables.

As the DC-DC buck converter had no electrical protection of its own, I installed a suitably-rated fuse in the 12V supply to the module. I chose a 1.5A, fast-acting, 5mm x 20mm fuse. The fuse and matching panel mounted holder were purchased from a local electronics surplus/hobby shop. This arrangement also provides easy access to the fuse, so that it can be removed to power down the unit when required, without the need for a separate switch.

Finally, I also wanted to be able to locally shutdown/restart the RPi, without access to a phone, tablet or computer. To do this, I installed a normally-open pushbutton between GPIO pin 3 and ground, and added the required firmware overlay to the /boot/config.txt file. For more information on this, see the RPi firmware documentation https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README#L900 .

[image: photo1] https://user-images.githubusercontent.com/56894809/102417696-303a4180-3fca-11eb-8f7c-7e8b0b953b07.jpg [image: photo2] https://user-images.githubusercontent.com/56894809/102417884-9f179a80-3fca-11eb-8781-2ac80c659e54.jpg

I'm still not completely happy with the Ethernet arrangement, as the RJ45 modular plug isn't crimped that securely to the very stiff, weather-proof Cat5e cable that I've run into the generator enclosure. When I have time, I'd like to move the RJ45 panel mount connector to its own small project box, and run a longer, flexible Cat5e cable to it through a second cable gland in the monitor enclosure.

I'm also looking at improving the power connection at the battery terminals. Currently I'm using crimp ring connectors, which would be fine if the battery charger wasn't also connected to the battery in the same manner. It's hard enough ensuring that the battery terminals are secure, without two additional sets of wires hanging off the bolts.

Finally, I'd like to install a connector in the RS232/power cable, so I can disconnect and remove the entire monitor enclosure, without messing with the battery terminals and removing the controller.

Parts List Enclosure https://www.amazon.ca/gp/product/B005T9HMQW/ DC-DC Buck Converter Module https://www.ebay.ca/itm/DC-DC-Step-Down-Buck-Converter-Power-Supply-Module-24V-12V-9V-to-5V-5A-25W-MF/172358062967/ SparkFun SP3232 Breakout Board https://www.digikey.ca/en/products/detail/BOB-11189/1568-1193-ND/5673779/ RJ45 Panel Mount Connector https://www.amazon.ca/gp/product/B00R3B0BP8/ Pushbutton https://www.amazon.ca/gp/product/B07RV1D98T/ Panel Mounted Fuse Holder https://www.amazon.ca/gp/product/B08FRCM47N/ 1.5A Fast Acting Fuse https://www.amazon.ca/gp/product/B07HC3MNVM/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jgyates/genmon/issues/31#issuecomment-747104229, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVHM3AWWADBB7J3JCBHW73SVE7URANCNFSM4DROXB2Q .

lwbeam commented 3 years ago

@smeisner Hopefully this diagram and additional information helps. I'm also happy to answer any questions you might have. GenMon Wiring Diagram The wire colour coding in the diagram is the same as that used during construction. I used 18 AWG, 4-conductor speaker wire to connect the battery and controller to the monitor. All other wire is 24 AWG. Rightly or wrongly, I was concerned about the voltage drop on the 24 AWG wire between the DC-DC buck converter module and the RPi, so I connected two GPIO 5V pins directly to the buck converter, and two GPIO ground pins to the common ground connection (really ugly soldered butt joint, hidden by some shrink tubing).

The positive terminal of the battery (red) is connected to the end terminal on the fuse holder. The negative terminal (black) is connected to the common ground connection.

Wiring of the DC-DC buck converter module was pretty straight forward, as there are only three, well marked terminals. I used 18 AWG wire (red) to connect the side terminal on the fuse holder to the IN (12V) terminal, 18 AWG wire (black) to connect the GND terminal to the common ground connection, and the two 24 AWG wires (red) from the 5V terminal to two RPi GPIO 5V pins.

Again, wiring the pushbutton was simple. One side (blue) is connected to GPIO pin 3 (SCL) and the other side (black) is connected to the common ground connection.

Finally, the diagram shows the connections to the SparkFun board from the back. I soldered the wires to the component side of the board, so that I could apply double-sided tape to the back. This made it a little confusing when I went to solder the connections, so I ended up making in several mistakes. Furthermore, when I went to test it, it failed, as I had the Tx/Rx connections to the controller the wrong way around. I'm pretty sure I updated the diagram after correcting this, but I'm not absolutely certain. If it doesn't work on your first try, swap the connections. As you can see from the diagram, I'm powering the SparkFun board from the RPi GPIO 3.3V pin (white). Finally, the ground connection (black) on the board is connected to the common ground connection.

EmilyNerdGirl commented 3 years ago

Was pretty easy to wire this up to my Nexus controller on my Generac and power a Pi Zero W directly from the acc port and get genmon running. I ended up using this recommended cable, this TTL to RS232 converter, the status leds are handy when you accidentally reverse transmit/receive :) I used this enclosure recommended on the Github issue tracker someone posted and remixed a Pi Zero case from Thingiverse to be able to mount the Pi and TTL converter into it. I was a bit annoyed as it’s “mounting holes” were smaller then M2.5 screws I had, so had to do a clamp setup for it. PXL_20201220_144926947 MP

smeisner commented 3 years ago

Looks great. Nice and clean. How did you mount the enclosure to the panel in the generator? Did you drill into it?

Also are you using WiFi with the RPi Zero?

Steve

On Sun, Dec 20, 2020, 9:29 PM mloebl notifications@github.com wrote:

Was pretty easy to wire this up to my Nexus controller on my Generac and power a Pi Zero W directly from the acc port and get genmon running. I ended up using this recommended cable https://smile.amazon.com/gp/product/B000M802RG, this TTL to RS232 https://smile.amazon.com/gp/product/B07BJJ3TZR converter, the status leds are handy when you accidentally reverse transmit/receive :) I used this enclosure https://smile.amazon.com/gp/product/B005T9HMQW recommended on the Github issue tracker someone posted and remixed a Pi Zero case from Thingiverse to be able to mount the Pi and TTL converter into it. I was a bit annoyed as it’s “mounting holes” were smaller then M2.5 screws I had, so had to do a clamp setup for it. [image: PXL_20201220_144926947 MP] https://user-images.githubusercontent.com/309719/102732838-ba0b4700-4309-11eb-88a2-096eb0bccd26.jpg

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jgyates/genmon/issues/31#issuecomment-748722253, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVHM3CB5YN4NQ45QYQEPZDSV2XINANCNFSM4DROXB2Q .