Get your Geek on and control your grow room with Arduino!

Timezone

Well-Known Member
I was looking at those and wondering how they worked for connecting the different components. Do you have to use wires underneath to connect or break the copper connections where you don't want them? My ignorance abounds! lol
No, you got it right, you do both. On the green boards above, you wire between components, the brownish board has groups of five holes connected together to make interconnections easier. They wire the same way, just uses less wiring. On the full strip board, not shown, you do have to cut the traces to interrupt signal flow. Check out this on Stripboard.

Not finding a suitable substitute for my PCB but have yet to plumb the depths of the junk around here.
How about Radio Shack?
 

Timezone

Well-Known Member
Stupid wall mount fan won't come on when plugged into my light timer power bar. Have to push the power button if the power is interrupted so I think I can open it up and just bypass the power switch then it should turn on when the timer flips on the light. Another PITA. :)
That can make trying to control things really hard to do, having to push a button every time the timer turns on. Or a reset. Maybe a plunger type solenoid over the button... :)
 

OldMedUser

Well-Known Member
How about Radio Shack?
No such thing anymore. Called The Source now and don't have much in the way of components. I checked last night. The Radio Shack up here changed to All Source andhave no connection to RS or The Source. I do recall seeing breadboards there and a few other things but that was a while ago and I wasn't looking for stuff like that at the time.

I just checked at Amazon and there's a 100pc kit for cheap so might add that to my Cart to get it over $35 and hit Send!

 

ChiefRunningPhist

Well-Known Member
I've a chart built in excel that I'd like to transfer to the esp32. I'm not sure how to compile or convert the data into arduino. Its a rather large data set and the chart is active and updated by only a few fields in excel, while all other cells are used for place holding and computational purposes. Im thinking I'll need to add memory to the esp32 and store the file there, like a peripheral sd card, because I'm using the existing memory on the dev board for the HTML page of the webserver. If anyone has any insight or pointers, please do post, thanks.

First glances looks like I'll need to have some java experience along with HTML and C/Arduino. I'm pretty beginner in all.

The broader goal is similar to one or 2 of the designs posted here already. Using a web interface to update and control various functions on the esp32. I'd rather use the screens and tech found in cellphones than build extra LCD screens and control ccts that some designs use to signal an MC.
 

ChiefRunningPhist

Well-Known Member
I've been working on something similar for my grow. Decided to go with the raspi, basically have two four outlet electrical boxes side by side. The first has the relays, the second has 8 outlets. Used the 7" touchscreen display in portrait mode for basic functionality. Four screens which can be swept between. First is a history of the temp and humidity displayed over 1,2, or 7 days. I used the dht22 for the sensor.
View attachment 4456047

Second is the main screen and displays from top to bottom: The date and time. Readings from the three temp/humidity sensors and the min/max since the last reset. A button for resetting the min/max to current values. A list of the current relay states - a tap on the on-off button turns the outlet on or off. Tapping the name, allows you to customize the name. The two bottom devices are variable voltage out with 5 speeds for my pwm fan controller. Bottom of the screen is a list of rules that are executed from top to bottom. The "i" beside the one rule means it is currently inactive
View attachment 4456048

The rules can be added or edited in a simple dialog.
View attachment 4456051

Last two pages are calendars. Text can be added to the days and the title can be changed by tapping on them. The calendars can be loaded and saved for future reference. Two calendars because 4 plant limit = 2 plants in veg and 2 in flower always.
View attachment 4456052

I can upload the code/schematics somewhere if anyone's interested. Also for the pwm motor controllers, and for a dosimeter/nutrient liquid dispenser. But if you're tech savvy I basically used the max595 to shift out to the relays or resistor ladder for the variable voltage out. This allows the pi to be power cycled without losing the outputs momentarily. The goal is to build a power manager / power supply that can be in communication with the pi and that either can reset the other if things go weird. The dosimeter is literally the circuit from the 555 datasheet on the back of a relay x 4.
I'm building a power supply right now with good power factor and efficiency as my main goals. I was trying to develop an arduino program that would control the power factor correction cct, but I think I'm just going to use a dedicated controller. I'm not sure exactly what you're building (you use the max595 to take over while the raspi cycles?) but if you're developing a power supply over 75W we may be on similar paths. Cool project btw, I'd like to use cellphones but essentially what you've built with your raspi + LCD is pretty much what I'm looking to build with an esp32 + web interface.
 

