Arduino based room controller

I don't know why the 1wire reports twice but w/e

Now that you know the address of the sensor, you can just call it directly. I'm guessing you are doing the identify function and the call function, but not sure, never seen that before. Otherwise looks good....are you a metric system user?
 
Is it smart to power the sensors direct from the power adapter or from the arduino? I think it is smart to build in a LiIon battery pack so the main box never goes down?

If the power is down, you have nothing to control and no control.....


Waterproof DS18B20 Digital temperature sensor + extras ID: 381 - $12.00 : Adafruit Industries, Unique & fun DIY electronics and kits

So with the 4th wire, the copper shield should that be wired to a to-ground earth for people to ground to something??? The hanna website said your nute res needs to be grounded to get an accurate reading with a continuous probe?

Not sure how you are gonna ground the plastic reservoir....I would connect the shield to the res (maybe a stainless steel "stick" dropped in the res, welding wire or rod etc) to wiring ground.

so I am planning on using an IDE male cable and cutting it, separating the conductors then use those to run to my RJ11 jacks as the data leads.

Can you do some pics for me and others? I think soldered connections would be more robust. I've thought about Cat 5/6 connectors and jacks and the special crimp tool, but I just go back to screw terminals or solder. It's easy to drill a hole and pass the wire thru w/ no connector on the end.

:bravo:
you are getting in the groove now. I have to pick up the pace.
 
If the power is down, you have nothing to control and no control.....




Not sure how you are gonna ground the plastic reservoir....I would connect the shield to the res (maybe a stainless steel "stick" dropped in the res, welding wire or rod etc) to wiring ground.



Can you do some pics for me and others? I think soldered connections would be more robust. I've thought about Cat 5/6 connectors and jacks and the special crimp tool, but I just go back to screw terminals or solder. It's easy to drill a hole and pass the wire thru w/ no connector on the end.

:bravo:
you are getting in the groove now. I have to pick up the pace.

Well if the power is down I still want it to log temp and humidity data, I just think it would add to stability, dunno I will think about it more.

The Hanna site said run a steel rod into the res and ground it to earth. I would worry about running it to the house electrical ground, if something else dumps current to the ground it would wind up going into your res? Or am I wrong?

As far as the RJ11 jacks I want to give things a more finished look, and this would let me swap out sensors and disconnect them to run the wire more easily. If I could find some double sided screw connectors that would be cool too.

I made a github account and installed the software, im not sure it worked lol. You tell me if you can see any files:

GitHub - maer/Arduino-based-room-controller: Grow room controller
 
The Hanna site said run a steel rod into the res and ground it to earth. I would worry about running it to the house electrical ground, if something else dumps current to the ground it would wind up going into your res? Or am I wrong?

If you ground something but not to your home's electrical ground, haven't you just created a ground loop? Methinks if you're going to ground anything that involves electronics/sensors, you want to avoid doing so. Gremlins live in ground loops....
 
If you ground something but not to your home's electrical ground, haven't you just created a ground loop? Methinks if you're going to ground anything that involves electronics/sensors, you want to avoid doing so. Gremlins live in ground loops....

Yeah, what TS said. Ground is the earth....one. All grounds go to the same place. Sensors ground to the arduino, the arduino acts as the ground. If you want to try the sensor w/ the res not grounded, go ahead. But if you get funky readings you will know where to start. I'm guessing the copper shield wire ties into the SS tip on the sensor and will ground your res at the same time if you hook it up. You may try the three wires first and log some readings, then hook up the ground and compare.
 
Well if the power is down I still want it to log temp and humidity data, I just think it would add to stability, dunno I will think about it more.

The Hanna site said run a steel rod into the res and ground it to earth. I would worry about running it to the house electrical ground, if something else dumps current to the ground it would wind up going into your res? Or am I wrong?

I made a github account and installed the software, im not sure it worked lol. You tell me if you can see any files:

GitHub - maer/Arduino-based-room-controller: Grow room controller

Battery for logging would be good then.

The ground (earth) will absorb any fault, your res is safe. You have pumps and stuff in there now right? What if one of them was "leaking" voltage. You would want that to go to ground right? If the res was not grounded and you put your hand into it you would get "bit". This is why GFCI's are important around water. They detect an electrical mismatch and identify the "leakage".
 
Battery for logging would be good then.

