Sebs reef-pi Build

Sebastian Stankiewicz

New Member
View Badges
Joined
Jan 15, 2019
Messages
12
Reaction score
19
Rating - 0%
0   0   0
I am currently finishing up a build that I have been working on. The controller box includes the following parts:
qchl1i9jjt8dg2n-FQFma_kf9LOgPUjxIlsIJyCIn2lRf7iQsjqHeHUlXbpdIjCXRAWaxCi4kdApn8mfUSF8N9c5Vms4tFNI2lSAMam6YnKfVAvNIfsqMP9svoyc6t9elDXNF_4S61A=w2400

NNwfCfUv61kR6AKkSV1IIfPZXGTry4yz2jc6MS5C8yYf2u55u26EuZbJEoRn6GZ5ViVdgwA-5JWkHS_GS_ahSs6aLxBTr2PnbEn2FX17i1qxIpe8W1aeSOOi4YUbJ0tAop-b7OGkYq8=w2400

This is my first time working with DIY electronics, so I dont yet have a soldering iron. The pH and temperature sensors are working, but I cannot get the motors to work with the reef-pi software. I have gotten the motors to move via the equipment tab, but was never able to configure the jack or pwm output pin. The motors have no problems working when they are run via python, but they will not work with the reef-pi software. I have followed the instructions here https://learn.adafruit.com/reef-pi-guide-5-dosing-controller, but no luck. From what I understand, I need to adjust the pins via dtoverlay so that the rpi is the controller. I have had no luck in this process, and desperately need help. I have gotten some input from another post, but I don't think that I am using the correct dtoverlay line of code. The pin output for the raspirobot is as follows:
RIGHT_PWM_PIN = 14
RIGHT_1_PIN = 10
RIGHT_2_PIN = 25
LEFT_PWM_PIN = 24
LEFT_1_PIN = 17
LEFT_2_PIN = 4
SW1_PIN = 11
SW2_PIN = 9
LED1_PIN = 8
LED2_PIN = 7
OC1_PIN = 22
OC2_PIN = 27
OC2_PIN_R1 = 21
OC2_PIN_R2 = 27
TRIGGER_PIN = 18
ECHO_PIN = 23

@Ranjib @Diamond1 @b4tn
 

Diamond1

Valuable Member
View Badges
Joined
Oct 17, 2013
Messages
1,368
Reaction score
1,911
Location
Cleveland Ohio
Rating - 0%
0   0   0
I have been trying to do some research on the board your using. Will look into it some more tonight to see if we can get this figured out.
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,242
Location
Columbia MD
Rating - 0%
0   0   0
I am having a hard time understanding the pin outs that you have listed. The Rpi only has 2 unique PWM channels on GPIO 18 and 19 which are also mirrored IIRC GPIO 13 and 14. It gets confusing at times but keep in mind that the pin numbers do not match the GPIO numbers but many refer to GPIO as pins which makes things confusing. Do you have any documentation of the raspirobot board? I can seem to find anything that shows what is connected to what on the header? The website has a schematic but github is partially blocked from my work network lol.

pi-pinout-diagram-01.png
 

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,649
Location
SW, FL, USA
Rating - 0%
0   0   0
Ask and you shall receive... schematic...
 

Attachments

  • RRBv3.pdf
    35.1 KB · Views: 165

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,649
Location
SW, FL, USA
Rating - 0%
0   0   0
I am having a hard time understanding the pin outs that you have listed. The Rpi only has 2 unique PWM channels on GPIO 18 and 19 which are also mirrored IIRC GPIO 13 and 14. It gets confusing at times but keep in mind that the pin numbers do not match the GPIO numbers but many refer to GPIO as pins which makes things confusing. Do you have any documentation of the raspirobot board? I can seem to find anything that shows what is connected to what on the header? The website has a schematic but github is partially blocked from my work network lol.

pi-pinout-diagram-01.png


In case you cannot get the .pdf above...
SCH.jpg
 

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,649
Location
SW, FL, USA
Rating - 0%
0   0   0
I am currently finishing up a build that I have been working on. The controller box includes the following parts:
qchl1i9jjt8dg2n-FQFma_kf9LOgPUjxIlsIJyCIn2lRf7iQsjqHeHUlXbpdIjCXRAWaxCi4kdApn8mfUSF8N9c5Vms4tFNI2lSAMam6YnKfVAvNIfsqMP9svoyc6t9elDXNF_4S61A=w2400

NNwfCfUv61kR6AKkSV1IIfPZXGTry4yz2jc6MS5C8yYf2u55u26EuZbJEoRn6GZ5ViVdgwA-5JWkHS_GS_ahSs6aLxBTr2PnbEn2FX17i1qxIpe8W1aeSOOi4YUbJ0tAop-b7OGkYq8=w2400

