Category Archives: PCBA & ENG

Digital Input Simulation

Nominal automotive voltages range widely. Your circuit needs to handle anywhere from 10V to 15V to properly function correctly. This is a challenge on the power supply side but it is forgotten often on the input/output control side of the circuits.

Below is my current digital input circuit for the Cyclone Pulse Wrangler. This is an active low circuit. A switch pulls AUX_DIGITAL_IN to ground. This goes through some filtering and a voltage divider so the 3.3V MCU can safely determine if the switch is activated or not.

On the MCU side (SAM D21 in this case), there is a threshold on the GPIO input on where the MCU considers the difference between a high or low signal. We need to make sure over the range of the power supply voltage (10V to 15V) that the MCU considers it to be a high signal.

This in page 875 of the family datasheet. VDD is 3.3V in our circuit. VIL and VIH is what is important here. VIL is 0.99V and VIH is 1.815V. This means if the voltage on the GPIO pin is high and drops below 0.99V then the MCU will register that as a low. If the signal is low and rises above 1.815V then it will consider it a high. Between these voltages it doesn’t initiate a state change.

We need to check to see our circuit stays above 1.815V output across the entire span. LTSpice is a goodish program to do this

Above is the circuit in LTSpice. Stepping the +V from 10V to 15V gives the following output.

Well that isnt good! At 15V we get ~1.9V but at 10V we get ~1.26V which is in our gray zone! Lets change the 2.9K to 5.1K (R33) and see what we get.

OK! Everything is in our deterministic range for a high signal! But lets check for resistor tolerances. Running a monte carlo simulation with 1% resistors gives us the following outputs. 10V rail and then 15V rail.

Well that looks good as well. Digital input should operate fine on the Cyclone Pulse Wrangler!

Thermistor Readings

Automotive temperature sensors are typically thermistors. Resistance changes as the temperature changes. Most of the time you don’t want this to happen in normal resistors but thermistors are designed to change in a predictable manner so they can be used as sensors.

There are multiple ways to read the resistance of a thermistor but the easiest way is to make it part of a resistor voltage divider and use an ADC to convert the mid point to the temperature.

This is the circuit I designed for the Cyclone Pulse Wrangler.

This is lifted from a variety of open source engine control hardware circuits.

I don’t know who or where the original 2.49K ohm pull up is from but most aftermarket sensors reference that pull up as well. I like AEM sensors and use the 30-2013 sensor in a lot of projects. They include easy to find calibration charts.

Now this is great if you are using a 5.0V sensor rail but the Cyclone Pulse Wrangler only has a 3.3V rail so some conversion is needed. I used chatGPT to convert the chart in the datasheet for the sensor into a CSV file I could import into a google doc.

Then just used some ohms law magic to make the below chart. Here is a link to the google doc if you want to see the formulas and copy it for other sensors.

There are some downsides to this method. Since you are passing current through the thermistor there is some self heating involved which will of course change the resistance of the thermistor… and then change the current… and then change the resist…. yeah you see where this is going. Here is a good paper on measurement error in thermistors due to self heating by Ti.

A way around that is to control the voltage supply that goes into the voltage divider and only turn it on when you need a reading. Chips like the MAX6682 do this automatically. A high side fet could be incorporated into the design.

Is this a big problem in automotive applications? Engines run around the 100C mark so lets use that resistance from the chart above (175 ohms).

With the 2.49K resistor on the top side of the divider we get a voltage of 0.217V across our thermistor. That is ~0.00124A of current across it. We are talking 0.00026908 watts. Compared to the engine coolant. This is nothing.

Another source of error is current through the ADC. You want a high impedance here to prevent leakage current changing the reading. Most modern ADCs in MCUs are going to be high enough to prevent this being an issue in an automotive setting but it is always good to check if you are using a high end ADC that has low input impedance. An instrumentational opamp might be needed.

Converting to LibrePCB

With Eagle being having a sunset date from Autodesk and not wanting to use Autodesk Electronics (Eagle in Fusion). I looked for EDA tool alternatives. I spent a good portion of the beginning of 2024 learning and building a product in KiCad v8. See the launch video below.

After fighting KiCad for months, I gave up and will be trying out LibrePCB.

I have converted my Cyclone Pulse Wrangler circuit to LibrePCB. So far I am very happy with the tool. It needs a few QOL improvements but, overall, much more enjoyable experience then KiCad. I am not constantly looking up how to do simple actions.

LibrePCB has a REALLY good Eagle Part Library importer. One of the best I have ever used.