The ground (earth) will absorb any fault, your res is safe. You have pumps and stuff in there now right? What if one of them was "leaking" voltage. You would want that to go to ground right? If the res was not grounded and you put your hand into it you would get "bit". This is why GFCI's are important around water. They detect an electrical mismatch and identify the "leakage".

It has been so long ago when I studied electrical circuits and wiring... I can't think.. But I'll try

If the Arduino is on batteries, then it isn't grounded to the same potential as say the house grounding. But at the most it is only putting out 3.3 volts at 500 milli amps.

Many folks put many electrical items into their reservoirs, pumps, heaters... These are some what safe as long as they are on GFCI circuits.

I don't believe you need to have the Arduino grounded, and most certainly not when running on batteries. You might also pull in noise from the houe ground causing sensor problem.

I'll do some testing over the weekend and see anything pops up and maybe ask the question over on the Arduino forums. My temp sensors for the reservoir is not the same as Maer's, but close enough.
 
Maer, no I can't see any files there. There is a README file that is empty (you created the REPO). Here's my flowchart for getting a file to GITHUB.

on Github site, create a repo (myfile)

Using Git Bash program (on windows7)
$mkdir ~/myfile
$cd ~/myfile
$git init
$touch README
$git add README

on computer find the file README and enter the text you want using any text editor

$git commit -m 'first commit'
$git remote add origin git@github.com:/maer/myfile.git
$git push -u origin master

the file README should have the content text now on the github site.

now repeat with your code file
$touch CODEFILE
$git add CODEFILE
on your computer cut and paste the code to the file

now it gets screwy, each time works a bit different (not used to the system yet). I end up using the git GUI on the pc, open the myfile, move the README to commit, move the CODEFILE to commit, then push to origin. I think I have a piece of the code wrong in gitbash--it establishes the file (like you have) but doesn't push the contents to github (like you have). I will try another dummy file later to try and help.
 
Lesson 4.5 Relay discussion and application

DISCLAIMER–I am not an electrician, nor licensed in any way. High voltage can kill you. If you are not comfortable with this, then get help from someone who is. I can't help you if you get "bit" or your grow room catches fire. Safety should be your first priority. I'm an engineer and thoroughly research what I'm doing, usually before I do it..... I am comfortable around AC and DC power and control logic. I will try to show you a bunch of different methods and let you pick what works for you. Good Luck


To control something larger than a LED, you need to use a relay. A relay is a electromechanical device that uses a small voltage/current to control a larger voltage and current. A small electromagnet pulls on contacts to switch the load. Relays are rated by the input circuit (control) and the output (load). You can find relays that have input ratings that match the arduino's 5 volt DC output that are capable of switching large loads. One issue when switching large loads is called inductive kick. Switching on is not the problem, switching off causes a large disruption to the flowing electrons. They want to keep flowing and cause an arc across the contacts when the circuit is broken. There are a couple strategies to mitigate this effect. This usually involves adding a diode across the relay coil to "absorb" this surge. Some ready-made relays have it built in, such as the power switch tail PowerSwitchTail.com

Sometimes a larger relay is called a contactor in this application. I use a large relay to control 3 x1000 watt HPS lamps running on a 240 VAC circuit. You can see this relay in the box next to the Intermatic Heavy Duty timer (which controls 3x1000 watt HPS lamps itself, the relay is "slaved" to the timer). There is also a relay in there for the AC unit.
IMAG02597.jpg


The arduino will only output about 20 ma (milliamps), or 0.020 amps, of current per pin. Most relays require more current to do the switching. The way to get the arduino to output enough is to use some extra components to generate more current for the relays control side. There are several schemes to accomplish this. Check out https://arduino-info.wikispaces.com/ArduinoPower for an excellent explanation of power control.

Another type of relay is a solid state relay (SSR). They usually use a small control to switch a large load. They are not mechanical inside and utilize a light beam to do the switching. They are not as susceptible to inductive kick. They are a little more difficult to find through the surplus markets, but ebay of course has plenty. You just have to wait for shipping from china. These require a similar setup to drive them, even though they say they will control from a 3 volt circuit. Here are schematics of drivers
relay_driver_schem.png

I have heard that SSRs run hot (not sure why) and may require a heat sink on the back. I need to do some testing with higher loads

Here are several relays
DSCN2466.JPG

