OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Man, love reading your stuff but 95% goes right over my head. (...)
Thanks ! If you like to know more about anything I can explain in more detail, just ask :)

(...) One thing though after 20+ years of tinkering with computers when a "part" doesn't work out of the box just get a different part.
I hope the dongle works.. (...)
Good idea, probably should have done that a long time ago. I hope it works as well ^^

I'll probably try other power supplies as well, since I have an identical spare 12V AC/DC and 5V DC/DC.

(...) Just an FYI. I coudn't find a "872A" ethernet controller ic.
Like I said, in the past.. just switch err "chips" if not stable out of the box.
I have seen that as well, but I'm not sure if and how that's relevant. It does work (sometimes) and the PI does detect it and loads the respective drivers, as verified in the system control messages (dmesg - command).
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Alright, package came early, the USB dongle is recognized, as verified by lsusb in the console.
However, I do not see a respective driver in lsmod.
When i run ifconfig I also do not get a wlan0

Has anybody any experience with enabling these WiFi dongles and making Raspian connect the wlan0 interface via command line ?
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Alright, found out the hard way, that my supposedly RT5370 IC WiFi Dongle is ACTUALLY a RT8188GU IC WiFi Dongle ...
Connected via SSH using PUTTY:
Bash:
pi@reefpi: $ lsusb
(...)
Bus 001 Device 003: ID 0bda:b711 Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (After Modeswitch)

Which is seemingly not supported by Raspian out of the box ^^
Great, I'll try a driver that somebody on GitHub patched together and get back to you. I'll also try and get my hands on a Pi Zero W on Ebay in case the driver doesn't work ...
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Whooooooooooooooooo, it worked ^^

I found out too late, that the GitHub page lists 3 points under Raspberry Pi ... which are 3 different methods of doing the install. The first 2 are actually the worst, as they are dependent on your current kernel and take FOREVER to build on a Pi Zero ...

So I'll migrate just the driver .deb file to my other SD card where ReefPi sits on and try again.
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Wooooooooooooooo, it also works when I use my 5V3A DC/DC converters.

So the problem seems to be that some part of my power setup disturbs the Ethernet connection, either through ripple or introducing some AC or DC voltage between Earth and my circuit's ground.

Only strange thing is, that I was up until now ONLY able to get the WiFi connection when the Dongle is connected through the Adafruit Ethernet Hub, not when I connect it directly to the USB OTG port with an adapter cable o_O
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
I also have a pretty high CPU load, probably due to all the packages for the driver:
1658150247024.png


I'll try my luck getting my hands on a Pi Zero WH, in the meantime the project can continue !
I would however, recommend everybody to get a Pi with a build in Network interface, it's just too much work to get this up and running otherwise.

I do however hope that, if it was caused by power and grounding problems, that this is not coming back to haunt me when I start measuring pH values :rolling-on-the-floor-laughing:
 
Last edited:

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
5,970
Reaction score
3,673
Rating - 0%
0   0   0
Made to Work with Raspberry Pi
Reviewed in the United States on March 13, 2018
After the frustrations of trying to use a similar D-Link WiFi USB adapter on my personal RasPi, I was a bit leery about getting this similar option for my daughter's RasPi, but I am pleasantly surprised that it works perfectly out of the box. Didn't have to mess around with downloading any additional drivers, goofing around on the command line, or enabling any obscure settings. I haven't tried using it on any other platform computer. When I get a chance, I might get another one for me.

Amazon product
:)
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
A7AB3AB0-EB87-48AA-9147-75F72FABC3F0.jpeg

Alright, started my GPIO+PWM output board and already made the first mistakes. Sadly that wasted the two MOSFETs you can see there, because I could not get them off non-destructively.

The pins of the MOSFET are from left to right: Gate-Drain-Source.

So I connected the Gate directly with the green wire to the input that is yet to be soldered to the front. That would make the PI directly drive the Gate, which is a capacitor. In the first moment the PWM switches on, the capacitor acts as a short, possibly damaging the PI over time with very high current bursts. BAD. It will therefore get a 330Ohm resistor, which in series with the gate capacitor will ensure that even when the capacitor is effectively a short, the current won’t exceed 10 mA.

I also connected the Drain to ground with the black wire and the source to +5V with the resistor you can just about see there. Problem: that should be exactly the other way around :grinning-face-with-sweat:
So you should not connect the drain to the draining element (GND) and the Source to the sourcing element (+5V) but rather see the Drain pin as something that will drain (from 5V) and the source pin as something that will source that which is drained.

So I resoldered that. I’ll post pictures of the final version and solution once I’m done soldering the inputs later.
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
D0A08C07-5B65-4E03-BC8B-8B92EA768295.jpeg

Finished the GPIO + PWM-Board(s). It consist of two mint boards, stacked over each other. The connection between them is done with Female and male header pins.

