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

jgyates commented 7 years ago

Very nice. I am glad to hear the feedback on the Pi Zero. It is always good to have people share their experience and implementation details. If I ever need to change out my cable I would likely power the PI via the GPIO header like this.

griffths commented 7 years ago

madisdev,

Thanks for the followup on your version of this. I too am planning to use the MAX3232 board but was unsure how to wire it up. I now see how to do it thanks to your pic so I can proceed with a little more confidence that I am connecting everything correctly as the board didn't come with any instructions.

zekyl314 commented 7 years ago

Great work on this, I like how you used the Zero. I may have to replace mine with a zero someday, and use the Pi 3 in the house for something else.

JeanB51 commented 7 years ago

Hi Madisdev. Here is mine. I took inspiration from yours, I used the Pi ZeroW, and the Max3232 board. I soldered everything. I too get the power from my Nexus controller. I did not need waterproofing, as I could bring the 4-wire cable inside the garage next to the generator.

I decided to connect the box to the wire with a molex on the side of the box, in case I ever want to disconnect the thing without too much trouble. My cutout isn't too great - I didn't have a dremel then..

Thanks for the inspiration, and thanks again to Jason for this very well made (-and supported) project.

pi zero

madisdev commented 7 years ago

Jean,

Nice job. Looks nice and clean. I'm glad I provided some inspiration and it worked out for you

Just to add that my layout wasn't that good. I didn't leave much room to remove the SD card. I had to troubleshoot an issue when my PI got off the network and the only way was to mount the SD card in my computer. Good to see you have some nice spacing around the PI.

I'm assuming under your Pi you glued down some standoffs or did you screw them into the plastic.

Thanks.

JeanB51 commented 7 years ago

Madis, Thanks for the comments. The spacing was more or less lucky, this is the box that I found at my local electronics supplier. The standoffs are screwed in from the back, as I didn't need waterproofing. And the box is stuck to the wall with some velcro strips. I'm more of a software guy, and all this hardware nitty-gritty is new to me. I learned as I went along, from Jason's pictures, as well as yours, plus some reading on the Web. I was actually great fun overall for a summer project !

Now I am hoping for a power failure, to see how this runs in real life. Maybe this afternoon, some heavy thunderstorms in the forecast.

Cheers

Jean B

madisdev commented 7 years ago

I actually need to get a UPS so I can get alerts when the power goes out. Right now I am mainly using it to keep track of the weekly exercise and alerts.

USAFPride commented 6 years ago

@madisdev, on the bottom of your max3232 board, does it have RS232<->TTL stamped on it? If so, which side do you have towards the piZero?

madisdev commented 6 years ago

I'll double check for you.

On Nov 11, 2017, at 3:17 PM, USAFPride notifications@github.com wrote:

@madisdev, on the bottom of your max3232 board, does it have RS232<->TTL stamped on it? If so, which side do you have towards the piZero?

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

madisdev commented 6 years ago

Hey @USAFPride,

Sorry I didn't get back to you earlier I was out for most of the day. The RS232 side is the Generator connection and the TTL is the PI. Be careful as I found that the connections on my MAX3232 board didn't connect to the other side, although there were pads on each side. I used the connections on the back side(side without the chip). Let me know how yours goes, as I had some issues with my WIFI connection dropping. I had to add an external antenna to the PI, I can show my results of that if your interested.

USAFPride commented 6 years ago

@madisdev, thanks, you solved it for me. I had it the same direction, but I had is soldered to the top pads. Now the serial works. The pads are small enough, so doing it 2X doesn't make my older eyes so happy!?

madisdev commented 6 years ago

Yea I had the same problem. Glad I could help.

kalex1114 commented 6 years ago

@madisdev @USAFPride - do you have close up pictures of your wiring and rs232 board connections? I'm about to start this project and wiring is fairly new to me. Would be great if you can post pictures. Thank you

madisdev commented 6 years ago