On top is a SSR and driver circuit rated for 25 amps, on bottom left is a standard mechanical relay rated for 25 amps or 1 HP, bottom middle is a small arduino relay brick rated for 2 amps, bottom right is a small SSR rated for 8 amps. I got these small brick relays online. Search for arduino relay brick, there are a bunch of different sizes. I wouldn't use the small ones at their full capacity. I would use them to control a larger relay to do the load switching. The SSR driver circuit costs about 33 cents.

Here is an example relay box with 4 relays controlling 4 outlets–Yet Another Arduino 110v Power Controller
I am building one of these for my example controller. You will see it along the way.

It is important to talk about isolation. You need to keep low voltage circuts separate from high voltage circuits in most jurisdictions. Electrical inspectors use the National Electrical Code (NEC) or a local variant when doing inspections. You can not have low voltage circuits (arduino outputs) enter or leave a box containing 120 volt AC (house mains wiring). The way around this is to install the low voltage components (and arduino) inside the enclosure with the high voltage, which is not how it is drawn in the example. If your room catches fire, you better be following the electrical code if you want any insurance money.....

I got these relays and transistors from bkbelectronics..... he ships fast and is almost as cheap as china. There are plenty of schematics out there to help you out....Controllable Power Outlet - SparkFun Electronics, 4-Channel Relay Board for Arduino. If you are not comfortable wiring your own up, buy the ready-made bricks and just plug into the sensor shield. You saw how I did my drivers up above. Pic of relay/ driver board.
DSCN2463.JPG

The cost of the relay board is about 3 bucks to control 2, 10 amp circuits.

Picture of relay brick and sensor shield.
DSCN24681.JPG

I would then use the brick to control a larger relay if necessary, it simplifies your wiring, no soldering required.

Next lesson we will discuss clocks, timing and data logging, using a real time clock (RTC) and the data logger shield.
 
OK Maer, I see your DHTtestermod but not sure why it's not in the arduino-based-room-controller repo......I was looking in the folder on the left side of the page....
 
Maer, how many DS18B20 (One Wire) sensors do you have right now. Your code working ok or not? Are you able to see everything change in real time, independently from each other?
 
@PP The question related specifically to the shield wire on the temp sensor. The Hannna web site also mentioned something about inaccurate long term pH reading due to your nute res not being grounded, I will find the reference and submit the questions to Hanna tech support.

@OG Why could PP see it??! I did those bash commands that were in the startup faq, they look mostly like yours.
 
I only have one 1wire sensor the waterproof one for my res, I have 2 dht22s a sensorion temp / humid, the ir range finder and that's it for now.

I also spent some time looking at the depot at the phone equipment and i think it is perfect for this. A punchdown block will allow me to connect 6 data and 2 power pins and then I can pick and choose which 4(or less) to punch where on the RJ11 adapter. This would also help with a 1wire type bus and give me nice clean solid connections from inside to outside of the finished box.
 
@PP The question related specifically to the shield wire on the temp sensor. The Hannna web site also mentioned something about inaccurate long term pH reading due to your nute res not being grounded, I will find the reference and submit the questions to Hanna tech support.

@OG Why could PP see it??! I did those bash commands that were in the startup faq, they look mostly like yours.

I posted later that I could see it, not in the location I expected (different from mine), is the code working ?
 
I asked because your code is looking for 2 DS18B20 sensors (one wire). If it's working, can you screen grab the first page of the serial monitor output. I'd like to see what the first loop through is outputting.....
 
it is working. it is also reporting the sensor as device 1 and 0.

Locating devices...Found 1 devices.
Unable to find address for Device 1
Device 0 Address: 2899B66F03000004
Device 1 Address: 2899B66F03000004

OutsideTemperature: 63.68 *F OutsideHumidity: 67.30
InsideHumidity: 63.20 % InsideTemperature: 65.66 *F
STemperature: 64.66 F, SHumidity: 62.14 %, SDewpoint: 51.42 F
Requesting temperatures...DONE
Device Address: 2899B66F03000004 Temp F: 62.71
Device Address: 2899B66F03000004 Temp F: 62.71

3
OutsideTemperature: 63.68 *F OutsideHumidity: 67.30
InsideHumidity: 63.10 % InsideTemperature: 65.66 *F
STemperature: 64.63 F, SHumidity: 61.69 %, SDewpoint: 51.19 F
Requesting temperatures...DONE
Device Address: 2899B66F03000004 Temp F: 62.71
Device Address: 2899B66F03000004 Temp F: 62.71

3


That is the first 2 full cycles
 
Back
Top Bottom