Category Archives: Electronics

Tesla Tinkering

Tesla Tinkering

The Tesla Model 3 has more cool features than you can throw an eclectic CEO at. From Autopilot to Emissions Testing, there is always another creative innovation guaranteed to amaze. One such fun feature is the ability to record video from the vehicle’s cameras. There are two situations where this can be done. At any time during vehicle operation, you can save the last several minutes of video by tapping the Dashcam icon. When in Sentry Mode, video recorded during detected events is automatically saved. The car doesn’t have onboard or cloud storage for recorded video. To enable the feature, you must format a USB flash drive with a FAT32 file system, add a root directory called “TeslaCam”, and plug the drive into the USB slot in the car. To access the stored video, remove the USB and plug it into a device to view or move the video files. Once the USB is full, the feature is not available until you free some of the USB storage by manually deleting files. This is great, but it begs for improvement. It would be wonderful if the video would automatically stream to a data storage service like Google Drive or Dropbox. An embedded device that emulates a USB flash drive but then connects to your WiFi and uploads your videos would do the trick. I dont know enough about USB to do this myself in the time that I have. Fortunately, it’s 2019. The open-source movement is so strong that not only has someone probably already done whatever you want to do, they probably made it available for free with detailed instructions on how to do it, and a team of volunteers now maintains and improves that project. That’s exactly the situation with Tesla’s video logging. An Open Source Solution Enter TeslaUSB, an open source project based on the Raspberry Pi Zero by GitHub user cimryan. The Raspberry Pi is a very small computer designed to run a simple Linux Operating System like Raspian. While the Raspberry Pi Zero only consumes about 0.7 W of power (much less than an incandescent light bulb), it has computing power similar to your smartphone. The TeslaUSB project takes a Raspberry Pi and turns it into a device that can be plugged into the Tesla USB port. The Tesla only sees a normal USB Flash drive and stores video on the Pi as it normally would. However, when the Pi detects your home WiFi network, it connects and moves the videos to a data storage service. This frees up its own storage space so that you never need to manually delete the videos. In fact, as long as you periodically drive your car within your home WiFi range, you don’t even need to think about it. While the open source community can sometimes lack in maintenance and documentation, its strength is that anyone can pitch in and bring new life to a project. The forums from early this year are full of users who had

Read More

Continuous Measurement of Fluid Density, Part 2: Parts and Plumbing

Continuous Measurement of Fluid Density, Part 2: Parts and Plumbing

Before the hiatus, I made an attempt at creating a Continuous Fluid Density Sensor. Here are the primary components: Two dip tubes in the fermenter MPXV7002DP differential pressure sensor ADS1115 16-bit analog to digital converter Generic, chrome plated brass, 2.5 mm hose barb to M3 adapters and 2.5 mm pneumatic hose Generic 12V aquarium diaphragm pump (model no longer listed on eBay) Plumbing The first step was to install new dip tubes into the fermenter. These are just two tubes in the tank that terminate with their openings directed downward. They are connected to cam-lock adapters on the outside of the tank for attachment to hoses. I also wanted the portions of pipe inside the fermenter to have as few recesses as possible to limit contamination by undesirable microbes. I soldered the NPT stainless fittings using acidic flux (I used Stay-Clean). The 1/4″ stainless tubing connects through a compression fitting. These leaves less room for leaks and microbes. Now that we have dip tubes between which to measure the pressure difference, the first step in design is to calculate the expected difference in the pressure at the tip of each tube. The difference in their heights is approximately 15 cm. The conversion between Pascals and centimeters of water is , so the differential pressure between the two tubes due to a column of water is: The original gravity for a generic pale ale is approximately 1.05, so the differential pressure at the beginning of fermentation would be: The final gravity for a generic pale is about 1.011, so the differential pressure at the end of fermentation would be And finally, the change in the differential pressure is . The dip tubes need to be connected to a differential pressure sensor. The pressure sensors in the price range for this application connect via 2.5 mm pneumatic hose, but there are no adapters between pipe fittings (what I use in my brewery) and this diameter hose. So, I made adapters by taking a short length of 1/2″ NPT copper pipe and soldering a brass hose barb into it. The plating on the brass interfered with the soldering, so grinding down the threads on the barb before soldering was necessary. Diaphragm Pumps Lastly, the dip tubes will have a tendency to fill with fluid. Measuring the differential pressure will require a means to push the fluid out and fill the tube completely with gas. That’s accomplished with two diaphragm pumps. These simply take gas from the top of the fermentor and push it through the tubing leading to the dip tubes. MPXV7002DP This device is a differential pressure sensor. It operates at 5V and outputs an analog voltage between 0.5V and 4.5V that is proportional to the pressure detected by the device. Specifications dictate that this device detects a -2.0 kPa to 2.0 kPa range at 2.5% average and 6.25% maximum error. The first question is whether this is a significant error. At a range of 4000 Pa, the average error is 100