The tool also supports plated slots in the footprint editor natively. No “workarounds” that are required in Eagle and KiCad to pull them off.

I have only used the library and schematic editor. Both are missing more complex tools that Eagle and KiCad have but for 99% of PCB designers and users. They will never use those… and I rarely use them as well.

Let us see how the PCB layout tool is!

The Cyclone Pulse Wrangler

This is the evolution of the “jeep prop fan” controller I built what feels like a life time ago.

I did build this board as well back in 2016 but never finished the code or used it in the Jeep.

Here is the github repo of what I have so far. I did a complete redesign and rescope of the project. The original was more of a Power Control Module. Gonna try to stick to just a PWM fan controller this time around.

https://github.com/LonghornEngineer/Cyclone-Pulse-Wrangler

Biggest change was moving to a SAMD21 mcu. Have lots of these left over from my pinball controller days.

This is the PWM output circuit. Pulling the signal to 12V though a 100ohm 1/4W resistor. A2N7002H-HF n-channel fet pulls it down.

Here is the digital inputs to the system. These are active low inputs. 12V is the high. I am using a voltage divider to knock down what is the max voltage of ~14.7V to ~3.3V. I am not 100% sold on this circuit yet and might go with an optocoupler if convinced with the right part number. A 3.6V Zener Diode (BZT52C3V6-TP) helps make sure that I/O pin doesn’t get too out of wack.

To read the temperature sensors, which are thermistors, I just lifted the circuit that other engine control uses. Low pass filter and a pullup. I/O pins are protected with a SP721ABG SCR/Diode chip.

The last part to highlight so far is the driver outputs. These can be used to drive relays or indicator lights or whatever. These can be a voltage source or a ground sink depending on what is needed. Basically a half bridge setup. Don’t set both I/O pins high :wink: Maybe I add in some gate logic to prevent shoot through condition? Or just write the code with a check before setting the outputs?

Cat Feeder Unreminder Breadboarded

I got the entire project onto a breadboard… mostly! A combination of evaluation boards and breakout boards and I was able to verify all the subsystems are working correctly together.

The entire system draws ~5.6uA at 3.3V from the super capacitors. Measured through the uCurrent.

Here is the breadboard with the subsystems called out.

Up next is to complete the enclosure design and then the board layout!

DG469 Analog Switch

The DG469 is an analog switch that can be controlled with digital signals. The switching part of the chip is bi-direction which is perfect for switching analog signals.

The DG469 designed in Eagle in the SOIC-8 package.

I will be using this IC to switch which segments on the TN LCD get powered up. The NC (Normally Connected) will send power to the “Don’t feed” notification state. The NO (Normally Open) will send power to the “Feed” notification state.

It also has very low power requirements which will be perfect for my project.

Here is the schematic for the DG469 for the Cat Feeder Unreminder.

I put V- to ground through a jumper because the datasheet isn’t very clear on how to set it up for unipolar power supplies. Gives me a chance to change what that voltage is.

Wiring up the CFU Display

The CFU (Cat Feeder Unreminder) will notify the user that it is safe and timely to feed the cat through a use of a TN style LCD. These are typically a 7-segment style instead of graphical. The CFU also needs to notify the user that the device is still operating.

Part Number: VI-422-DP-RC-S

The common (COM) pin of the display will be directly connected to one leg of the oscillator circuit. Depending on where the other leg of the oscillator is routed, the display will either show “FEEd” or will light up the S1 segment.

LTC2956 Schematic for the Cat Feeder Unreminder

Based on my testing of the evaluation board, this is the schematic for the LTC2956 I am using in the Cat Feeder Unreminder.

The resistor from RANGE to LONG pin is set to 100K ohms. This is specified in the datasheet.

To set the actual time for the timer to activate the EN pin (t PERIOD), You need to first select the range resistance from the chart below. In my case I want to activate every 22hrs. 162K ohms is the resistor I chose which sets NRANGE to 262,144.

To calculate the period resistor, this is the formula provided by in the datasheet.

RPERIOD = 400 • tPERIOD/NRANGE

For 22hrs, tPERIOD becomes 22 x 60 x 60 x 1000 = 79,200,000. This gives an R PERIOD of 120,849.609 ohms. I picked a 121K ohm resistor.

To send the device into the sleep state, I tied the SLEEP signal through a switch to VCC (3.3V). This brings SLEEP high on button press. When the button is released, SLEEP has a falling edge which is what the LTC2956 is looking for to send it into the sleep state.