I’m trying to DIY my own power usage sensor. Right now I’m trying to hand-solder whatever I need. If it works out I will have a PCB made.
I’m trying to connect my own CT (current transformer) directly to a RAK4630 that is sitting on a RAK19003. I can connect it to a WisBlock if necessary, but I like the size of the RAK19003 better.
I have code to read a pin:
#define ADC_PIN A0
int rawValue = analogRead(ADC_PIN);
I do get a value in rawValue, but I haven’t hooked up the CT yet. There are no runtime errors.
Here is my question…
In code, A0 is pointed to 26u. Does that mean I hook up the one wire of the CT to 26 P1.02/SW2 port on the chip? And the other wire to GND (ignoring the burden resistor for a moment)?
(1) Not sure where you get A0 from. On a WisBlock assembly the analog ports are named AIN0, AIN1 and IO4.
AIN0 is connected to a resistor divider to measure the battery voltage / output voltage of the battery charger. Even if you connect your CT directly to the pads of the RAK4630 (not recommended, you void warranty), the CT and the resistor divider will be both connected to A0. You will not be able to read your CT values.
(2) Not sure where you get the 26 == A0
You have two dedicated analog inputs on the RAK4630 (and a third one if needed)