Read More

The Slow Burn

Merry Christmas, everyone! I just put My Lan to bed and am waiting for the family to get back from the airport, so I thought I’d provide an update. My study schedule has curtailed my tinkering but hasn’t extinguished it entirely. I’ve been slowly making little changes and cobbling together a RIMS (Recirculation Infusion Mash System). The past four weeks of IR and nights has left me with many hours that were too odd to study but too scattered to sleep, so I managed to wrap much of it up.   Conical Bliss Before moving on to the news, I’d like to report that the conical fermenter is working great. I’ve read mixed reviews about the plastic conicals, and getting the conical into the cabinet with a clean-in-place configuration was no small feat. The convenience of 10 gallon batches, precise temperature control, and rapid kegging have proven worth it after only two batches. Watch how quickly I can fill a 5 gallon keg!   RIMS Mounting I took my seasoned 5400 W Camco heating element and mounted it in a 1.5″ stainless pipe. There’s a 1.5″ cam lock fitting for easy inspection. There’s also a 1/2″ thermowell mounted at the outlet for a 1/4″ temperature probe. The whole unit is mounted on a plastic cart from Harbor Freight, secured with cushioned stainless pipe hangers from eBay and 3/8″ stainless bolts cut to fit and secured to the cart with my Chugger pump and the control box.   It’s Probably Big Enough The enclosure has been a difficulty of its own. I underestimated the size of the L6-30 plugs I use for the 240 VAC connections since the circuit has to handle 25 A, so I had to make housings for the plugs only. You can see those monstrosities hanging off the bottom of the enclosure. Actually contained within the enclosure are a switch (on the left), an AGPtek PID controller, and an SSR with heat sink. The PID controller will eventually be substituted for a custom board, but that’s a project for the future.   Magic Smoke The SSR was also a frustration. I initially bought a Fotek SSR-40A, but it failed on its first cycle, giving up its magic smoke immediately. My expectations of evidence are high, so I grabbed the fire extinguisher and tried it twice more. When it looked like Independence Day in the enclosure, I concluded confidently that it was broken. I ordered a higher quality Berme brand 40A SSR, and it passed the initial test with flying colors.   Wires and Circuits and Breakers, Oh My! Lastly, I swapped out the 30 A dual pole circuit breaker for a similar breaker with a ground fault circuit interrupter. GFCI is a safety feature that breaks the circuit if there is a current outside the electrical circuit, for example, through your heart. These are the same devices on the plugs for blow dryers that have Test and Reset buttons, and they’re good to use in circuits that are near conductive fluids like wort. I’ll be brewing a Belgian-Style Stout this weekend

Read More

Work with your hands

