Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. TD22057
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    TD22057

    @TD22057

    Hardware Contributor

    65
    Reputation
    184
    Posts
    1213
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    TD22057 Follow
    Hardware Contributor

    Best posts made by TD22057

    • Mother/Daughter board system

      I'd like to share my latest design. It's a mother/daughter board design using an RFM69 radio (though it would be easy to change it to an NRF). I have about 10 sensors I need to make and they're all similar, but not quite the same. This system allows be to mix and match what I need for each application. It's designed to be AC powered (which isn't a problem for my needs) and uses the following case for all of them (~$3/apiece for 10). I'm not trying to get the smallest form factor - I want something that's easy to build and looks nice. I needed a decent size case because I use a lot of detachable connectors and have at least one switch and 1-4 LED's on the front all of which intrude into the interior volume.

      The main board has the basic components and supports two daughter boards (roughly 25mm x 35mm) which plug into the side so the whole assembly is basically flat (leaving more room in the case for the switches, connectors, and LED's). An additional third daughter board can be used for small boards mounted perpendicular to the main boards (the sensor board below does that) or mounting over the top of the arduino.

      The main board contains:

      • 3.3V Arduino Pro Mini
      • RFM69 radio
        • side mount for external dipole antenna
        • interior mount with enough space for a helical antenna mounted parallel or perpendicular to the board
      • 5V->3.3V power supply
      • digital signing chip
      • flash memory chip
      • input and output shift registers
      • headers for a switch, LED, and piezo buzzer
      • header for SPI (MISO, MOSI, SCK) pins
      • 2 side mounted daughter board headers with inputs and outputs from the shift registers
      • 1 top mounted daughter board header with pins from the mini including D3 (IRQ), D5 and D6 (PWM), A3, A4 (SDA), and A5 (SCL)
      • 5cm x 5cm footprint for cheap production
      • all components are top mounted for easier soldering and a bigger ground plane for better antenna performance

      Here's a 3D view of the main board with the Arduino removed:
      mother.png

      Each daughter board header has 5V, 3.3V, ground, 3 input pins, and 3 output pins. I've designed five different daughter boards so far. The first four fit in a single 5cm x 5cm package so I can get 10 copies of each for about $15. Other daughter boards are generally small enough that OSHPark is a viable source if I only need a few boards made (like for the car parking board).

      • Relay board. I'm using this to control simple switching (like the garage door opener) and AC loads (hot water recirculating pump).
        • 1 solid state opto-isolated relay with screw header with LED for AC loads
        • 2 switched transistors for simple connections
        • 3 sensor inputs with pull up resistors
      • Protected input board. I'm using this to trigger when external security cameras and motion sensors trip (they both operate on 12V signals).
        • 3 opto-isolator circuits for triggering on 12V lines
      • Valve/motor control board. I'm using this for articulated water valves for controlling leaks at the water heater, washing machine, etc.
        • L9110 motor controller with LED and valve open/closed sensors.
      • Generic LED/sensor board. This board adds pull up resistors on the inputs and LED resistors on the outputs so it can be used with the shift registers.
        • 3 sensor inputs with pull up resistors
        • 3 LED's with resistors
      • Car parking board
        • 3.3V<->5V level shifters for the distance sensor
        • Ultrasonic distance sensor
        • LED ring

      To give you an example of how this works, here are some of the builds I'm going to use:

      • Garage sensor
        • relay board for monitoring and controlling the garage door
        • parking board for LED parking sensor
        • could add a 3rd sensor board for temp, humidity, or air quality later
      • Water heater sensor
        • sensor board for monitoring water leaks
        • valve board for shutting off hot water intake
        • relay board for a hot water recirculating pump
      • Refrigerator and bathroom sensor
        • sensor board for monitoring water leaks
        • valve board for shutting off water to the ice machine or toilet
      • Washing machine sensor
        • sensor board for monitoring water leaks
        • valve board for shutting off the hot water
        • valve board for shutting off the cold water

      I've finished all of the board designs and am now bread-boarding the schematics to make sure everything works properly before I put in my order. Once I get everything tested and confirm the boards work, I'll post the schematics and board files for anyone else that's interested. If you have any suggestions or comments, I'd love to hear them.

      posted in My Project
      TD22057
      TD22057
    • RE: Mother/Daughter board system

      Surprisingly, all of my circuits are working perfectly. I found one relay label that was swapped (NO/NC) and one jumper pad that wasn't very useful but other than that, all of the functionality is working. I have to admit I'm quite surprised there wasn't some serious problem somewhere given that this is my first non-trivial board design.

      When I started this design, I purchased a stereo microscope and it was fantastic. I'm no soldering expert by any measure but having the microscope (using the 5x lenses) made soldering all of the components very easy. After building 8 main boards and a bunch of daughter boards, I can now see why people invest in making a reflow oven for soldering.

      I'll be uploading the design files and schematics as soon as I clean up the BOM. Next up is cleaning up the software to drive everything and start on the case construction.

      Boards

      posted in My Project
      TD22057
      TD22057
    • RE: Water Leak Detection

      Here's another great leak "sensor": rope leak detector. The nice part about this is that it can cover a large area and it's basically white so it looks nice. I'm planning on cutting the 8 foot length up in to 15-20cm lengths to use in multiple locations.

      There are four wires in the sensor in the rope, 2 black, 1 white, 1 red. The only ones that matter are the black ones. Feed 5V to one of the black wires and attach the other to an analog pin. When dry, the pin reads about 20-30 (out of 0-1023 analog range). When wet, it will read anywhere from 60-150. That's not high enough to trip the digital HIGH value using digitalRead() so it needs to be hooked up to an analog pin to work properly.

      posted in Hardware
      TD22057
      TD22057
    • Eagle PCB software tips and tricks

      I just got my first large (for me) PCB order in and so I've spent a lot of time using the Eagle PCB design software over the last few months. I realize that many/most people are using KiCad since it's open source but I found Eagle first and did a lot of work in it before I saw KiCad so that's what I've stuck with. I thought it might be a nice idea to capture what I've learned about using Eagle effectively and see if anyone else had any tips to share.

      Project names

      Put a version number in the project name. I usually start with v1...vN as I'm iterating designs. Any time you start reworking something (routing, layouts, etc), save it to a new iteration. When you submit an order, move all the extra versions to a backup folder and rename the version you submitted to v1.0 and never change it again. If you need to edit something, create a v1.1 and edit that.

      Hot keys

      To get the maximum efficiency, use hot keys for everything. It's much faster selecting tools and toggling layers if you have keys set up instead of using the mouse. The most important set to me are the display keys (see F9-F12). They allow me to quickly toggle top and bottom layers and toggle polygon filling. It's annoying to set them up because you have to do it in the schematic editor and the board editor but it's worth it.

      The most useful ones are:

      • F9 shows both layers
      • alt-F9 shows just unrouted air wires
      • F10 shows just the top layer
      • F11 shows just the bottom layer
      • F12 fills polygons (ground planes)
      • alt-F12 unfills polygons

      Here are my keys:

      Key Action
      alt-b move
      alt-c copy
      alt-d delete
      alt-e net
      alt-f move
      alt-g group
      alt-i info
      alt-j junction
      alt-l label
      alt-m move
      alt-n name
      alt-q ripup
      alt-r rotate
      alt-s smash
      alt-t text
      alt-v via (board), value (schematic)
      alt-w route (board), wire (schematic)
      alt-z ratsnest
      F9 display 1 tname torigin tplace 16 bname borigin bplace pads via unrouted dimension tkeepout bkeepout trestrict brestrict drills holes milling; display 1 16 125
      alt-F9 display none unrouted
      F10 display top tname torigin tplace -bottom -bname -borigin -bplace -bkeepout
      F11 display bottom bname borigin bplace -top -tname -torigin -tplace -tkeepout
      F12 ratsnest
      alt-F12 ripup @;

      Libraries

      Build your own part library with the parts you'll use. That way you can find things faster and you know whether they work or not. Copy parts from eagle, sparkfun, and other online sources. You can find the library I've created for MySensors components at https://github.com/TD22057/Eagle-MySensors

      Grid

      For the schematic view, stick with 0.1 inch spacing since most of the library parts use that for the schematic symbol layouts (and NEVER use the alternate spacing). This insures wires will snap to the correct location and the connections get made. For the board view, metric or Imperial works. Since most of the parts I use have pins on 0.01 inch spacing, I use a grid with the major size 0.025" and the alternate size 0.00625 which seems to work well.

      Ground planes

      Use 0.012 isolation, 0.010 line width. The smaller line width allows the ground plane to flow between pads better. If you ever see a ground plane not going between a pad you think it should - it's probably the line width.

      Silk screen

      0.032, 15% is the smallest text size I would use on a board. That's readable (in good light) - but I usually prefer things to be larger than that. Once your board is done, smash all the parts to separate the text and parts, then position the labels in good locations. Add your own labels with the text command - make sure they're in the tPlace layer - that way the panelize ulp will duplicate them correctly.

      Scripting

      Eagle has a scripting language which I don't really understand. But - if you have any task that seems tedious (changing lots of items, spacing many components on a grid, etc), someone has probably already written a script to do it so search the web for Eagle scripts.

      Design Rule Checking (DRC)

      Obviously you need to run DRC often to make sure you haven't violated any rules. Download the DRC file from your manufacturer and use that. I normally copy and edit that file and make it more conservative and use that for my DRC run. The more conservative you can be, the less likely there are to be errors in the board when it's made.

      Viewing your board

      Use http://3dbrdviewer.cytec.bg/ to upload the board file for 3-d viewing. This can help visuallize how close things are together. In addition, you can download EagleUp and use it to export your board to SketchUp for 3-d viewing. Each part in your board will require a SketchUp object with the same name but they're pretty easy to find. This can really help visuallize how components will fit together.

      Ordering your board

      Before placing an order, run the renumber ULP - that will insure that parts are numbered in a reasonable order (so R12 isn't next to R1). Then adjust all the labels until you're satisfied.

      If you need to "panelize" a board (make duplicates of a single board in a larger board), you can do that. Close the schematic view and save the board to a new file. Run the eagle panelize.ulp - that will copy all the names from the tNames and tPlace names to a new layer. Then do a group, copy on everything and position the copy. Repeat as necessary. The problem with the copy is that each part gets a unique name which makes the labels wrong. But, the copied names in the new layer are correct so when you export the board for manufacture, select that layer instead of tPlace and tNames and the labels will be correct. See this panelize tutorial for more details.

      Be sure to download the CAM job from whatever board house you use (so far I've had great results from Elecrow) and run that to generate the gerber files for them.

      Boards larger than 10cm x 8cm

      The free version of Eagle limits boards to 10cm x 8cm. If you can split your order into smaller pieces (say two 10cm x 5cm or four 5cm x 5cm boards), you can use eagle-brd-merge to merge multiple board files. It takes in an offset and rotation for each board and writes out a new board file with the merged result. You won't be able to edit anything outside the 10x8 cm area but it works great for combining multiple boards into a single panel.

      posted in Hardware
      TD22057
      TD22057
    • Over the air (OTA) bootloading update tutorial?

      Has anyone done a write up that explains what the requirements are for using OTA bootloading updates? I'm closing in on a custom PCB board design and may want the option to support that in the future. I've looked at some existing boards people are designing and most seem to add a flash memory chip to support OTA but I haven't found much information beyond that. Some questions:

      1. What are the software and hardware requirements in the gateway for OTA?
      2. What are the software and hardware requirements in a sensor for OTA?
      3. Is a custom bootloader needed in the sensor?
      4. I assume that firmware downloads are targeted at a specific sensor ID right?
      5. How is an OTA update initiated? By the controller? If so, which controllers support it?

      Thanks in advance.
      TD

      posted in General Discussion
      TD22057
      TD22057
    • RE: Mother/Daughter board system

      Update: I settled on an SPI based shift register system and received and tested those parts (they will require an update to the RFM69 library to use SPI transactions but we should do that anyway). I finished testing all of my schematics on a breadboard, fixed several errors, and submitted my PCB order this morning with Elecrow for 10 board of 10 cm x 10 cm. I was able to fit 2 main boards and 10 child boards on a single panel so that's 120 different boards for $25. I ended up creating the following 7 different child boards to use in the system:

      • valve board (see first post)
      • protected input board (see first post)
      • sensor board (see first post)
      • parking board (see first post)
      • AC relay board (higher amperage/power relay for large loads)
      • DC relay board (5V DC relay for small loads)
      • I2C sensor board

      Once I get the boards in and test them, I'll post the raw boards and schematics (or ping me if you want to see them now) in case anyone is interested. Just because it's cool, attached is an image of the final board submission.image.png

      posted in My Project
      TD22057
      TD22057
    • RE: Safe In-Wall AC to DC Transformers??

      You don't really have to buy anything - lots of things will work to keep the temperature down. A wet paper towel wrapped around the fuse or submerge it in a small cup of water (easy for through hole components when the board is upside down) or wrap with 2 wet sponges and some rubber bands, etc etc.

      posted in Hardware
      TD22057
      TD22057
    • RE: Mother/Daughter board system

      Yeah! Boards have arrived. I used elecrow.com and ordered 10 boards for $25. They shipped 14 and they arrived (California) in 16 days. Everything looks good so far. I probably should switch to a larger silk screen font for some of the labels but so far all the footprints seem to be correct. Next up is to start cutting the boards apart and start soldering...
      0_1453395171426_20160121_083157.jpg

      posted in My Project
      TD22057
      TD22057
    • Some simple asynchronous Arduino classes

      I wanted to share some of the classes I've been using for my MySensor modules. I've been making some fairly complicated sensors (boards with a lot of things going on - see my mother/daugter board system) and I have found that these classes to be very useful. They're all fully commented and include test sketches. They're designed around two main principals:

      • Asynchronous operations. There are no delay calls anywhere. Each class maintains it's own state and behaves accordingly. This allows me to combine many different items and use them all without worrying about how they interact with anything else.

      • Hardware abstraction. Each class has a very similar API in which the hardware specific information is set in the init() function called in the the setup. After that, all the interaction is via state change ("turn on", "blink 5 times", "sensor triggered", etc). In my board system, I connection these things via direct Arduino pins (some digital, some analog, some analog only A6/A7) and shift registers. This abstraction allows be to use the same logic code regardless of how the hardware is actually connected.

      The basic idea is that:

      • setup(): initializes the hardware (pins, etc) and state
      • loop(): poll each object with a callback function to look for changes
      • callback(): handle the state change

      I've found that I really like this type of API. All of the hardware configuration is in setup() and all of the state changes (what happens) is in the callback. I've found that this makes the code easier for me to debug and much easier for me to understand (when I come back and look at it 6 months later) since the role of each function is clearly defined. On the output side, the DigitalOutput class allows me to turn things on for different amounts of time (turn a relay on for 5 seconds) while various LED's are blinking at different rates with very simple code. It's not the most size efficient code - but I've never found that to be a problem for my builds and the ease of use and clarity of intent is more important to me.

      • DigitalInput: On/Off inputs (switches) with either HIGH or LOW
        active, optional debouncing, and support for digital pins, analog only
        pins (A6/A7) and shift registers.
      • DigitalOutput: On/Off ouputs (LED's, relays) including blinking.
      • MedianFilter: N sample running median filter.
      • Sonar: Ultrasonic snsor.
      • Timer: Repeating (num or infinite) periodic triggers.
      • Valve: 5 wire articulated valve control

      The repository is here: https://github.com/TD22057/TD-Arduino-Core
      A good, long'ish example using several different classes is: https://github.com/TD22057/TD-Arduino-Core/blob/master/Valve/tests/leak_sensor/leak_sensor.ino

      Feel free to use these if you find them helpful and any comments or suggestions are welcome.

      posted in Development
      TD22057
      TD22057
    • RE: Water Leak Detection

      We just had a water heater fail so I'm in the middle of exactly the same project. I'm waiting on aliexpress orders for all my sensors but I'm planning on starting with multiple leak detectors in each bathroom (under sinks and toilets), the laundry room, the kitchen, and the water heater. I looked at all of those sensors and didn't like any of them. Right now, I'm going to try these: www.ebay.com/itm/231594180289
      which have 2 contacts spaced a little bit apart. They seem to work fine so far but I haven't tried hooking them to an arduino yet. I'm hoping I can find them for cheaper before I place my final order (I need about 12 of them).

      For stage 2 of my plan, I'm going to install actuated valves that will turn off the water when a leak is detected. Valves are about $30 and work on 5V from this store (click their store link for lots of options): http://www.aliexpress.com/store/product/2-Way-1-2-Brass-Motor-Valve-with-manual-override-DN15-DC5V-5-wires/414681_1695915390.html
      I'm also going to use a H-bridge module to allow reversing the valve w/ 2 pins: http://www.aliexpress.com/item/5pcs-lot-H-bridge-Stepper-Motor-Dual-DC-Motor-Driver-Controller-Board-For-Arduino-HG7881/1927732289.html

      posted in Hardware
      TD22057
      TD22057

    Latest posts made by TD22057

    • RE: Water Leak Detection

      Look here under Valve: https://github.com/TD22057/TD-Arduino-Core

      posted in Hardware
      TD22057
      TD22057
    • RE: Safe In-Wall AC to DC Transformers??

      You don't really have to buy anything - lots of things will work to keep the temperature down. A wet paper towel wrapped around the fuse or submerge it in a small cup of water (easy for through hole components when the board is upside down) or wrap with 2 wet sponges and some rubber bands, etc etc.

      posted in Hardware
      TD22057
      TD22057
    • RE: Water Leak Detection

      @mars000 said in Water Leak Detection:

      @TD22057
      I can't seem to work out how the water sensor functions - i notice you wired it to 5V on red and black to D4, but is there a trick in terms of how it works ?
      I assume you are reading the D4 pin in your code ? Could you pls help out/share your code ?
      How you finding the reliability of the sensor and value ?

      Honestly - I don't remember. Re-reading the thread, I believe they worked fine but that 5V was required. Try hooking them up to an analog pin and reading the value there. They might be not be passing enough voltage to trigger a digital reading. I actually never deployed the design above - I switched to a more modular design and used the rope sensors shown above. I haven't had any problems with the valves - of course they don't cycle at all since I don't have any leaks, but they work when I test them.

      posted in Hardware
      TD22057
      TD22057
    • RE: US decora style wall switch

      Very interesting designs @enterprised and @dbemowsk. I've also been working on my own version of decora switch and relay system. It's designed to use empty keystone switch plates with 1, 2, or 3 switches and uses keystone jack fillers as the switch covers so they look almost commercial. It's a 3 PCB system. The front PCB has the switches, LED's, reset button, CPU, and an RFM69 or NRF radio. The middle PCB has a MeanWell IRM-02 or HLK AC->DC converter (with fuse, thermal fuse, and varistor), a replaceable fused 10A AC relay with opto-coupler isolation, 5V and 3.3V rails and a 2 wire temperature probe to measure the temp of the PSU module. The back PCB is just a cover to insure no sharp solder points are in an electrical box. I decided that since this will be in my walls, I would only use name brand parts (from digikey and mouser) on the high voltage side which increases costs but should reduce the risk of fire (or at least make me feel better).

      I've designed the PCB and checked them over but we're in the middle of buying a house and moving so I haven't ordered any yet. Here's the 3D rendering of the PSU and CPU boards together and a one of the PSU board.

      0_1484794975291_combined.png
      0_1484794989118_psu.png

      posted in My Project
      TD22057
      TD22057
    • RE: Double click | Hold for buttons

      I have short and long press status reports on my switch class here. There are example sketches one directory up in the tests area. Double click gets more complicated because you have to decide are you going to delay reporting the press/release from the first click until enough time has passed for it not to be a double click? Or do you report the press/release from the first click, and then report a double click? I'd be surprised if there aren't a lot of arduino double-click switch examples around...

      posted in General Discussion
      TD22057
      TD22057
    • RE: Rfm69 and that pesky antenna

      @nagelc said:

      I have tried this antenna with the RFM69:

      YAGEO ANT1204F005R0915A
      http://www.newark.com/yageo/ant1204f005r0915a/antenna-chip-915mhz-50-ohm-1204/dp/38X6113?ost=ANT1204F005R0915A&selectedCategoryId=&categoryNameResp=All%2BCategories&searchView=table&iscrfnonsku=false

      That looks very promising. But I have no idea how to design or tune the matching circuit called for in the data sheet. Any thoughts?

      I've used these type of small helical antennas with good results.

      posted in My Project
      TD22057
      TD22057
    • RE: 💬 MDMSensor "Multisensor"

      Very cool. What kind of connector are you using to connect to the programming pads?

      posted in OpenHardware.io
      TD22057
      TD22057
    • RE: 💬 Mini Relay Box

      Very cool. Would you mind adding a pdf of the schematic?

      posted in OpenHardware.io
      TD22057
      TD22057
    • RE: Safe In-Wall AC to DC Transformers??

      @TD22057 said:

      I have a question... referring to the first post, why is the varistor after of the fuses? I thought it was there to protect against surges in the AC lines which would makes me think that the varistor should be before the fuses. Thoughts?

      I answered (some what) my own question via Google. Here's a quote from an electronics site:

      Fuse upstream of the MOV, but don't expect it to save the MOV. It will prevent your house from burning down after the MOV partly shorts and sits there glowing red hot.

      So it seems like the original post is correct on the order.

      posted in Hardware
      TD22057
      TD22057
    • RE: Safe In-Wall AC to DC Transformers??

      I have a question... referring to the first post, why is the varistor after of the fuses? I thought it was there to protect against surges in the AC lines which would makes me think that the varistor should be before the fuses. Thoughts?

      posted in Hardware
      TD22057
      TD22057