ChiefRunningPhist

Well-Known Member
Idk Chief, maybe someone has a suggestion?

That's kind of what I'm doing only I'm using a Pi to do the computing required to control everything, as well as data storage on a 32G usb drive, and display and user interface.
Hmmm I went with the esp32 over the raspi initially due to price, but I didn't see the raspi zero, maybe it'll be enough. Don't know much about any of it. Im not partial, I just was trying to route control and graphics through a cellphone.

Are you using python for your raspi? Or how are you coding it?
 
Last edited:

ChiefRunningPhist

Well-Known Member
Heres an example using the protoboard instead of a breadboard. You solder your traces on the back of the protoboard after you've pushed your "through hole" (TH) components in. You can solder jumpers also. You can use a straight edge and snap the protoboards in half or snap/break them along the perforations/holes to any size you need to start out with. Kinda like skoring sheetrock and snapping at the skor, but with protoboard no skoring is needed.
0115200904.jpg
Here you can see where I scratched away some of the copper on the back of the protoboard just to be safe that there wasn't any conduction between the traces I was a bit uncertain of...
0115200904b.jpg
This little board was originally being used to test LED ccts, its a rudimentary capacitive dropper. It was wrapped in electrical tape so to isolate the user from the energized cct. I don't use it anymore, if I were to use it Id want to add a fuse, maybe a MOV, ect. You have to be careful with un-isolated mains power supplies, that's one reason transformers are so widely used, isolation from mains.
0115201014a.jpg
USER_SCOPED_TEMP_DATA_orca-image-1585102207.jpeg_1579117268278.jpeg

Breadboard is great for testing your schematics because you don't need to solder, just push your components into the breadboard and then use jumper wires to connect it all together. Each row is isolated from the next but the holes in each row are all connected together with a metal trace hidden under the holes in the breadboard, they are not very visible from looking down through the holes, but maybe you'll see a bit of a metallic shimmer at the right angle.
0115201017.jpg
Here on the left, 2 little breadboards are linked together to build a bigger cct, the breadboard on the right has an esp32 on it with several LEDs being PWMed by the ESP32 via a seperate power source and switching MOSFETs on/off (PWM) to allow the other power source to power the LEDs. The gate of each MOSFET is linked to a different GPIO...
0115201017a.jpg

Looking at someone else's breadboard will be confusing, especially at first. Same with schematics. Most times people design a cct or schematic and then explain how it operates in steps when posting online or even in the data sheets it gets explained thoroughly. I guess what I'm saying is don't feel bad if you don't know what's going on in a cct when you first look at it, break it down into its baser components that you are aware of and read the descriptions on how the cct works to gain an understanding. Pretty much everything is made up of resistors, capacitors, diodes, inductors, and transistors. You arrange these base components in different configurations using different quantities, different sizes, ect. These little groups of components or ccts then get strung together to create more complex ccts. You'll see block diagrams in data sheets, most every block or shape will be representing a small cct, and all these smaller ccts are connected together to provide the end user with the final product. The SSR I saw someone writing about is actually a cct, its not just a simple component but an entire cct with all sorts of components ect, you can build them yourselves if you wanted.

EDIT (more stuff on capacitive droppers):
If your mains is 120VAC and 60Hz, then 0.04524 × μF = Amps of constant current. Otherwise if your mains is not 120VAC, then use the capacitive reactance formula to determine how much current will flow.

Capacitive reactance = 1 ÷ (2·PI·Hz·F)

PI = 3.14...
Hz = mains frequency, ie 50Hz or 60Hz
F = farads, need to convert the μF into F, ie divide μF by 1,000,000.