Power is put in on the two right angle pins on the bottom left. That gets slaved through the colored middle lines to the female header on the left upper side and into the inverted make header pins on the upper right side.

3 Temperature ports on the lower left side, all connecting to 5V+GND and a single shared data pin on the left. That get's connected with a double sided male header pin on the upper board on the right side. The temperature probes all get a 16k pull up resistor wired into the connection wire, just to compensate the wire capacity.

1 Flow Meter port on the upper left side with a 5V+GND connection and it's signal. The signal feeds a NPN transistor that connects a 5k resistor to ground. When the flow signal is LOW, the transistor is OFF and the resistor pulls the PI's flow signal, connected between the tranistor and the resistor, to 5V (long white cable connected to the single female header pin on the upper left). When the flow signal is HIGH the transistor will (hopefully) turn ON and pull the PI's flow signal to 0.6V above GND. That's enough for the PI to register this as LOW. I have chosen this, because I use a pulled-up level shifter board for the 5V signal input into the PI's GPIOs (Adafruit BSS 138) and I am not sure how the Hall sensor would react to the current induced on the signal wire from the constant pull-up, so I rather wanted to be safe.

2 PWM ports on the lower right side. The PI's 3.3V PWM signal get's fed in through the 2 blue male header pins and through a 330 OHM resistor into the MOSFET gate. The PWM signal is pulled up by a 5k resistor and gets pulled to GND when the MOSFET is ON. That's why I used a MOSFET here: the MOSFET has a ON-resistance of ~40mOhm. Together with the 5k pull-up this means the signal actually get's pulled down to 5V * 40m Ohm / (40m Ohm + 5kOhm) = 40µV instead of the pretty constant voltage drop over a bipolar transistor, which is basically a diode of about 0.6V

2 Backup GPIO ports on the upper right, basically just +5V , GND and a direct GPIO connection each. I'll send an updated circuit drawing tomorrow.

I also put a block of female header pins on the right bottom side that will act as a switch board for my I2C devices. 4 connected pins for each SDA, SCL, +5V and GND. I have a I2C terminator in there, so I hope the connection will still work ^^
 
Last edited:
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
My PI Zero W has arrived, got it's header pins and was integrated into the Project.
- I set up a new SD card and Reef-Pi instance using @robsworld78's guide to set up Reef-Pi here
- I upgraded to Reef-Pi 5.3
- I installed the FlowMeter script using @robsworld78's guide here

Cut out the connectors for the PWM+GPIO Board:
9611DEFB-CC49-4FFE-BD08-1274795C619A.jpeg

And connected the Temperature probes. They have a cable-internal 16k Pull-up resistor.

I connected the Input-board to the BSS138 level shifter and the PI (see picture below):
- Input board in the foreground
- PWM0 signal on the orange cable
- Temperature Bus on the purple cable
- 2 unused GPIOs on the 2 green cables
- flow meter on the white cable

All go through the level shifter and into the PI through the 4 green GPIO inputs you can just about see in the background on the PI HAT:
E9404ADD-63F7-4B29-8D06-3FAE0733A872.jpeg


Gives a very nice first test:
1658684735659.png


- CPU load is now beautifully below 0.2,
- Both DS18B20 temperature Probes are reading correctly on the BUS line (as tested by touching them one after the other)
- Both temperature probes are reading the same values out of the box up to 2 digits (nice, thx @robsworld78 ^^)
- flow meter reads something ( simulated flow by pulling the signal line up with a 1k resistor) but I need to test that further.
 
Last edited:
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
So, the flow meter input is wired as such:
FlowMeterCircuit_schem.png

So basically:
- Pi on the left
- the level shifter in the middle
----> build from a n-channel MOSFET and one pull-up on each voltage side
- the flow meter circuit on the right
- the flow meter connector on the rightmost side

To simulate I repeatedly pulled up the signal input, connected to the transistor's base, using a 1k resistor. That should pull the signal line down to 0.6V, which should be measureable by the PI.

I also measured the voltage on the signal line to the level shifter, as indicated in the drawing.
Base Voltage drop:
5.08 V
Voltage drop when pulling signal line to 5V with a resistor:
1k Ohm:
4.25 V
100 Ohm:
4.4 V
66k Ohm:
~3.9V

So I started with the 1k, started wondering if the resistor was too high and tried a 100 Ohm one, got confused because the voltage went up, not down, and then tried the 66k resistor. No idea what's happening there ^^

You can see the wiring 2-3 posts up here and the Transistor is a PN2222 with it's datasheet here.
So judging from that I wired it correctly, Emitter to Ground, Base to the Flow Sensor Signal line and Collector pulled up to 5V and connected to the PI's signal line via the level shifter.
 
