×

Forget something during Black Friday/Cyber Monday? Check out the Week of Deals!

Member #47110

Member Since: September 4, 2008

Country: France

  • Welcome! Sadly the BLEPeripheral lib could really use some development love and possibly a redesign to support more features of these Nordic SoCs.

  • I have tried to do something similar with these Nordic nRF52832 chips (just we had a Chinese module instead). Here are a few observations:

    • Don't waste your time with BLEPeripheral library and Arduino on these boards. Except for extremely basic things it just does not work, it requires hacks to get the right version of the Nordic "softdevice" binary blob, it works only with a very old "softdevice" version, so a lot of functionality either does not work at all or is buggy (such as bonding). The API is easy to use and most of the Bluetooth LE complexity is swept under the rug but what good is that if the device is failing randomly.

    • The Nordic SDK is excellent and has very good documentation. However, expect steep learning curve! The examples and documentation assume that you know how BLE works already, so it is very advisable to read up something first or you will get overwhelmed quickly. On the other hand, I have managed to get both serial port to work (BLE doesn't have "profiles", so don't look for those. There is the GATT protocol and everything works on top of that) and also a HID device (HID over GATT), persistent bonding with automatic reconnections, etc. Haven't tried to implement a central role but the SDK has examples of it.

    • Segger Embedded Studio - not worth wasting time on, IMO, unless you are working on that platform already (and are paying for it). PlatformIO or Visual Studio Code will do the same service for you, even if you are using the Nordic SDK - the SDK is very simple to integrate, you literally have to add all files from the SDK (except for the examples) to your build ... Just use the makefiles shipped with the examples as the starting point.

    • PlatformIO - the problem with PlatformIO and nRF52 series is a rather boneheaded way they have added the support. Instead of making it work with any sort of SWD debugger that works with ARM they have for whatever reason specified only certain debuggers for certain boards and that's it. It won't allow you to program or debug the device with anything else. If you have a bare bones SoC, then likely it is only CMSIS-DAP or J-Link. I didn't have neither ... You can either flash the device from command line using OpenOCD and any SWD dongle that OpenOCD supports (PlatformIO uses OpenOCD internally anyway) or buy one of the cheap Chinese STLink clones and reflash it with CMSIS-DAP firmware (that's what I have done - after replacing the dodgy STM32F103 in it).
      However, you will want CMSIS-DAP or the (expensive) J-link, because many of these nRF52 series modules come with the debug port (DAP) locked down for whatever reason by the module manufacturer. So you can't even clear the flash, OpenOCD will report a weird error and refuse to talk to the chip. The only dongles with which it is possible to issue the OpenOCD DAP commands to unlock it are CMSIS-DAP and J-link. STLink will flash the board but if you can't unlock the debug port first it is of no use (but you can use it to flash/debug an already unlocked device).

    • Debugging - if you are using the softdevice (required for BLE and ANT, not needed if you are using shockburst, i.e. the protocol compatible with the older popular nRF24L01+ modules), then debugging is a pain. It is an RTOS running asynchronously and if you stop on a breakpoint anywhere, the internal timers used for scheduling events, such as sending packets on the radio, will time out and cause a crash if you attempt to resume from it.

    • Peripherals - nRF52 is weird. It has a ton of peripherals but most are very tailored towards BLE and the various radio-related functions (such as cryptography, checksums, etc.). The rest is both quite basic (compared to normal ARM MCUs such as NXP's or STM32s or even AVRs or PICs) and has quite unusual API. Instead of setting registers you send and react to events, almost every peripheral could be switched to almost every pin ... It is an interesting device and takes a while to grok, to say the least.

    • nRF52 is wonderful for battery life - even at full blast, busy advertising and running an ADC it draws <10mA. While sleeping the power draw is down in tens of uA ...

  • Good writeup!

    However, you should point out that this is in no way RPi specific. Udev is part of any modern Linux for quite a while now and this information applies the same to Linux on a PC, BeagleBone, OrangePi, some hacked wireless router or any other Linux running device. I am sure it could be useful knowledge for someone.

  • I hope you are only trolling or didn't read the specs.

    Analog Discoveries (both the old one and this one) are fairly serious all-in-one lab instruments. Here you are getting a mixed signal oscilloscope and arbitrary signal generator + logic analyzer. This thing runs circles around most of the USB "oscilloscopes" on the market.

    Good luck trying to achieve any of that with a $3 micro.

    Red Pitaya is perhaps a bit more powerful in terms of the raw hw, but the Analog Discovery has much better software and support. If you want an instrument instead of a dev board, the Discovery is a lot better deal.

    However, Sparkfun should carry also the BNC breakout board that goes with it, so that standard scope probes and coax cables for the generator can be used. http://store.digilentinc.com/bnc-adapter-board-for-the-analog-discovery/

  • for $2.95 you can use the Picaxe 08M2, which is easier,

    The 555 costs $0.2 on Digikey and you don't need any proprietary tools.

  • Using a $2 micro for doing the work of a $0.1 chip (in quantity). Seriously? Maybe hobbyist building a one-off where the labour and price are irrelevant, but for anything else the 555 is still going to win - if for nothing else then because it doesn't need to be programmed. That is an extra operation that costs $$$ unless you are buying a ton of them where you can get them pre-programmed.

    I get that Sparkfun is mostly targetting hobbyists and not pros designing for manufacturing, but you should try to educate people about these issues. It would save us from yet another failed Kickstarter where some fools decided to build a smartphone using an Arduino or some similar nonsense.

    BTW, if you want to adjust the duty cycle without changing the frequency use a dual 555. First will work as an astable multivibrator and the second will be adjustable monostable flip-flop, "shortening" the pulse length according to the duty cycle required. I have built a fan controller like this, works a treat and costs peanuts.

  • Hello,

    LOL, I am not an industrial design engineer, let's say that I am bit more experienced hobbyist :)

    Re that transformer - it is better than I thought, at least there is the insulating tape (I have seen many of these cheapo PSUs without!). However, I would have expected the primary connections to be better insulated/sleeved so that they are protected against abrasion (the enamel alone is not good enough there). Check out the transformer in the Apple charger to see what am I talking about: http://www.righto.com/2012/05/apple-iphone-charger-teardown-quality.html

    In addition, the winding wire isn't tripple insulated, which is, apparently, a requirement for passing UL certification (which it doesn't have, obviously). So all it takes is a power surge for the windings to arc through the tape and BOOM.

    I also doubt that the FCC mark is legit, because the PSU lacks any filtering - thus will not pass any EMC testing. And the fake CE ("China Export", ehm ...) you have mentioned.

    A better quality transformer wouldn't cost all that much more and be a lot safer. I think pinching pennies on mains power supplies is a really bad idea - lives and property are at stake. Unfortunately, many stores even here in Europe are selling similar crap. Please, do better and don't import these things. They are cheap, but only until someone gets hurt and you get sued ...

  • Hello,

    Good to see that you are addressing this issue. I have a few tips/comments, though:

    • MeanWell is well accepted PSU brand, they make pretty solid industrial supplies. Not as good as Lambda, but generally way above the average junk. However, it should be made clear that those are industrial supplies, not something to be sold to beginners to power their toys with. The supplies lack insulation and safety features for that - e.g. the freely accessible mains terminals or lack of proper cover, because these are meant to be built into an enclosure.

    • Please, make a follow-up and explain why some of these supplies are good or bad. Things to look for when someone wants to check their cheap supply. Creepage distance, clearances between the parts, insulation, presence (or lack of) filters and PFC (switchers lacking input filters and PFC are illegal to sell in EU now, they wouldn't pass compliance testing).

    • I would also mention things like insulation of the main transformer. That is difficult to see, but I would bet my hat on the fact that the cheap 12V/5V supply is a deathtrap because of poorly insulated windings. The cheap supplies often rely only on the enamel insulation to separate the mains wiring from the secondaries, instead of having proper insulation layers between the windings. All it takes is a bit of wear and the output becomes live. Please, don't sell these cheap junkers, someone may get hurt or a house be set on fire.

    • From the less critical points - check things such as output regulation (is there a separate regulator per rail or only the PMIC on the primary?), quality (or lack of it) of the output caps (poor/cheap caps = high ESR = noisy output and rapid failure).

  • Hello Mark,

    Thanks for replying.

    I didn't suggest to actually use pyros, that would probably not be a good idea for multiple reasons (imagine it firing around spilling fuel, even though the patrones are actually enclosed in a real pretensioner). There are several types of these pretensioners around - the one using a pyropatrone that activates in the case of crash (similar to airbags and controlled by the same system), then ones using electrical motors and finally a purely mechanical one (the oldest system) using springs. The point is to minimize electronics and moving parts to minimize the points of failure. That is where the seatbelt pretensioners as an inspiration for the design could be a good idea.

    Re mass: careful, I was speaking about moving mass, not the static weight of the device (which is, indeed, supported by the shoulders). The moving mass comes into play when you have strong accelerations, especially lateral ones. The mere mass of the helmet is the reason why drivers specially train their neck muscles because otherwise they wouldn't be able to cope with the enormous centripetal forces produces by the helmet while cornering - that is the reason it is "frowned upon" in open wheel racing. In rallying the forces are smaller, but it is still significant, especially in a case of an accident like a rollover. So adding extra stuff in a place where it could add to this mass is a really poor idea.

    One solution would be to displace the electronics and have it linked with a lightweight actuator on the HANS by a cable with a quick disconnect connector. The drivers use cables for their helmet microphones/headphones, intercoms or even medical sensors already, so this could be integrated with that in order to not require additional cable to be removed in an emergency. I would also move the (relatively heavy) actuators down, lower on the driver's back, closer to the driver's centre of mass, reducing the leverage it produces on the neck. That would need some engineering in order to keep the driver safely in the seat and comfortable, though.

  • Nice project, but this is basically a re-invented seatbelt pre-tensioner. Moreover, those are functionally quite a bit simpler, some even using pyrotechnics to tension the belts in the case of an impact - very important for a safety critical device. The fewer things that could fail, the better.

    Also, you certainly don't want to put anything of a significant mass on the driver's neck/head. At the accelerations the race car drivers experience during the race this could be a major liability because it becomes a heavy "rock" tied to their neck. That would increase the strain on their neck muscles and potentially risk injury (you certainly don't want your safety device meant to prevent the driver from breaking their neck to actually break their neck ...). There is a good reason for why HANS is so mechanically simple - the mass of the device is of a paramount importance.

No public wish lists :(