In the posted cct, there's 8 capacitors in parallel (typically only 1 or 2 are used but I needed all the caps I had to achieve ~50mA of constant current, I could have just used 1 cap rated for 1.08μF but all the safety capacitors I had were very small so I had to wire them in parallel to make a bigger "X2" capacitor, "X2" is a safety capacitor) which means you'd add all the capacitors capacitance up together to arrive at a total capacitance to determine the current flow. I only had 8 safety capacitors (X2 style) laying around, 5 × 0.15μF, and 3 × 0.11μF. Together they add up to 1.08μF. The 0.11μF caps didn't state 0.11μF, rather they were rated in Joules, so I found their 0.11μF capacitance using algebra.
0115201031a.jpg

Capacitive reactance = 1 ÷ (2 × PI × Hz × F)

2 × PI × 60Hz × 0.00000108F
=
0.00040715

1 ÷ 0.00040715
=
2,456.1Ω

Ohms law:
V = I·R
V/R = I


120VAC ÷ 2456.1
=
0.0488A; 48.8mA

The cct will flow 48.8mA regardless the load. The current will begin to drop as the load voltage increases. If you had 1 LED then 48.8mA would flow, if you had 10, then almost 48.8mA would flow, but once you start getting into high voltages needed, like if you had 30 LEDs in a row then the current will drop even more depending on the size of the capacitor. You'll want some way to limit in rush current so that if you coincidentally energized the cct at peak mains voltage your LED or LOAD won't blow, like perhaps some series resistance possibly.
 
Last edited:

Timezone

Well-Known Member
Heres an example using the protoboard instead of a breadboard
Thanks for this great prototyping example and explanation.

You have to be careful with un-isolated mains power supplies, that's one reason transformers are so widely used, isolation from mains.
To be a little more specific, when working with mains power, use an isolation transformer such as this,


true isolation transformer. There are a lot of look-alikes that are not true isolation transformers like this,


non-isolated transformer from Amazone.

The isolated output provides galvanic isolation that protects from electric shock, and power transmission between circuits. The isolation transformer is not a cure all and there are still ways to electrocute yourself. That's why, This will be for educational purposes only, not a guide or how to. If you try any instruction here, you do so at your own peril. Some of the discussion concerns mains power which can be fatal. Be Ye Forewarned!

Breadboard is great for testing your schematics because you don't need to solder, just push your components into the breadboard and then use jumper wires to connect it all together. Each row is isolated from the next but the holes in each row are all connected together with a metal trace hidden under the holes in the breadboard, they are not very visible from looking down through the holes, but maybe you'll see a bit of a metallic shimmer at the right angle.
Here's a good article on breadboards, and how to work with them. It's long but complete and worth a look.

Looking at someone else's breadboard will be confusing...
I'm confused after all of that, I was writing this and about to respond when you added more. Let me reread...
 

Timezone

Well-Known Member
P4030199.JPG
Here's my prototype for the black box shown earlier. On the left of the breadboard, is a self contained 5Vdc and 3.3Vdc power supply and the DHT22. On the right is an ESP8266-12E. In the middle is a multiplexer that allows eight adc devices on the 8266, which only comes with one, and an eight channel level shifter. Above the board is one of seven soil moisture sensors and below is my CO2 sensor (0 to 5000 ppm).

This little board was originally being used to test LED ccts...
What is cct?
 

ChiefRunningPhist

Well-Known Member
Thanks for this great prototyping example and explanation.


To be a little more specific, when working with mains power, use an isolation transformer such as this,


true isolation transformer. There are a lot of look-alikes that are not true isolation transformers like this,


non-isolated transformer from Amazone.

The isolated output provides galvanic isolation that protects from electric shock, and power transmission between circuits. The isolation transformer is not a cure all and there are still ways to electrocute yourself. That's why, This will be for educational purposes only, not a guide or how to. If you try any instruction here, you do so at your own peril. Some of the discussion concerns mains power which can be fatal. Be Ye Forewarned!


Here's a good article on breadboards, and how to work with them. It's long but complete and worth a look.


I'm confused after all of that, I was writing this and about to respond when you added more. Let me reread...
Nice, that's a variac, or a variable voltage transformer. I don't have one yet. :/

Here's an example of some transformers used in smaller electronics..
HF transformer (high frequencies, 1kHz+) can be very small, for high power density...
HTB1PbvBqgoQMeJjy1Xaq6ASsFXai.jpg