When cooling wort with my countercurrent exchanger, it’s important to know the temperature as it comes out. The goal is to bring the wort to the optimal temperature for pitching yeast as quickly as possible. Many commercially available chillers have a thermometer at the wort outlet for this reason. I improvised during my last brew session because I didn’t have time to get the thermometers working. The Saints were doing terrible today, so I turned off the game and worked on getting the thermometers on my exchanger finished. All I really need is to know one temperature, so naturally I installed four thermometers. Yes, four. I’m nosy and I want to know them all. This is about more than validating the name of the blog. The energy balance for heat exchange looks like this: So, doing a heat balance on the exchanger requires the inlet and outlet temperatures of both streams, their heat capacities, and their mass flow rates. I may make full use of this later, but for now I can use the change in the temperature of the water to know how I’m doing with the trade off between efficiency and time. I had already installed my trusty OneWire thermometers in-line on the wort inlet, wort outlet, water inlet, and water outlet when I built the exchanger. They’re the black cables leading into the compression fittings. I just needed a way to talk to them. Enter the custom microcontroller with a NRF24L01+ breakout board. I posted about this little board a while ago. I originally intended it to control a valve with a stepper motor, but that was a bust. I’m going to redesign the valve, but this little prototype still needs a home. Fortunately, it has everything needed for the exchanger: the radio breakout board to communicate with another device and an exposed header that is compatible with a OneWire network. One step I’d skipped thus far in my misadventures is the experience of soldering my own perforated boards, but it finally came up. I’ve tried before and it was always a mess because I didn’t take the time to do it right. It’s easier to design the circuit on a breadboard, build the board in Eagle, and have it fabricated. I needed a way to connect all the thermometers to one header on the board. It wasn’t a big enough problem to design a whole board, but I did want something nicer than a bunch of spliced wires. I finally unpackaged a small perforated board and soldered a bus board. It seems pretty pathetic, but getting wire to stay in place while you solder across pads is annoying. Still, a little tape and a nice pair of needle nosed pliers go a long way. I’m not about to start soldering circuits more complicated than this simple header, but it’s nice to know I can manage not to fail miserably if the need arises. I destroyed yet another old tupperware to make a case, bolted in the custom board and the hand-made header, connected the thermometers, and fastened it to the

Read More

Cabinet 2.0

Trang and My Lan were out of town over the weekend. While I’ve mostly forgotten what it’s like to have the place to myself, I did manage to keep busy working on an academic manuscript and, of course, the brewery. Between the broken cabinet fan, the conversion from thermoelectric chips to a tube mounted water heater, and the conical installation, the cabinet has been in pieces for weeks. Fortunately, it’s slowly coming back together. I replaced the thermoelectric chips with a water heater mounted in a stainless steel tube. It’s only a 1200 W element but is much more powerful than the chips. I tested the system at only 1% power and the fluid temperature increased 10 degrees Celsius in about 30 seconds. Nuclear winter won’t keep me from my ales. I’ve also gone back to a smaller aquarium pump in a bucket. The Denner magnetic drive pump I had in place before was a little noisy and overpowered, so I’ll reuse that for my clean-in-place system. The bucket mounted pump is quiet, adequate for the system (I measure a flow rate of 30 mL/s), and can fit inside the refrigerator. Putting the fluid reservoir in the refrigerator might also allow me to make cooling more efficient. Secondly, I redid the wiring for the whole system. I run the power for the pump and heating element directly through the wall of the refrigerator. The thermosensor wiring is all new, with pre-terminated RJ-45 cables that don’t have to be secured with rubber-bands to maintain a connection. They’re all connected through my OneWire hub circuit board and providing reliable signal. I just need to tidy up the cables. The cabinet fan still doesn’t work although I’m sure the controller is providing power. The immersion coil may make the cabinet radiator obsolete in the summer, so I’m not in a hurry to fix it. Removing the thermistors frees up a second fan terminal for the controller, so I may put a large fan into the refrigerator to increase heat transfer at the copper coil inside. I’ll wait until I can run a cooling test with the conical in place to see just how cold I can get 5 gallons of water. Once my CIP fitting arrives, the conical will be ready to go into the cabinet. I’ve put my Chugger pump on a temporary mount. All I need is to put my burner on wheels and finish the counter-flow heat exchanger, and the back end of my brewery will be finished!

Circuit Board Woes

My guru told me long ago that I’d find myself cutting traces on printed circuit boards to problem solve. I thought I must have been lucky to go two-for-two without any hardware problems, but I found that the FTDI problem with my valve board was electronic, not software. I neglected to include a 100 nF capacitor between the FTDI DTR header and the ATMega328p reset line. I probably should have checked my FTDI header on the breadboard, but I must have instead assumed it behaved similar to the ICSP header reset connection, which connects directly to the reset pin. Anyway, I’ve finally cut my first trace to solder in the capacitor. Here it is successfully running the blink sketch, this time loaded via USB rather than AVR programmer. Considering that I’m redesigning the valve with a geared-up DC motor, the ICSP header wasn’t appropriately sized to allow a proper header, and I’d like to reorient the radio breakout board to not hang off the edge, I’ll probably have a new set of boards fabricated. Another day. I’m again on call tomorrow.

OneWire Header