This is my first time working with DIY electronics, so I dont yet have a soldering iron. The pH and temperature sensors are working, but I cannot get the motors to work with the reef-pi software. I have gotten the motors to move via the equipment tab, but was never able to configure the jack or pwm output pin. The motors have no problems working when they are run via python, but they will not work with the reef-pi software. I have followed the instructions here https://learn.adafruit.com/reef-pi-guide-5-dosing-controller, but no luck. From what I understand, I need to adjust the pins via dtoverlay so that the rpi is the controller. I have had no luck in this process, and desperately need help. I have gotten some input from another post, but I don't think that I am using the correct dtoverlay line of code. The pin output for the raspirobot is as follows:
RIGHT_PWM_PIN = 14
RIGHT_1_PIN = 10
RIGHT_2_PIN = 25
LEFT_PWM_PIN = 24
LEFT_1_PIN = 17
LEFT_2_PIN = 4
SW1_PIN = 11
SW2_PIN = 9
LED1_PIN = 8
LED2_PIN = 7
OC1_PIN = 22
OC2_PIN = 27
OC2_PIN_R1 = 21
OC2_PIN_R2 = 27
TRIGGER_PIN = 18
ECHO_PIN = 23

@Ranjib @Diamond1 @b4tn


@Sebastian Stankiewicz - it looks like you are using the black wire as the "v+" wire coming from your power supply. Is this correct?
 

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,649
Location
SW, FL, USA
Rating - 0%
0   0   0
@Ranjib will have to step in and confirm but I dont think this will work with reefpi. I am pretty sure that reefpi can only use GPIO 18 and 19 for PWM and this uses GPIO 14 and 24. Also its taking up the pin required for temp control.

I did not want to be the bearer of bad news but that is what I was thinking too.
 
OP
OP
S

Sebastian Stankiewicz

New Member
View Badges
Joined
Jan 15, 2019
Messages
12
Reaction score
19
Rating - 0%
0   0   0
@crusso1993 @b4tn I wish I had known about reefpi earlier. I guess now I will just have to control the doser pumps manually and will just get readings of everything displayed within the reef-pi software. Its a bummer that I spent $30 bucks on one of those raspirobot boards, didn't have the right purpose in mind.
 

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,649
Location
SW, FL, USA
Rating - 0%
0   0   0
Is there anyway that I can just use wires to connect the raspirobot to the raspi? Connecting 14 to 18 and 24 to 19?

@Sebastian Stankiewicz - It's not mine but, I will tell you if it were, I'd give it a shot.

Send it back, get a reef pi hat, Mike Lane, Theatrus and Wykat all make a good hat, research them and see what hat fits your needs!

I also second what @Bigtrout said above.

Hopefully, @Ranjib will offer some input.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
I think the problem is, the raspirobot was made for the original raspberry pi with the 26 pin gpio, i looked the pinout up and its a match for the raspirobot hat.
The newer raspberry pi have 40 pin gpio, and of course the pin layout is different.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,847
Reaction score
17,077
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
there are lot of things going on in this thread, i need some time to understand this. All the pin (including GPIO18 and 19 for pwm, and GPO4 for temperature) can be configurable via /boot/config.txt , and reef-pi does not need to be aware of it (for it its all pwm0 and 1). I dont have any idea about the other board, will take a look at that when I am home.
 
OP
OP
S

Sebastian Stankiewicz

New Member
View Badges
Joined
Jan 15, 2019
Messages
12
Reaction score
19
Rating - 0%
0   0   0
@Ranjib well if I can just configure the boot overlay to change the gpio pins to pwm, then the raspirobot should still work? Does anyone know much about the dtoverlay code? Ive read some stuff here:
https://dev.seemoo.tu-darmstadt.de/...8425703f8f7/kernel/arch/arm/boot/dts/overlays
There is a section where it talks about the different pwm pins, but there is says that pwm0= gpio pins 12 and 14 and pwm1=gpio pins 18 and 19. I am not sure what the functions are that are assigned to each pin. Here is another article about changing pins:
https://librpip.frasersdev.net/peripheral-config/pwm0and1/
 
OP
OP
S

Sebastian Stankiewicz

New Member
View Badges
Joined
Jan 15, 2019
Messages
12
Reaction score
19
Rating - 0%
0   0   0
In case anyone is interested. I wrote a small program to control the pumps that were not communicating with the reefpi software. It automated the phing process for me.

def ph_reading():
device = atlas_i2c(99)
ph_value = device.query("R")
return ph_value

def job():
ph_set = 5.5
print (ph_set)
while True:
curr_ph = round(ph_reading(), 1)
print("Current pH: %s" % curr_ph)

if 5 >= curr_ph <= 6:
break

elif curr_ph >= ph_set:
# Turn on pump supplying acid_pump
rr.set_motors(0,0,0.8,1)
print("Dispensing acid...")
time.sleep(3)
rr.stop()

time.sleep(60*3)

schedule.every(5).minutes.do(job)

while True:
schedule.run_pending()
time.sleep(1)
 
Back
Top