Traditional transformer (50-60Hz) much larger, being less and less common...
s88-3731p01wl.jpg

Transformers come in all sizes, cm2 to the big metal cans that you see on telephone poles. All transformers operate by induction. Current flows through a wire and creates a magnetic field and then when another coil of wire is placed in the mag field created by the first coil with current flowing through it, then voltage/current is induced into the second coil. In the transformers posted, the 2 coils of wire are wrapped around the center of an E-core, 1 coil wrapped first, then another coil wrapped on top. The E is the core, but the 2 coils never touch or electrically conduct to each other. The wires making up the coils don't conduct to the core or touch the core either (its magic lol). This means theres no electrical connection going from the energized coil into the second coil. Only a magnetic field is connecting the 2 coils. So you're isolated from the input power, or mains.

A transformer is typically 1 of the first components that mains goes through before heading on down to the rest of the cct. If you were using a capacitive dropper that doesn't require a transformer, then anywhere in your cct you'd have the possibility of having lots of power flow through, if any component failed or you touched/probed the wrong part of the cct you could potentially be directly connected to mains, if you were touching a hot cct with failed components or you were providing a path of conduction with your hand, it would be like sticking your fingers in a socket, it would not be good. Transformers are typically used to step down the voltage in electronics, and your body, blood, skin, ect has a certain resistance to flow current, so if you've stepped the voltage down first then your at less risk of flowing current through your body if you were to accidentally touch the wrong spots, vs if you didn't use a transformer and touched the wrong spots, then your body would be in direct contact with a much higher power source.

The coils have certain resistance associated with them, so if a coil flowed more current than it could handle or was rated for, the coil will melt and then the cct stops working. It would act like a slow burn fuse. "Mains" is just a word for what comes out of the wall socket. If the cct were shorted then the coil would melt and after its deterioration the cct can't possibly flow any more current or very little current depending on how it melted. The components after the transformer would most likely be fried unless there was some sort of power limiting capable of handling the surge that melted the transformer, but most likely all of it would be fried.


E Core...
ich-0p-45224-kit.jpg
ich-0p-45224-kit_2.jpg

With coils wound...
ferrite-core-transformer-250x250.jpg
 
Last edited:

ChiefRunningPhist

Well-Known Member
View attachment 4456998
Here's my prototype for the black box shown earlier. On the left of the breadboard, is a self contained 5Vdc and 3.3Vdc power supply and the DHT22. On the right is an ESP8266-12E. In the middle is a multiplexer that allows eight adc devices on the 8266, which only comes with one, and an eight channel level shifter. Above the board is one of seven soil moisture sensors and below is my CO2 sensor (0 to 5000 ppm).


What is cct?
cct = circuit

That looks cool, nice project, does it output to the serial monitor or where do you display your data?
 

Timezone

Well-Known Member
Nice work on transformers. I was referring specifically to isolation transformers which can save one's life. @OldMedUser has a variac though I don't know if it isolates the output or not. I hope not to get into mains too much as too much chance of injury. The only transformers I've had to use so far are the current transformers, CTs, that measure electrical consumption in each of my boxes.

Really bad photos of my interface. This is provided by Node-RED...
P4270225.JPG
an older version...

P1150296.JPG
the latest version has the electrical consumption on the right.

P1150299.JPG
Once the settings are set, they will become the default settings whenever powered up, but you can adjust at any time.

P1150304.JPG
This is the Node-RED part...

I gotta step out, BBL.
 

OldMedUser

Well-Known Member
What am I getting myself into here!

I'm having a hard enough time laying out a little schematic for my 4 component circuit much less build a rat's nest of wires and parts like those above. lol

Did some hunting on old circuit boards for the diode I need and found one that for sure will work. And went thru my new 2600 pack of resistors and found the 43 and 430ohm one so all I need now are the LM334Z chips that should be waiting at the PO now. Too cold at -35 today, (-38.1 for a new record low here last night since 2009).

Found a site to look up the diodes and other parts that gave me the info I needed. Small signal diode. Was hard to find that out for sure on other places I tried.


CircuitParts01.JPG
 
Top