Raspberry Pi Zero W - Arduino Uno


 

Jay H

TVWBB Member
I just receive a Raspberry Pi Zero W and decided to try and throw something together with parts I already have as a sort of proof of concept. I’ve got the RPi Zero W connected to an Arduino Uno Rev. 3 and was able to load "snapshots/trunk/heatermeter.hex" dated Sat Apr 15 2017 to the Uno. Everything is up and running, I’ve even got a servo attached to the Uno. I’m powering the RPi from the 5V pin on the Uno which I’ve got connected to a 9V power supply. I’m using the 3.3V power from the Uno for the probe wiring, and have verified with a meter the 100k resistor and 47K resistor. I have a functional Maverick 732 probe connected, but am getting readings about 115 degrees too high. I tried moving the probe circuit to all four pins on the Uno and they are all reading the same. I have 732 selected in the GUI and have entered a resistance value of 47000 which gets changed to "46999.998" when I apply the changes.

Some other notes:
I’ve tested it with and without the servo connected.
I’m running "LEDE Reboot SNAPSHOT r3799-13006712ea / LuCI Master (git-17.078.53745-180f2d6)"
The 47k resistor isn’t 1%, but it wouldn’t make that significant of a temperature difference.

I’m sure I’m missing something simple here, any assistance would be appreciated.

Thanks,
Jason
 
Is the 47K your pullup resistor? The stock value is 10K but I think there were alternate values to better suit certain probes.
 
I've tried it with both 10k and 47k. The only thing I can come up with is that Arduino's 3.3V rail is different from the MCP1700-33 on the Heatermeter board. On the Uno I measure 3.295V, anyone know what it is on a Heatermeter?
 
So after some testing it's not the voltage. I varied the voltage 200mV either side of 3.3 and wasn't able to improve anything. I'm stumped.
 
The Arduino is 5V and its ADC is fed by 5V as well. For thermistor probes, we only read the proportional voltage drop, not the absolute voltage. Therefore, you need to pull up the probes with 5V, not the 3.3V
 
Not for the thermistors. Thermocouples you'd need to adjust your mv/C to account for the 3.3/5.0V ratio change.
 
Uh oh, it turns out I may have needed a logic level converter to connect the Uno to the RPi. My setup has been acting strange, I thought I had a bad SD card or inadvertently shorted something. If I'm correct the RPi is 3.3V and the Uno is 5V, which means the serial and SPI connection is cooking the RPi.
 
That is correct! I had assumed you had already worked that out because you said you had them hooked up. The good news is that you can use simple resistor dividers to drop the voltage. Because you're not flashing the Uno from the Pi through SPI, just don't connect those wires at all. The only thing you need to hook up is:
Code:
Uno  Pi
5V  -> 5V
GND -> GND
TX  -> (shifter) -> RX
RX  -> TX

Shifter is just a 4.7k/10k resistor divider (put the 4.7k resistor in line directly, then attach the 10k to GND and the side of the 4.7k closest to the Pi's RX connection).
 
Because I'm getting lazy as I get older, I just use the $3 bi-directional logic level converters available off of ebay instead of making my own voltage dividers.
 
It is more of a "mass of wires and dangling boards" question for me. The logic level converters are great but there's less junk floating around the workbench if there's just a resistor inline and a resistor soldered between the header on the low-voltage end.
 
Just flash it with the avrdude that comes with Arduino (using the USB cable to a computer):
Code:
Assuming C:\Arduino install directory:
C:\Arduino\hardware\tools\avr\bin\avrdude -CC:\Arduino\arduino-1.8.0\hardware\tools\avr/etc/avrdude.conf -v -V -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:hm.hex:i 

Substitute COM5 for the actual port, and add a path to hm.hex if it isn't in the current directory.

But sounds like you're already flashed the heatermeter so you wouldn't need to do it again. If you're going to be editing the source then you can just compile and upload directly from the Arduino IDE.
 
So I added a level converter to this mix and a new Pi. The Pi seems to reboot whenever the serial connection is attached. The file system gets corrupted and only flashing it will get it to boot again. I put a scope on the level converter, it's doing it's job. My voltages all look good. I literally only have to add the RX side to the Pi and it dumps. The web interface sees the probe not connected for a second and it locks up and appears to reboot. I switched from a wall power supply to a bench supply, but no dice. Not sure where to go from here.
 
You can try putting like a 1k-10k resistor inline with the RX line and measure the voltage drop over it. It should have no voltage drop whatsoever (or less than a millivolt) indicating that no current is flowing (the RX line should be high impedance). If there is a voltage drop over the resistor, then current is flowing and that's a problem.
 
Thanks, but with a 1k resistor there is no discernible voltage drop.

I've narrowed it down to when my pit probe is connected. Possibly I've wired it up wrong? This is what I have based on the schematic.

ProbeWiring_small.jpg

ProbeWiring.jpg
 
Last edited:
It also seems SPI isn't happy with the level shifter I bought, TXB0108.
 
Last edited:
Man I was really hoping I had that messed up.

I cannot for the life of me figure out what is going on. I've simplified this as much as possible. I have the probe wired as shown above. I've eliminated the SPI connections and level shifter. I have a voltage divider on the Pi RX side and the only connections I have are TX, RX, 5V, and GND. As soon as I try and boot with the probe connected it works for a second then appears to reboot and hose the file system. I have to reflash the card to get it to boot again. I'm running on a bench supply, I had previously tried it with a wall switcher. I put a scope on the supply and am only seeing some common mode noise. I put a scope on the RX and I'm seeing what I think to be normal data. I've tried 2 Pis, 2 Unos, and 2 flash cards. I programmed the Uno from the IDE.
 
Last edited:
Yeah it is baffling to me as well. Clearly there's some sort of issue between them, but there really shouldn't be a problem. It seems like we're missing something really obvious here but I can't imagine what it could be with just those 4 wires and the divider on the Pi's RX.
 

 

Back
Top