@kalex1114, I put this together in MS Paint. As Im at work. pizeromax3232

Please refer to this if you have questions about PI Pins.

kalex1114 commented 6 years ago

Ah thats perfect. Now I need to source molex connectors and plugs and everything. Thank you

madisdev commented 6 years ago

Just wondering, Would people be interesting in buying Molex connectors made up with leads? I know buying connectors and crimping tool for a one off really doesn't make sense.

Not really looking to make a profit, just cover shipping exp.

USAFPride commented 6 years ago

@madisdev, I bought 4 connectors and 16 pins direct from digi-key and spent less than $8. I do not have a crimper, but I soldered the wire to the connector (which IMO is better)

kalex1114 commented 6 years ago

@madisdev I would be your first customer 😀 I was going to post about buying one. My soldering skills are crap 😀. My plan is to remove mobile link and use that hole to mount the enclosure with raspberry on the outside of the unit. I have 2017 16kw air cooled model

madisdev commented 6 years ago

I would just throw this out there, what is the distance from the generator to your Wifi access point. As I had to put an external antenna on my Pi Zero to get it to consistently work.

kalex1114 commented 6 years ago

About 10-15 feet through the glass patio door. Signal is good. I can also boost the signal on my UniFi if needed. I should have ran an Ethernet cable when generator was being installed but didn’t think about it and didn’t know I can do this

madisdev commented 6 years ago

You mentioned your soldering skills are not that great, what was your gameplan? Were you going to solder directly to PI? Do you have the same MAX3232 board?

kalex1114 commented 6 years ago

Plan was to look at pictures of how it was done, watch videos and learn to solder. Or buy a Pre made harness. I didn’t get max3232 board yet. Only have raspberry pi 3b that has Wi-Fi built in. I was going to do it as you suggested in your diagram . Molex plug to the accessory port. To the max3232 board and then connect those to the pi. I currently have mobile link with service through April on it so have time to lear, practice and do it 😀. If you have other suggestions I’m listening 😀

USAFPride commented 6 years ago

img_6333

My setup

kalex1114 commented 6 years ago

Very nice. Thank you. its not secured inside the enclosure? is that indoors or do you have it attached to the outside of the generator?

krisasmith commented 6 years ago

Is that mounted on the side of the genset?

USAFPride commented 6 years ago

@kalex1114 - a bit of hot glue holds it down. Not enough to make a mess, but enough to hold it in place

@krisasmith - the picture is on my desk, but it is currently mounted directly under the connection port

kalex1114 commented 6 years ago

@USAFPride thank you. Can you post a picture of how its mounted? I think this is what i envision my setup to look like.

Oh wait nevermind. i read it wrong. I thought it was outside but its under the display. Hard to get to

krisasmith commented 6 years ago

Nice setup, I went with a pi 3 b so I could use a wired network connection.

kalex1114 commented 6 years ago

@krisasmith - can you post your pictures? I also have Pi 3b but will use wifi as i forgot to run the wire to the generator :)

USAFPride commented 6 years ago

@kalex1114 - it is in a weatherproof box, so it could go outside the genset, but it works where it is

@krisasmith Most Pi wifi issues are due to a) wifi power management left on b) weak wifi (duh). The Pi's generally do not handle disconnecting and reconnecting well, so I run a simple script every 5 minutes to ping my router, and if it doesn't get a response, to restart if. This has ended all my wifi disconnecting issues which required a restart (pulling the plug) to reconnect

checkwifi.sh

#!/bin/bash

#router ip
ping -c4 192.168.0.1  > /dev/null

if [ $? != 0 ]
then
#make sure you have the correct wlan
    ifdown --force wlan0
    ifup wlan0
fi
krisasmith commented 6 years ago

I have a network run in my garage that is right next to the transfer switch. I ran a 4 conductor wire to the genset for power and data. In the last picture you can see the gray wire in the upper left going through the key hole shaped mounting hole.

