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.
Posts made by GuyP
-
RE: sensors in boxes
-
RE: sensors in boxes
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.
-
RE: sensors in boxes
Oh a few people have suggested these guys for cheap PCB production..
http://dirtypcbs.comI've not tried them myself yet.
-
RE: sensors in boxes
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
-
RE: sensors in boxes
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.
-
RE: sensors in boxes
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.
-
RE: sensors in boxes
@DrJeff yes correct.. I'm just etching single sided. I couldn't solve the it completely so four links.
-
RE: sensors in boxes
@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!
-
RE: sensors in boxes
@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.
-
RE: sensors in boxes
@DrJeff Sure no problem..
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.
Let me know if those work out better...
-
RE: sensors in boxes
@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.
-
RE: sensors in boxes
@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
-
RE: sensors in boxes
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.
-
RE: sensors in boxes
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.
// 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); }
-
RE: sensors in boxes
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.
-
RE: Backup internet acces
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.
-
RE: Temperature Sensor example on Pro Mini ATmega168 not compiling
I've been buying my ATMega chips from "Banggood.com".
Costs £2.02 for one, but multi buy is even cheaper and free shipping, yes they ship from China so it takes a while but so far they have worked fine for me. Even bought the Radios from them, and they are working fine.
They don't have the Arduino boot loader installed, but if you already have an Arduino that's easy to fix and saves.
-
RE: A simple controller
openhab, openhab.org is open source, easy to setup and will do all you want.
-
RE: What is wrong with this node?
Which gateway have you used? serial or ethernet? can you show the serial diag data from that as well? maybe they are out of range of each other
-
RE: MQTT & openhab
that shows you have a listener, but nothing connected!
Are you running the gateway on this PC? if so the openhab configuration should be localhost or 127.0.0.1:1883.
-
RE: MQTT & openhab
Did you restart openHAB after you entered the MQTT gateway IP address in the configuration file? You don't need to restart when changing items, or sitemaps.
You should check that openHAB has made a connection to the MQTT gateway.
netstat -an |grep 1883
root@openHAB:~# netstat -an |grep 1883 tcp6 0 0 192.168.40.201:42199 192.168.40.200:1883 ESTABLISHED root@openHAB:~#
Do you see it listed? If not restart the gateway, it should connect within a few minutes.
-
RE: Node freezing up
Can you give more details of what your node is? what hardware have you used? do you have a circuit diagram?
-
RE: sensors in boxes
I'm running everything at 3 volts from the 2 AAA batteries. The box is 3D printed and integrates the battery box. I'm not using any screws, just slide rails for the PCB , top and back.
I have two board types now. One with just the single Dallas temp sensor on it, which turns out to be what I need most of.
I also created another board which has three Connectors, JP1-3, which allows to additional Dallas Temp sensors. I have these in locations where I can run wires more easily, like my loft spaces.
I'm etching everything myself. Very simple really. I'm using the print on to glossy paper and transfer onto copper board, using a laminator, method. Works really well. As these boards are small I tend to etch a few at a time onto a single copper board and then cut the board at the end.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
It completely locks up.. I tried to talk with at the same point but it doesn't seem to listen to anything
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
Well it's very simple to detect if the network has gone away.
In the processEthernetMessage() function, it checks
if (client) {
if there's a client connection then the network must be working. If not then either the network has stopped or nothing is connected. Well OpenHAB always maintains a connection.
So I've just added the
} else {
part to say the connection has gone. I also setup a timeout by counting the micros() since boot. so it's not constantly firing the reboot.
I then raise digital pin 3 which is linked to my 555 timer circuit, which causes the power cycle.
unsigned long resetCounter = micros(); int rebootAborted = 0; void processEthernetMessages() { char inputString[MQTT_MAX_PACKET_SIZE] = ""; uint8_t inputSize = 0; EthernetClient client = server.available(); if (client) { resetCounter=micros(); if (rebootAborted) { Serial.println("Rebooting Aborted"); rebootAborted = 0; } while (client.available()) { char inChar = client.read(); inputString[inputSize] = inChar; inputSize++; } #ifdef TCPDUMP Serial.print("<<"); char buf[4]; for (uint8_t a=0; a<inputSize; a++) { sprintf(buf,"%02X ", (uint8_t)inputString[a]); Serial.print(buf); } Serial.println(""); #endif gw.processMQTTMessage(inputString, inputSize); } else { if ((micros() - resetCounter) >= 100000000 && !client.connected() && !rebootAborted) { rebootAborted = 1; Serial.println("Rebooting"); pinMode(3,OUTPUT); digitalWrite(3,HIGH); delay(100); digitalWrite(3,LOW); } } }
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
I was still seeing it stop working. However after further diagnostics it seems the issue lies with the ethernet side of things, the Arduino and Radio still continue to function.
I tried to use the Arduino to reboot it's self, which didn't work, but also would not have rebooted the ethernet modules and thus would not have solved this.
I've ended up building a 555 timer circuit which is triggered from the Arduino (Digital pin 3), the time fires and triggers a relay to remove power from everything for 2 seconds. Thus we end up with a complete reboot.
Here's my circuit diagram, take 5Volts directly and then PWR is fed into my previous circuit that way when the relay clicks over all power to the Arduino and ethernet is removed.
-
RE: Forum Upgraded
We seem to be missing the "Troubleshooting" Topic from the "Home" dashboard page.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
And now in it's 3D Printed case..
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
@AlinClaudiu said:
@Magiske said:
ENC28J60
you connected ENC28J60 to 5v?
Yes, the ENC28J60 and the Arduino are running on 5V. The only thing connected to the 3.3Volt regulator is the Radio, NRF24L01+
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
So to follow up.. yes indeed it seems that the power was my issue.
the connector just above the Radio is the 5Volts and ground. The Single connection on the other side is serial TX so I can see the serial diagnostics.
-
RE: Forum Upgraded
Since up the upgrade I'm no longer able to post using Safari browser on my Mac. I'm posting this via Firefox.
I can fill in the posting.. but when I click "submit" it fades out but never clears and doesn't submit the post.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
I've been doing a great deal of research on this and I think I might have found the issue.
It seems that the radio is very sensitive to power changes... In my original circuit I had the Arduino and the radio running from the 3.3v line. Since I moved it to the 5Volts line the Gateway has stayed up for over a day now.
So to sum up. Everything is now powered by 5Volts except the radio which is 3.3v from the LE33CZ-TR regulator. I have it powered direct from a USB power adapter as well rather than the Uno I did have.
Once I have etched and tested I will post the circuit and PCB layout.
-
RE: How low can arduino can go?
My Temperature sensor, using Dallas, and radio, has been running for more than 2 months and show no sign of going flat... In fact the battery monitoring hasn't reported a single drop in power yet!!!
If you really need low power like this, then you should think about etching a PCB with your circuit.
-
sensors in boxes
I think I must have read almost every page on this site when I discovered it. I really loved this idea. For ages I've wanted to monitor and interact with my surroundings via some home automation solution, but all the commercial solutions are really expensive and limited. MySenors and OpenHAB really give me the customisation I want.
The only thing missing was putting everything together. I'm working on that. But first I needed to create my sensors, as small/cheap as possible and battery powered.
Here's my first pass at building the temperature sensor, in a 3D printed box which also houses the battery compartment.
The circuit board (Single Sides Etch) slides in on groves in the walls. I added the battery monitoring to the Arduino as I really need to know if/when the batteries are going flat. That's all pushed back to openHAB which I can then create a rule to watch for battery low, however so far the batteries seem that they will last for ever!
The contacts on the battery box are small flat metal. Aluminium between the batteries, and Copper for the terminals. I used copper as I could more easily solder to it.
Making it very easy to assemble.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
I setup a continuous ping every 60 seconds to the MQTT gateway and when it stops working the pings stop as well. I also see that the "Green and Yellow" LEDS on the ENC28J60 are no longer lit.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
@Magiske said:
Have had this problem. And I am pretty sure it's a power issue. Running 5v lines on a 3.3v. Works flawless when I pipe the ethernet lines through a 74LVC245 or when I replaced my "base station" with a Uno+Shield.
So try a level shifter or try running it with a 3.3v(3.7v) power supply to test ?(Remember to set the Arduino to 8Mhz so it's not overclocked)
/Mads
Interesting... I am running the whole circuit at 3.3Volts from a regulator (LE33CZ-TR) and I have a capacitor across the power lines as well. But it's clocked at 16Mhz..
I don't have an 8Mhz crystal at hand to test with. I guess I could try the internal clock.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
@celonunes said:
@GuyP @C.r.a.z.y.
What happens if you ping the gateway IP?GP> the MQTT stops responding pings
What happens if you restart openhab?
GP> nothing! it doesn't reconnect to the MQTT, in fact I can't telnet to the MQTT on port 1883 when it stops responding. I just have to reboot the MQTT to get it back on track.
Do you see any error messages in the openhab console?
GP> No nothing
Could you try to connect to the gateway using another MQTT client and see if it responds? Like paho-MQTT, MQTT-fx, mosquito_sub
GP> I'll give it a go but as I'm not able to telnet to it I don't think that will fair any better
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
@celonunes said:
Do you still see the node messages being printed on the serial output of the gateway after the problem happens?
Yup... They continue to be received by the MQTT, so the issue appears to lie with the Ethernet part.
-
RE: MQTT ethernet gateway Works great for 3+ hours then stops
Yup I'm on the latest library 1.4 and the latest version of the MQTT gateway that's posted.
I'm in the process of designing a PCB and 3D printed case for my temp sensors. But having to reboot the gateway 3 times a day or more is really putting a damper on the project.
-
MQTT ethernet gateway Works great for 3+ hours then stops
I've built an ethernet gateway from scratch.. using the ENC28J60 Ethernet module and NRF24L01 Radio. I loaded the MQTT gateway into my ATMega268 and started it going...
For the first few hours everything is working perfectly. I can see it receiving updates from the the sensors (Temperature for the moment), and sending it on to openHAB. I can see a TCP connection on the OpenHAB server and all will be well.
After 3+ hours though the MQTT will still be receiving traffic from the sensor but will stop Ethernet communication and not send it onto OpenHAB. I suspect it's a overflow issue somewhere.. As soon as I reboot the MQTT gateway all is well again.
I've seen a few people report issues similar to this and discussing a watchdog to reboot the MQTT if it fails. I'd rather not do this though, and better to find the underlaying issue. I also read that not all the ATMega support it.