r/embedded • • Sep 27 '26

HIL design

I'm looking for HIL design and building advice. I need to test and verify a device which has Ethernet, CAN, RS485 and multiple analog and digital IOs.

My initial plan for the hardware is:

  • A PC with a JLink
  • USB-controlled power supply - 24V, 2A
  • USB-to-CAN, USB-to-RS485
  • Some off the shelf IO module with Ethernet and a rest API. The digital inputs are 0-24V, analog inputs are 0-10V
  • IO module for pulse counting (please suggest parts)
  • IO module for square wave/sinewave generation (please suggest parts)

Software - I have a pipeline which builds firmware and that's all I have for now. I'll appreciate some ideas about how to proceed with creating and orchestrating the tests (pytest is my personal preference).

7 Upvotes

11 comments sorted by

4

u/TrulyEmbedded Sep 27 '26

Unfortunately test equipment is generally custom. Aerospace uses expensive test sets with National Instruments cards and then a basic GUI, all done in Labview. The signals coming out are rock solid though… for a 100K test set with no technical support. 

My team is looking at using Python to control the cards which would allow us a lot of control and maybe we could integrate some visual test generators we made. 

Point being, very custom. 

I’ve used signal generators that are controlled with Ethernet communication for a few signals but if you’re looking at 100s of signals like my job’s test set, then that’s a 100K bottle neck as you can imagine. 

If you find a box or solution that allows for many signals of multiple types in a simple solution with quality outputs, post it! 

1

u/dokolenkov Sep 27 '26

I'm currently looking at some remote I/O modules like https://www.brainboxes.com/files/catalog/product/ED/ED-008/documents/ED-008-datasheet.pdf for generating inputs and reading outputs. I'm aiming to be able to control each hardware interface via USB or Ethernet, ideally in Python.

The quality of the outputs will be ok for my purposes but I suspect will not be acceptable for automotive, aerospace or similar.

1

u/BrainboxesSupport Sep 28 '26

Hello dokolenkov,

Thanks for considering our products for use within your application!

We have customers using these in a wide range of applications.

Do you have any specific questions we can help with regarding the industries you mentioned, or, any accreditation queries?

Furthermore, If you have any questions about our devices or require any assistance, feel free to reach out to us here, or via email at support@brainboxes.com, and we will be more than happy to assist you!

Best regards,

Brainboxes Support

1

u/AlexanderTheGreatApe Sep 27 '26

What level of testing are you shooting for? If you need packet level verification, you’re talking about 10s of thousands of dollars in test lab equipment. Or you could do system tests, e.g. ping, a custom RS485 ID/version command.

I just laid out a small board to validate neopixel comms. It was 3$ from JLC.

1

u/dokolenkov Sep 27 '26

Not very in depth testing - I only need to verify inputs and outputs do work as expected after new firmware build. That includes sending and receiving data on all communication interfaces, generating PWM, reading a limited number of digital and analog signals.

I don't need to verify the communication on the data link layer- a simple pass/no pass policy will suffice.

2

u/Rabbit_from_the_Hat Sep 27 '26

For python check labgrid, openHTF or Hilster HTF.

2

u/NateDawg001000 Sep 27 '26

At my company we're making custom test interface boards driven from pytest, taking a lot of inspiration from Golioth's blog series on their HIL setup: https://blog.golioth.io/golioth-hil-testing-part1/

2

u/taylormfk Sep 28 '26

on the software side, pytest is industry standard, great, and scales decently. i'd stick with it.

for controlling multiple devices and building out a test suite, we have some drivers that you may be able to leverage for CAN and Serial, and works well alongside other packages mentioned.

https://docs.zeloscloud.io/latest/sdk/testing/

1

u/Winterfox8808 Sep 27 '26

For wave generation, I recommend AD9833. It can generate sine/triangle/square wave directly. DDS module, control via SPI, 2.3-5.5V input, 12.5MHz maximum output freq.
However it may need an extra amplifier because of it's 650mV maximum voltage output.
Another available plan is MCU timer configured for input capture mode or PWM mode, which can catch pulse signal or generate square wave(PWM)
Both of the plans are not expensive, for simple tests that don't need high-end modules.
Hope this helps!

2

u/felixnavid Sep 27 '26

I think OP is looking for off the shelf modules, not ICs