Last edited:
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
I think I know why the flow circuit doesn’t work as expected.
As mentioned, when I activate the npn transistor in the circuit drawing above with the 1k pull-up to the base, the voltage on the signal line only drops from the pulled up 5.08 V to about 4.4V, which isn’t enough to register on the PI.
The pull up on the PI’s signal line is comparatively weak, only about 3k on 5V, so I could at best only get around 1mA current through the transistor. According to the datasheet of a similar 2N3904 npn transistor the input impedance is actually quite high at these small Collector currents.
I’m therefore going to try to change a few of those resistor values to see if that improves.

So the lesson here is: use a MOSFET for low current signals XD
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
I think I know why the flow circuit doesn’t work as expected.
As mentioned, when I activate the npn transistor in the circuit drawing above with the 1k pull-up to the base, the voltage on the signal line only drops from the pulled up 5.08 V to about 4.4V, which isn’t enough to register on the PI.
The pull up on the PI’s signal line is comparatively weak, only about 3k on 5V, so I could at best only get around 1mA current through the transistor. According to the datasheet of a similar 2N3904 npn transistor the input impedance is actually quite high at these small Collector currents.
I’m therefore going to try to change a few of those resistor values to see if that improves.

So the lesson here is: use a MOSFET for low current signals XD
Nice to see things coming along, boards looks great! For the hall effect flow meters you don't need any circuit, just a couple resistors to drop the 5v down to 3.3v for the Pi like this.

 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Nice to see things coming along, boards looks great! For the hall effect flow meters you don't need any circuit, just a couple resistors to drop the 5v down to 3.3v for the Pi like this.

Thanks, I know, I simply wanted to use the level shifter board on all of the 4 GPIO pins to make it cleaner and more Modular. Guess I now pay the price for that ^^
I was however concerned how the sensor would react to the permanent pull-up the level shifter imposed on the signal line, so I added the transistor.

Do you by any chance know how the hall sensors are typically wired internally ?
I read a forum where the specific hall sensor that was discussed had a internal transistor that somehow pulls the signal wire to VCC. Makes sense, since I would otherwise not expect the sensor to give a defined voltage profile relative to VCC at all voltages between 5-24V
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Thanks, I know, I simply wanted to use the level shifter board on all of the 4 GPIO pins to make it cleaner and more Modular. Guess I now pay the price for that ^^
I was however concerned how the sensor would react to the permanent pull-up the level shifter imposed on the signal line, so I added the transistor.

Do you by any chance know how the hall sensors are typically wired internally ?
I read a forum where the specific hall sensor that was discussed had a internal transistor that somehow pulls the signal wire to VCC. Makes sense, since I would otherwise not expect the sensor to give a defined voltage profile relative to VCC at all voltages between 5-24V
Ah I hear you, makes sense why you tried the NPN, I think you're right the pullup resistor is messing it up as it requires a pulldown. Maybe the NPN doesn't switch fast enough, sorry can't help much here. Not sure how the sensors work, I have a clear one and the small circuit board doesn't have much on it.
 
OP
OP
S

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
Ah I hear you, makes sense why you tried the NPN, I think you're right the pullup resistor is messing it up as it requires a pulldown. Maybe the NPN doesn't switch fast enough, sorry can't help much here. Not sure how the sensors work, I have a clear one and the small circuit board doesn't have much on it.
Yeah, I saw one opened on a webpage. It’s basically a Hall sensor IC with a pull-up resistor on the signal line. Similar to this datasheet.

So im actually guessing that I can probably just connect my pulled up level shifter to the signal line and the sensor should pull it down :D
 

OfficeReefer

Well-Known Member
View Badges
Joined
May 25, 2020
Messages
665
Reaction score
507
Rating - 0%
0   0   0
The current status can now be found on GitHub

You will find an overview of the current status and discussions with links.
Also includes comprehensive Links to Sources/Guides, Schematics and Pictures reporting on the progress.

I will post progress reports and pictures here as well.
Why did you put this on a git repository?

@Ranjib already built the code you are using, are you expecting to fork his code and do your own?
 

OfficeReefer

Well-Known Member
View Badges
Joined
May 25, 2020
Messages
665
Reaction score
507
Rating - 0%
0   0   0
prometheus is the central time series database, and installed separately on x86 machine (preferably). I use a mini pc to run prometheus+grafana. Only node-exporter is installed on pi which provides all those tcp stats through an http end point. The central prometheus server is configured to scrape the data from node exporter (from on or many pi's). This is the same mechanism used to for reef-pi integration (reef-pi exposed all metrics under an endpoint, which prometheus central server then scrapes) . Grafana can be installed in another machine, but i colocate on the same mini pc as the promethues, and configured to talk to the prometheus server as data source. Grafana provides the visualization of those time series data.
This stack is very similar to a large web company (cough cough)....that is retrofitted to work on home setup :) . Its bit complex, but its as (if not more than paid solutions) advance and powerful mertics/telemetry stack as you can get (through FOSS).
Yes, I agree it's pretty simple. Like all tech, there's many ways to do something.
 
Back
Top