img_20170429_103140 img_20170429_103006

img_20170429_103335

kalex1114 commented 6 years ago

Thank you. I made a stupid mistake of not running anything to the generator. My transfer switch is about 35 feet away from the generator. Stupid zoning doesn't allow generators on the side of the house.

krisasmith commented 6 years ago

I was able to fish the wire after the fact, it was about 15ft. It took some persistence but I was able to get it. I used shielded security wire from home Depot.

proppilot commented 6 years ago

Thanks for the script on the wlan reset heartbeat. This was my last issue to resolve as I get disconnects about every two days. Here are a few shots of my install. Can’t do a project without a label on the box !

32faa9fc-1ed1-4e88-9a05-1464a0cb4484

proppilot commented 6 years ago

594798de-202e-44af-81b0-583ff5078a16

proppilot commented 6 years ago

I added the Active light with a small python script that runs and blips the light every two seconds so I know the processor is active. I added this when I was losing connection to the Pi and before narrowing it down to WiFi disconnects. The power light is taken off the GPIO +5 pin so I know that the Pi is powered up by the 12v-5v power converter seen in the box and the active light is off a GPIO pin.

super fun project. Now looking for other things to do with a RPi 3 !

kalex1114 commented 6 years ago

@proppilot that is awesome. do you have a link to the enclosure you used? how did you attach it to the generator?

proppilot commented 6 years ago

The box is a Cantex (p/n 5133710) 6 3/4 x 6 3/4 in electrical box from Home Depot. 16 dollars

Attached it to the generator with outdoor velcro and took the four conductor cable into the generator via the gland that the gas pipe goes through. Used molex connectors at either end ( you can see replaced the DB9 with Molex on the MAX232 board ) so it can be removed in a jiffy if my maintenance guy needs to come over !

kalex1114 commented 6 years ago

Thank you

kalex1114 commented 6 years ago

@proppilot sorry to be a pest but can you show the picture of the cover and wiring attached to it?

proppilot commented 6 years ago

Cannot do as I am away but this is what is on/in there. There are two LEDs on it. The shorter leads on both LEDs are tied together and one wire back to the ground pin on the GPIO connector.

Each of the long leads ( Anode or + ) have a 330 ohm resistor (so one for each LED) with the power LED going back to the +5V pin on the GPIO connector and the other for the ‘active’ LED back to the GPIO pin that I drive with the python program used to flash it.

Sent from my mobile device

On Nov 22, 2017, at 2:21 PM, kalex1114 notifications@github.com wrote:

@proppilot sorry to be a pest but can you show the picture of the cover and wiring attached to it?

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

kalex1114 commented 6 years ago

Thank you

krisasmith commented 6 years ago

@proppilot nice setup, the status led's are awesome.

USAFPride commented 6 years ago

@proppilot, Nice setup. When you get a chance, would you be willing to post a parts list and the art for your cover?

proppilot commented 6 years ago

Can do on Saturday. Art is in PowerPoint, printed on a laser and then laminated with peel and stick sheets.

On Nov 23, 2017, at 10:19 AM, USAFPride notifications@github.com wrote:

@proppilot, Nice setup. When you get a chance, would you be willing to post a parts list and the art for your cover?

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

proppilot commented 6 years ago

genmon.pdf genmon.pptx

Here is the PPT and PDF artwork for my box cover

proppilot commented 6 years ago
genmonled

This is the code for the python script that I start at reboot in crontab to flash the light on the box telling me the processor is active. Like a heartbeat

kalex1114 commented 6 years ago

@proppilot Thank you Tony. If you can please post the parts list.

proppilot commented 6 years ago

For the LEDs themselves or ?

On Nov 25, 2017, at 9:26 AM, kalex1114 notifications@github.com wrote:

@proppilot Thank you Tony. If you can please post the parts list.

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

kalex1114 commented 6 years ago

Sorry for the actual pi related stuff not leds. at least for me