Measurement of temperature is important to many stages of brewing. There are lots of options out there, but I decided on the DS18B20. What’s different about this device is that it’s not just a thermocouple or thermistor but a self contained chip with which you communicate digitally. The device communicates via the OneWire protocol, so multiple such devices can be connected through a single digital pin simultaneously. The protocol is involved, but there are two Arduino libraries that make getting these devices up and running a snap. The OneWire library provides for the basic communication protocol while the DallasTemperature library abstracts the specific commands for the DS18B20 and similar devices. The tricky thing about these thermometers is the wiring. Hooking up one or two is straightforward, but my first attempt at connecting five of these for my Fermentation Cabinet failed miserably. A little browsing of the forums revealed that I had used wire with too high an impedance and had used a star topology when connecting these in series allowed for more reliable communication. I bought some CAT5 cable, RJ45 plugs, and a crimping tool and got down to business. I spliced the thermometers to one end of the cable, connecting two-to-one. I crimped two plugs at the other end of the cable. One faces toward the microcontroller while the other connects to the thermometers further down the series. The cables are connected to one another by female-female adapters. This way, power, ground, and data all connected completely in series. The connections were not very secure, but rubber bands around the adapters held everything in place. The cabinet ran fine this way for months without connectivity problems. Even so, I decided a cleaner solution would be useful while working on my all grain design, which would require that I be able to assemble and disassemble the electrical connections for cleaning and storage. Here’s the diagram: This allows each cable to have only one plug and eliminates the need for all the female-female adapters, but it needs a special header for connecting the devices in series. Using a readily available Ethernet splitter board would have been nice but would have resulted in a star topology. Drafting a board and having it fabricated was fast, easy, and inexpensive. This board connects the jacks in a series configuration rather than in parallel. I can connect my Cabinet shield or my all-grain boards to this one, and then connect multiple thermometers. Obviously, since the connections are in serial the devices must be plugged adjacent to one another. To achieve a fully serial topology, the microcontroller board should be connected to either end. Here are three thermometers connected to an Uno through the board. Connections are confirmed using the OneWire address finder sketch. This board worked without a hitch with three thermometers. Considering that my Cabinet worked fine with the prior configuration, I have no doubt it will handle all five. I doubt I’ll have cause to test the circuit with longer cables, which is reportedly

Read More

Standalone Arduino

My custom Arduino shield for my fermentation cabinet gets the job done, it’s a less than optimal design. First, I used multiple individual optocouplers and transistors. It would have been much more elegant to use integrated components with multiple optocouplers and multiple transistors in one package. Second, I used only screw terminals, which are not very sturdy. Lastly, and mostly, shields aren’t great for a permanent board. For prototyping, they are quite an elegant solution. But for a permanent board, they’re bulky and constrained. Using Arduino boards for permanent implementations misses the whole purpose of a development board. Their price point is low enough for it to be feasible for single implementations, but it doesn’t avoid the design problem. The Arduino is designed for prototyping. I want equipment I can use for years. I’d been planning on creating a standalone board for the ATMega328p, but accelerated the plan when the Arduino split occurred. The idea was to create a very basic clone of the Arduino Uno without pin headers or USB interface. I want to be able to program either with an ICP programmer or an FTDI breakout board, so it will need headers for these. I plan on using the nrf24L01+ with multiple projects, so headers for the breakout board for that chip are also needed. A board design with these features makes a great template for many boards. The design is based on some instructions on the Arduino website for assembling a Standalone Arduino, with the additional of a smaller ceramic capacitor adjacent to the ATMega328p VCC pin. The simplest board I had planned was a board for a flow control valve. In addition to the template above, it needs an L293D H-bridge for driving a stepper motor, an electrolytic capacitor adjacent to the L293D VCC pin, a header for connecting to the motor to change the valve position, and a header for connecting to a potentiometer to detect valve position. In testing the prototype, I found that one NEMA 17 motor didn’t have enough juice, even with a gear ratio of 8. Rather than splicing wires, I just added a second header to the board. When I got my board back from OSH Park, I soldered in the components to give it a whirl. Unfortunately, I placed the ICP header too close to the radio nRF24L01+ header and had to replace it with two rows of pins instead of the nice jack that matches the 6-pin programmer cable. After a little voltmeter testing revealed that my chips weren’t completely seated in their sockets (you really have to jam them in), I successfully loaded the blink sketch with the programmer. As with the cabinet shield, I was amazed the design was right. I’m still having trouble getting the board to communicate via serial through an FTDI friend, but that’s a battle for another day.