Motherboard Sensors and Wiring


#1

I started connecting my PH and EC sensor boards to the Ardunio Mega. I am measuring at the input to this board around 4.5 Volts. The sensors indicate the closer one is to a true 5Volts the more accurate the sensor measurement. Currently my Arduino is powered directly from the USB port which comes from the RPi. I believe this to be a mistake. Instead a separate wiring from the main 12V supply could be connected to the DC barrel jack of the mega.

Is anyone else seeing around 4.5V on their megaboard across the VCC and GND pins at the sensors?


#2

I just noticed my attempt to save money on the Light Sensor did not pay off. The Grove sensor is 5V , there are many units on Amazon that claim the same model, however they are only 3.3V. Please be careful during the ordering process.


#3

The reason the mega is powered from the rpi is so that you can communicate with and power the mega at the same time. You aren’t supposed to have USB power and power in the barrel jack at the same time (according to Arduino) so to power from the barrel jack, the USB would have to be disconnected. You could build a separate circuit with a transistor where the Arduino can switch a designated 5V line to give the sensors closer to 5V. The 4.5V could be coming from the rpi output or from the Arduino power regulator.


#4

@dan thanks for the reply. I am looking into a linear regulator that can step down the 12V, to 5V. Using some additional relays, I could flip that power on and off as needed for Ph and EC sensing.

on a side note. the Light Sensor I bought does operate. However, when I connect it into the circuit with the Mega/Proto/Grove shield… the serial output continues to indicate timeout condition. I have the sensor strapped to match the i2c address 0x29. And proved the sensor does work with my Arduino Uno and the test code. Just providing an update here… as always the debug continues :slight_smile:


#5

Hey @JoshSinykin Sparkfun offers a variety of voltage regulators: https://www.sparkfun.com/products/107

They burn through power but for low current applications its a pretty good option.

Regarding the light sensor, are there any other I2C devices on the bus? There may be address competition. Also check that the I2C pins (SDA, SCL) are connected on the mega proto grove shield. Their position on the mega is different than their position on the uno.


#6

@dan no other I2C sensors are on the bus I am using I2C Header from the grove shield which is stacked on the proto, which is on the Mega… havent had time to circle back on this. One idea I had was to take my Arduino Uno and put it on another I2C header and use it as bus monitor. Just to make sure address and data cycles are occurring properly.


#7

Double check the wire connections when you have time. Also doesn’t hurt to make sure that the data/address is functioning properly.


#8

@dan, did you need to populate P1 and P2 on the grove shield?


#9

@dan solved it…

turns out the grove shield has two options to route SCL and SDA. The current pathway, goes to these pins… which just so happen to not line up to a header.


Running custom fixtures/Sensor output as topic
#10

A good reference on this for others:

Cliff note version:
If you are using an Arduino Mega, SDA is pin 20 and SCL is 21

So… just need to do some wire wrap from those pins to pin 20 and 21.


#11

Yep! I’ve encountered that problem before with another shield. R3 of the Mega has the SDA SCL in a different spot.


#12

Glad you figured it out


#13

I designed and just received a pcb that replaces the base shield, proto shield, and one relay pcb. I’ll test them over the weekend and they should be available as blank and assembled pcbs on May 2 (blanks) if anyone is interested in saving time and money.


#14

@dan @JoshSinykin I changed some sensors/actuators on my PFC, and because of that, I needed more current than the USB power supply could provide. I did some research and found out this post with detailed information on Arduino powering.

According to it, the Arduino can be powered from the jack or Vin and still be connected to USB for serial communication. When this happens, the voltage coming from the USB cable is ignored.
I have tested it with a 7.5V external power supply and it is working well.


#15

Awesome, I wasn’t aware of that!


#16

@JoshSinykin While debugging the sensors and actuators, we found one issue with the AC switching (relay). The humidifier (AC1) and the grow LEDs (AC2) are activated/deactivated through D8 in the proto-shield, and there is no way I can turn them on/off separately. Is this an error or both actuators are supposed to work together. Looking into the code in Arduino, I see this:
ActuatorRelay actuator_relay_light_panel_default(8, “ALPN”, 1); // AC port 2
ActuatorRelay actuator_relay_air_humidifier_default(9, “AAHU”, 1); // AC port 1

I am a bit confused with the number 9 (pin) here … any insight on this?


#17

The Pin 8 and Pin 9 maps to the pin label on the Arduino Mega Shield. These two pins however are consumed by the groove Shield that you place on top of the Mega prototype shield that provides the groove connectors. You will notice the Groove shield has unique connectors.

I suspect the reason both D8 and D9 signals are firing on your actuator is probably due to the fact you did not break the black wire bridge on the actual electrical outlet. Or your wiring to the relay is off in position locations. I am able to independently control the humidity from the grow panel.


#18

@JoshSinykin thank you, you were absolutely right ! I forgot to break off the tab connecting the hot screw terminals of the sockets. Now, I finished debugging and ALL sensors and actuators work well. Next step: get the rPi up and running. We just finished all the parts of the PFC so we are close to start farming.

Thank you!

Rafa


#19

Glad I spotted this post as I’ve spent all day trying to get a sensible signal from the TSL2561. Haven’t tried it yet but have put the jumper leads in. gordonb is looking for help getting the code working for this sensor to be used in the version 2 software over on the , Hackers needed: help run 2.0 software on 1.0 HW thread. There aresome instructions on how to set up the openag_brain and the openag_python software so that you can integrate the TSL2561 driver software into v2. I’ve been looking at the Adafruit routines so hope this gets the sensor up and running. Thank-you.


#20

Hi…i am a new user here. As per my knowledge the mega is powered from the rpi is so that you can communicate with and power the mega at the same time. You aren’t supposed to have USB power and power in the barrel jack at the same time so to power from the barrel jack, the USB would have to be disconnected. You could build a separate circuit with a transistor where the Arduino can switch a designated 5V line to give the sensors closer to 5V.