Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
GuyPG

GuyP

@GuyP
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store
About
Posts
46
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • sensors in boxes
    GuyPG GuyP

    Excellent...be careful, not to remove too much from the right side, as the radio transmitter will over hang which makes it harder to fit in a box.

    My Project

  • sensors in boxes
    GuyPG GuyP

    Yes You'll want to remove or reroute them. I was only think of a single layer board so those are link wires. Sorry I should have talked about those.

    My Project

  • sensors in boxes
    GuyPG GuyP

    Sure here you go..

    TempSensorBase.stl

    TempSensorTop.stl

    My Project

  • sensors in boxes
    GuyPG GuyP

    Ok now I'm jealous.. that looks fantastic.

    1437172414002-upload_-1-8.jpg

    My Project

  • sensors in boxes
    GuyPG GuyP

    Oh a few people have suggested these guys for cheap PCB production..
    http://dirtypcbs.com

    I've not tried them myself yet.

    My Project

  • sensors in boxes
    GuyPG GuyP

    Awesome... send photos when you've made them! :)

    My Project

  • sensors in boxes
    GuyPG GuyP

    Yes it's very cheap and simple to build, When I was etching the boards I was etching 12 at a time and cutting them down.

    That 28pin Narrow socket looks to be the right thing (seems to say the right things anyway), the graphic is odd though.

    I also bought all the parts in bulk which made for even more savings, specially for resistors and capacitors where I bought maybe 100 and was paying less than 1p a unit.

    I was also able to buy the Dallas Temp sensors in bulk and saved quite well on those as well

    My Project

  • sensors in boxes
    GuyPG GuyP

    Sorry my fault... I'm not very good at documentation! :(

    There are no diodes on the boards... Which board are you referring to.. the TempSensor board just has:

    • 1x dallas Tempensor
    • 2x capacitors for the crystal
    • 1x 16Mhz Crystal
    • 1x 4.7uf Capacitor accros the power lines
    • 1 resistor for the Dallas sensor to provide power
    • 1x 470k resistor and 1x 1m resistor for the battery power level monitoring.

    I don't even have the pins for updating the Arduino, I pull it from the socket and write it in a uno board. I do however have a GND, and serial TX pin so I can see the chip working if necessary.

    My Project

  • sensors in boxes
    GuyPG GuyP

    Here's the BRD files..

    TempSensorRepeater.brd

    TempSensor.brd

    My Project

  • sensors in boxes
    GuyPG GuyP

    I'm just flashing with the uno boot loader...

    I have been looking at doing away with the boot loader, but really the advantages such as extra space and boot speed are not important at the moment.

    My Project

  • sensors in boxes
    GuyPG GuyP

    @DrJeff yes correct.. I'm just etching single sided. I couldn't solve the it completely so four links.

    My Project

  • sensors in boxes
    GuyPG GuyP

    @DrJeff At the moment just temperature sensors.. however the plan is to also control my heating system around the house.

    I will put putting controllers on all the radiators around the house, and replacing the controller in the house with simple radio buttons which feed back to openhab for manual over ride.

    Just not had time yet! :(

    My Project

  • sensors in boxes
    GuyPG GuyP

    @Moshe-Livne When writing the boot loader you need to keep the uno chip in the board.

    Once you've written all the board loaders, then you can pull the chip from uno and replace it with all the new ones to write the temperature sensor codes.

    My Project

  • sensors in boxes
    GuyPG GuyP

    @DrJeff Sure no problem..

    TempSensor.pdf

    I've also now built a "Repeater Board", this board can either act as a repeater, and be powered by USB mini, or battery (Best not on battery when in repeater mode). It also has the expansion to add multiple Dallas Temperature sensors. JP1-3 sensors can be daisy chained up to around 16 in total. I have these boards in loft spaces, and garage where I want to watch temperature in lots of locations and I don't mind a few wires.

    RepeaterBoard.png

    TempSensorRepeater.pdf

    Let me know if those work out better...

    My Project

  • sensors in boxes
    GuyPG GuyP

    @Moshe-Livne the boot loader..

    https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader

    I use this method to write the boot loaders using an uno..

    https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

    works great. I use a Zero insertion socket for the chip and rattle through the chips in a seconds.

    My Project

  • sensors in boxes
    GuyPG GuyP

    @hawk_2050 I buy them from banggood.com where they discount for quantity so I'm usually paying about £1.66 a chip and free delivery.

    However looking at @Moshe-Livne he's found a cheaper place.. so I think I'll be using them from now on :)

    My Project

  • sensors in boxes
    GuyPG GuyP

    It's an ATMEGA328P, which is the Arduino processor, I buy them in bulk from China, write the boot loader and flash the code onto them using an uno board.

    My Project

  • sensors in boxes
    GuyPG GuyP

    Sure no problem.. It's the stock code for the dallas temperature sensor with the simple addition for the battery monitoring.

    oh and just as an update on that.. still haven't replaced the batteries in the sensors and they are still reporting 82%, which is a run time of over 4 months now.

    BatteryStatus.tiff

    
    // Example sketch showing how to send in OneWire temperature readings
    #include <MySensor.h>  
    #include <SPI.h>
    #include <DallasTemperature.h>
    #include <OneWire.h>
    
    #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
    #define MAX_ATTACHED_DS18B20 16
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    OneWire oneWire(ONE_WIRE_BUS);
    DallasTemperature sensors(&oneWire);
    MySensor gw;
    float lastTemperature[MAX_ATTACHED_DS18B20];
    int numSensors=0;
    boolean receivedConfig = false;
    boolean metric = true; 
    // Initialize temperature message
    MyMessage msg(0,V_TEMP);
    MyMessage msgvolt(1,V_VOLTAGE);
    int BATTERY_SENSE_PIN = A0;
    int oldBatteryPcnt = 0;
    
    void setup()  
    { 
      analogReference(INTERNAL);
      // Startup OneWire 
      sensors.begin();
    
      // Startup and initialize MySensors library. Set callback for incoming messages. 
      gw.begin(); 
    
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Temperature Sensor", "1.0");
    
      // Fetch the number of attached temperature sensors  
      numSensors = sensors.getDeviceCount();
    
      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
         gw.present(i, S_TEMP);
      }
    }
    
    
    void loop()     
    {     
      // Process incoming messages (like config from server)
      gw.process(); 
    
      // Fetch temperatures from Dallas sensors
      sensors.requestTemperatures(); 
      
      // Battery Monitoring
      int sensorValue = analogRead(BATTERY_SENSE_PIN);
      float batteryV = sensorValue * 0.003363075;
      int batteryPcnt = sensorValue / 10;
      
      Serial.print("Battery Voltage: ");
      Serial.print(batteryV);
      Serial.println(" V");
      
      Serial.print("Battery percent: ");
      Serial.print(batteryPcnt);
      Serial.println(" %");
      
      if (oldBatteryPcnt != batteryPcnt) {
        gw.send(msgvolt.set(batteryPcnt,1));
        oldBatteryPcnt = batteryPcnt;
      }
      // Read temperatures and send them to controller 
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
     
        // Fetch and round temperature to one decimal
        float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
     
        // Only send data if temperature has changed and no error
        if (lastTemperature[i] != temperature && temperature != -127.00) {
     
          // Send in the new temperature
          gw.send(msg.setSensor(i).set(temperature,1));
          lastTemperature[i]=temperature;
        }
      }
      gw.sleep(SLEEP_TIME);
    }
    
    
    
    
    My Project

  • sensors in boxes
    GuyPG GuyP

    Project has now been running for over a month. The study is the Longest running sensor at closer to 2 months.

    As you can see the batteries are still in very good shape... Also I'm still polling every 30seconds for the temp. So if I was worried about the battery I could reduce the poll to say once every 5 minutes and not lose anything in resolution.

    batteryLevels.png

    My Project

  • Backup internet acces
    GuyPG GuyP

    I agree, take a look at a better router/firewall. I use pfsense, which can handle any number of WAN connections and run them however you want, failover or load balanced etc.

    I'd then run a VPN service to allow reconnect. You could use dynamic DNS to allow you to connect to the dynamic one from the Mobile network.

    My Project
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular